15#ifndef _BLEHIDDEVICE_H_
16#define _BLEHIDDEVICE_H_
19#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
21#include "NimBLECharacteristic.h"
22#include "NimBLEService.h"
23#include "NimBLEDescriptor.h"
26#define GENERIC_HID 0x03C0
27#define HID_KEYBOARD 0x03C1
28#define HID_MOUSE 0x03C2
29#define HID_JOYSTICK 0x03C3
30#define HID_GAMEPAD 0x03C4
31#define HID_TABLET 0x03C5
32#define HID_CARD_READER 0x03C6
33#define HID_DIGITAL_PEN 0x03C7
34#define HID_BARCODE 0x03C8
36#define PNPVersionField(MajorVersion, MinorVersion, PatchVersion) ((MajorVersion << 16) & 0xFF00) | ((MinorVersion << 8) & 0x00F0) | (PatchVersion & 0x000F)
56 void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version);
58 void hidInfo(uint8_t country, uint8_t flags);
The model of a BLE Characteristic.
Definition: NimBLECharacteristic.h:63
A model of a BLE Human Interface Device.
Definition: NimBLEHIDDevice.h:41
NimBLEService * deviceInfo()
Returns a pointer to the device information service.
Definition: NimBLEHIDDevice.cpp:247
NimBLECharacteristic * protocolMode()
Returns a pointer to the protocol mode characteristic.
Definition: NimBLEHIDDevice.cpp:209
NimBLEService * batteryService()
Returns a pointer to the battery service.
Definition: NimBLEHIDDevice.cpp:261
void hidInfo(uint8_t country, uint8_t flags)
Sets the HID Information characteristic value.
Definition: NimBLEHIDDevice.cpp:135
NimBLECharacteristic * manufacturer()
Create a manufacturer characteristic (this characteristic is optional).
Definition: NimBLEHIDDevice.cpp:94
NimBLECharacteristic * bootInput()
Creates a keyboard boot input report characteristic.
Definition: NimBLEHIDDevice.cpp:188
NimBLECharacteristic * featureReport(uint8_t reportID)
Create feature report characteristic.
Definition: NimBLEHIDDevice.cpp:175
void pnp(uint8_t sig, uint16_t vid, uint16_t pid, uint16_t version)
Sets the Plug n Play characteristic value.
Definition: NimBLEHIDDevice.cpp:117
void startServices()
Start the HID device services. This function called when all the services have been created.
Definition: NimBLEHIDDevice.cpp:85
NimBLECharacteristic * hidControl()
Returns a pointer to the HID control point characteristic.
Definition: NimBLEHIDDevice.cpp:202
void reportMap(uint8_t *map, uint16_t)
Set the report map data formatting information.
Definition: NimBLEHIDDevice.cpp:77
void setBatteryLevel(uint8_t level)
Set the battery level characteristic value.
Definition: NimBLEHIDDevice.cpp:217
NimBLECharacteristic * inputReport(uint8_t reportID)
Create input report characteristic.
Definition: NimBLEHIDDevice.cpp:145
NimBLECharacteristic * outputReport(uint8_t reportID)
Create output report characteristic.
Definition: NimBLEHIDDevice.cpp:160
NimBLECharacteristic * bootOutput()
Create a keyboard boot output report characteristic.
Definition: NimBLEHIDDevice.cpp:195
NimBLEService * hidService()
Returns a pointer to the HID service.
Definition: NimBLEHIDDevice.cpp:254
The model of a BLE server.
Definition: NimBLEServer.h:46
The model of a BLE service.
Definition: NimBLEService.h:34