Add a ParseBTHIDControlData virtual method similar to ParseBTHIDData,

for reports that are sent through the control pipe. This happens for
instance in response to a GET_REPORT.
This commit is contained in:
Jérôme Laheurte 2020-02-28 18:03:16 +01:00
parent cd87628af4
commit f075ea3025
2 changed files with 11 additions and 0 deletions

View file

@ -215,6 +215,10 @@ void BTHID::ACLData(uint8_t* l2capinbuf) {
Notify(PSTR(" "), 0x80);
}
#endif
if(l2capinbuf[8] == 0xA3) {
uint16_t length = ((uint16_t)l2capinbuf[5] << 8 | l2capinbuf[4]);
ParseBTHIDControlData((uint8_t)(length - 1), &l2capinbuf[9]);
}
}
#ifdef EXTRADEBUG
else {

View file

@ -125,6 +125,13 @@ protected:
virtual void ParseBTHIDData(uint8_t len __attribute__((unused)), uint8_t *buf __attribute__((unused))) {
return;
};
/**
* Same as ParseBTHIDData for reports that are sent through the
* interrupt pipe (in response to a GET_REPORT).
*/
virtual void ParseBTHIDControlData(uint8_t len __attribute__((unused)), uint8_t *buf __attribute__((unused))) {
return;
}
/** Called when a device is connected */
virtual void OnInitBTHID() {
return;