From 8417f3684c35b722fda950a36dc802c87868fe50 Mon Sep 17 00:00:00 2001 From: Josh Koike Date: Sun, 9 Aug 2020 12:12:44 -0700 Subject: [PATCH] Add add_report_raw method to append raw items/bytes-likes to HID descriptor --- usb_protocol/emitters/descriptors/hid.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usb_protocol/emitters/descriptors/hid.py b/usb_protocol/emitters/descriptors/hid.py index 67f589c..e69ed74 100644 --- a/usb_protocol/emitters/descriptors/hid.py +++ b/usb_protocol/emitters/descriptors/hid.py @@ -15,6 +15,15 @@ _hid_item_length = [ 0, 1, 2, 4 ] class HIDDescriptor(ComplexDescriptorEmitter): DESCRIPTOR_FORMAT = HIDDescriptorType + def add_report_raw(self, report_data): + """Append raw report item or bytes to HID report + + Arguments: + report_data -- bytes-like or ReportDescriptor to be appended to + the HID report. + """ + self._reports.append(hid_data) + def add_report_item(self, report_prefix, *report_data): hid_report = ReportDescriptorEmitter() report_len = _hid_item_length.index(len(report_data))