18#ifndef NIMBLE_CPP_HIDDEVICE_H_
19#define NIMBLE_CPP_HIDDEVICE_H_
22#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER) && defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
27# define GENERIC_HID 0x03C0
28# define HID_KEYBOARD 0x03C1
29# define HID_MOUSE 0x03C2
30# define HID_JOYSTICK 0x03C3
31# define HID_GAMEPAD 0x03C4
32# define HID_TABLET 0x03C5
33# define HID_CARD_READER 0x03C6
34# define HID_DIGITAL_PEN 0x03C7
35# define HID_BARCODE 0x03C8
37# define PNPVersionField(MajorVersion, MinorVersion, PatchVersion) \
38 ((MajorVersion << 16) & 0xFF00) | ((MinorVersion << 8) & 0x00F0) | (PatchVersion & 0x000F)
54 void setPnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
55 void setHidInfo(uint8_t country, uint8_t flags);
The model of a BLE Characteristic.
Definition NimBLECharacteristic.h:40
A model of a BLE Human Interface Device.
Definition NimBLEHIDDevice.h:47
NimBLECharacteristic * getProtocolMode()
Get the HID protocol mode characteristic.
Definition NimBLEHIDDevice.cpp:300
NimBLECharacteristic * getHidInfo()
Get the HID information characteristic.
Definition NimBLEHIDDevice.cpp:332
NimBLEService * getHidService()
Get the HID service.
Definition NimBLEHIDDevice.cpp:348
NimBLECharacteristic * getBatteryLevel()
Get the battery level characteristic.
Definition NimBLEHIDDevice.cpp:308
bool setManufacturer(const std::string &name)
Get the manufacturer characteristic (this characteristic is optional).
Definition NimBLEHIDDevice.cpp:98
void startServices()
Start the HID device services. This function called when all the services have been created.
Definition NimBLEHIDDevice.cpp:87
NimBLEService * getDeviceInfoService()
Get the manufacturer characteristic.
Definition NimBLEHIDDevice.cpp:340
NimBLECharacteristic * getBootInput()
Get a keyboard boot input report characteristic.
Definition NimBLEHIDDevice.cpp:264
void setPnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version)
Sets the Plug n Play characteristic value.
Definition NimBLEHIDDevice.cpp:118
void setBatteryLevel(uint8_t level, bool notify=false)
Set the battery level characteristic value.
Definition NimBLEHIDDevice.cpp:145
NimBLECharacteristic * getHidControl()
Get the HID control point characteristic.
Definition NimBLEHIDDevice.cpp:292
NimBLECharacteristic * getPnp()
Get the PnP characteristic.
Definition NimBLEHIDDevice.cpp:324
void setReportMap(uint8_t *map, uint16_t)
Set the report map data formatting information.
Definition NimBLEHIDDevice.cpp:79
NimBLECharacteristic * getFeatureReport(uint8_t reportId)
Get the feature report characteristic.
Definition NimBLEHIDDevice.cpp:238
NimBLECharacteristic * getOutputReport(uint8_t reportId)
Get the output report characteristic.
Definition NimBLEHIDDevice.cpp:209
NimBLECharacteristic * getBootOutput()
Create a keyboard boot output report characteristic.
Definition NimBLEHIDDevice.cpp:278
NimBLEService * getBatteryService()
Get the battery service.
Definition NimBLEHIDDevice.cpp:356
void setHidInfo(uint8_t country, uint8_t flags)
Sets the HID Information characteristic value.
Definition NimBLEHIDDevice.cpp:135
NimBLECharacteristic * getInputReport(uint8_t reportId)
Get the input report characteristic.
Definition NimBLEHIDDevice.cpp:181
NimBLECharacteristic * getReportMap()
Get the report map characteristic.
Definition NimBLEHIDDevice.cpp:316
The model of a BLE server.
Definition NimBLEServer.h:60
The model of a BLE service.
Definition NimBLEService.h:34