Merge pull request #517 from fraca7/control-report-callback

Add a ParseBTHIDControlData virtual method similar to ParseBTHIDData,
This commit is contained in:
Kristian Sloth Lauszus 2020-11-16 12:58:29 +01:00 committed by GitHub
commit 23ba34da47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -366,6 +366,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;