esp-nimble-cpp 2.0.2
|
A model of a BLE Human Interface Device. More...
#include <NimBLEHIDDevice.h>
Public Member Functions | |
NimBLEHIDDevice (NimBLEServer *server) | |
Construct a default NimBLEHIDDevice object. | |
void | setReportMap (uint8_t *map, uint16_t) |
Set the report map data formatting information. | |
void | startServices () |
Start the HID device services. This function called when all the services have been created. | |
bool | setManufacturer (const std::string &name) |
Get the manufacturer characteristic (this characteristic is optional). | |
void | setPnp (uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version) |
Sets the Plug n Play characteristic value. | |
void | setHidInfo (uint8_t country, uint8_t flags) |
Sets the HID Information characteristic value. | |
void | setBatteryLevel (uint8_t level, bool notify=false) |
Set the battery level characteristic value. | |
NimBLECharacteristic * | getBatteryLevel () |
Get the battery level characteristic. | |
NimBLECharacteristic * | getReportMap () |
Get the report map characteristic. | |
NimBLECharacteristic * | getHidControl () |
Get the HID control point characteristic. | |
NimBLECharacteristic * | getInputReport (uint8_t reportId) |
Get the input report characteristic. | |
NimBLECharacteristic * | getOutputReport (uint8_t reportId) |
Get the output report characteristic. | |
NimBLECharacteristic * | getFeatureReport (uint8_t reportId) |
Get the feature report characteristic. | |
NimBLECharacteristic * | getProtocolMode () |
Get the HID protocol mode characteristic. | |
NimBLECharacteristic * | getBootInput () |
Get a keyboard boot input report characteristic. | |
NimBLECharacteristic * | getBootOutput () |
Create a keyboard boot output report characteristic. | |
NimBLECharacteristic * | getPnp () |
Get the PnP characteristic. | |
NimBLECharacteristic * | getHidInfo () |
Get the HID information characteristic. | |
NimBLEService * | getDeviceInfoService () |
Get the manufacturer characteristic. | |
NimBLEService * | getHidService () |
Get the HID service. | |
NimBLEService * | getBatteryService () |
Get the battery service. | |
A model of a BLE Human Interface Device.
NimBLEHIDDevice::NimBLEHIDDevice | ( | NimBLEServer * | server | ) |
Construct a default NimBLEHIDDevice object.
[in] | server | A pointer to the server instance this HID Device will use. |
NimBLECharacteristic * NimBLEHIDDevice::getBatteryLevel | ( | ) |
Get the battery level characteristic.
NimBLEService * NimBLEHIDDevice::getBatteryService | ( | ) |
Get the battery service.
NimBLECharacteristic * NimBLEHIDDevice::getBootInput | ( | ) |
Get a keyboard boot input report characteristic.
This will create the characteristic if not already created.
NimBLECharacteristic * NimBLEHIDDevice::getBootOutput | ( | ) |
Create a keyboard boot output report characteristic.
This will create the characteristic if not already created.
NimBLEService * NimBLEHIDDevice::getDeviceInfoService | ( | ) |
Get the manufacturer characteristic.
NimBLECharacteristic * NimBLEHIDDevice::getFeatureReport | ( | uint8_t | reportId | ) |
Get the feature report characteristic.
[in] | reportId | Feature report ID, the same as in report map for feature object related to the characteristic. |
This will create the characteristic if not already created.
NimBLECharacteristic * NimBLEHIDDevice::getHidControl | ( | ) |
Get the HID control point characteristic.
NimBLECharacteristic * NimBLEHIDDevice::getHidInfo | ( | ) |
Get the HID information characteristic.
NimBLEService * NimBLEHIDDevice::getHidService | ( | ) |
Get the HID service.
NimBLECharacteristic * NimBLEHIDDevice::getInputReport | ( | uint8_t | reportId | ) |
Get the input report characteristic.
[in] | reportId | Input report ID, the same as in report map for input object related to the characteristic. |
This will create the characteristic if not already created.
NimBLECharacteristic * NimBLEHIDDevice::getOutputReport | ( | uint8_t | reportId | ) |
Get the output report characteristic.
[in] | reportId | Output report ID, the same as in report map for output object related to the characteristic. |
This will create the characteristic if not already created.
NimBLECharacteristic * NimBLEHIDDevice::getPnp | ( | ) |
Get the PnP characteristic.
NimBLECharacteristic * NimBLEHIDDevice::getProtocolMode | ( | ) |
Get the HID protocol mode characteristic.
NimBLECharacteristic * NimBLEHIDDevice::getReportMap | ( | ) |
Get the report map characteristic.
void NimBLEHIDDevice::setBatteryLevel | ( | uint8_t | level, |
bool | notify = false |
||
) |
Set the battery level characteristic value.
[in] | level | The battery level value. |
[in] | notify | If true sends a notification to the peer device, otherwise not. default = false |
void NimBLEHIDDevice::setHidInfo | ( | uint8_t | country, |
uint8_t | flags | ||
) |
Sets the HID Information characteristic value.
[in] | country | The country code for the device. |
[in] | flags | The HID Class Specification release number to use. |
bool NimBLEHIDDevice::setManufacturer | ( | const std::string & | name | ) |
Get the manufacturer characteristic (this characteristic is optional).
The characteristic will be created if not already existing.
void NimBLEHIDDevice::setPnp | ( | uint8_t | sig, |
uint16_t | vid, | ||
uint16_t | pid, | ||
uint16_t | version | ||
) |
Sets the Plug n Play characteristic value.
[in] | sig | The vendor ID source number. |
[in] | vid | The vendor ID number. |
[in] | pid | The product ID number. |
[in] | version | The produce version number. |
void NimBLEHIDDevice::setReportMap | ( | uint8_t * | map, |
uint16_t | size | ||
) |
Set the report map data formatting information.
[in] | map | A pointer to an array with the values to set. |
[in] | size | The number of values in the array. |