NimBLE-Arduino 1.4.2
|
A model of a BLE Human Interface Device. More...
#include <NimBLEHIDDevice.h>
Public Member Functions | |
NimBLEHIDDevice (NimBLEServer *) | |
Construct a default NimBLEHIDDevice object. More... | |
void | reportMap (uint8_t *map, uint16_t) |
Set the report map data formatting information. More... | |
void | startServices () |
Start the HID device services. This function called when all the services have been created. | |
NimBLEService * | deviceInfo () |
Returns a pointer to the device information service. | |
NimBLEService * | hidService () |
Returns a pointer to the HID service. | |
NimBLEService * | batteryService () |
Returns a pointer to the battery service. | |
NimBLECharacteristic * | manufacturer () |
Create a manufacturer characteristic (this characteristic is optional). | |
void | manufacturer (std::string name) |
Set manufacturer name. More... | |
void | pnp (uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version) |
Sets the Plug n Play characteristic value. More... | |
void | hidInfo (uint8_t country, uint8_t flags) |
Sets the HID Information characteristic value. More... | |
void | setBatteryLevel (uint8_t level) |
Set the battery level characteristic value. More... | |
NimBLECharacteristic * | hidControl () |
Returns a pointer to the HID control point characteristic. | |
NimBLECharacteristic * | inputReport (uint8_t reportID) |
Create input report characteristic. More... | |
NimBLECharacteristic * | outputReport (uint8_t reportID) |
Create output report characteristic. More... | |
NimBLECharacteristic * | featureReport (uint8_t reportID) |
Create feature report characteristic. More... | |
NimBLECharacteristic * | protocolMode () |
Returns a pointer to the protocol mode characteristic. | |
NimBLECharacteristic * | bootInput () |
Creates a keyboard boot input report characteristic. | |
NimBLECharacteristic * | bootOutput () |
Create a keyboard boot output report characteristic. | |
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::featureReport | ( | uint8_t | reportID | ) |
Create feature report characteristic.
[in] | reportID | Feature report ID, the same as in report map for feature object related to the characteristic |
void NimBLEHIDDevice::hidInfo | ( | 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. |
NimBLECharacteristic * NimBLEHIDDevice::inputReport | ( | uint8_t | reportID | ) |
Create input report characteristic.
[in] | reportID | input report ID, the same as in report map for input object related to the characteristic |
void NimBLEHIDDevice::manufacturer | ( | std::string | name | ) |
Set manufacturer name.
[in] | name | The manufacturer name of this HID device. |
NimBLECharacteristic * NimBLEHIDDevice::outputReport | ( | uint8_t | reportID | ) |
Create output report characteristic.
[in] | reportID | Output report ID, the same as in report map for output object related to the characteristic |
void NimBLEHIDDevice::pnp | ( | 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::reportMap | ( | 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. |
void NimBLEHIDDevice::setBatteryLevel | ( | uint8_t | level | ) |
Set the battery level characteristic value.
[in] | level | The battery level value. |