2015-04-09 16:32:04 +00:00
|
|
|
#include "parser.h"
|
|
|
|
#include "usb_hid.h"
|
|
|
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
|
|
|
|
void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
|
|
|
|
{
|
2017-08-12 16:24:15 +00:00
|
|
|
::memcpy(&report, buf, sizeof(report_keyboard_t));
|
|
|
|
time_stamp = millis();
|
2015-07-15 07:02:20 +00:00
|
|
|
|
2017-08-12 16:24:15 +00:00
|
|
|
dprintf("input %d: %02X %02X", hid->GetAddress(), report.mods, report.reserved);
|
2015-07-15 07:02:20 +00:00
|
|
|
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
|
2017-08-12 16:24:15 +00:00
|
|
|
dprintf(" %02X", report.keys[i]);
|
2015-07-15 07:02:20 +00:00
|
|
|
}
|
|
|
|
dprint("\r\n");
|
2015-04-09 16:32:04 +00:00
|
|
|
}
|