I am programming a BLE device to be seen as a HID device combining Keyboard, mouse and gamepads. For now I am trying to get keyboard and mouse. I manage several BLECharacteristics created using BLEHIDDevice->inputReport(reportId)
I started my work using the sample keyboard demo.
The problem
I struggled for a time to get the mouse working, until I noticed in the traces that on calling BLECharacteristic->notify, the characteristic sending the mouse report claimed that notifications were disabled and thus abort ; the characteristic sending the keyboard report does not claim this an send normaly the report.
A call to BLECharacteristic->setNotifyProperty(true) does not solves the problem.
Workaround (partial)
A partial workaround : in BLEHIDDevice.cpp->inputReport(...), force the notification flag of characteristic p2902. It then works only on the first pairing after uploading the firmware
Context
I am programming a BLE device to be seen as a HID device combining Keyboard, mouse and gamepads. For now I am trying to get keyboard and mouse. I manage several BLECharacteristics created using
BLEHIDDevice->inputReport(reportId)
I started my work using the sample keyboard demo.
The problem
I struggled for a time to get the mouse working, until I noticed in the traces that on calling
BLECharacteristic->notify
, the characteristic sending the mouse report claimed that notifications were disabled and thus abort ; the characteristic sending the keyboard report does not claim this an send normaly the report.A call to
BLECharacteristic->setNotifyProperty(true)
does not solves the problem.Workaround (partial)
A partial workaround : in
BLEHIDDevice.cpp->inputReport(...)
, force the notification flag of characteristicp2902
. It then works only on the first pairing after uploading the firmware