From ffe4e1cd75ef3fb7725a8e9c91c0636ed3c2e365 Mon Sep 17 00:00:00 2001 From: Ilia Vlasov Date: Mon, 6 Jul 2026 17:01:18 +0100 Subject: [PATCH] Add `hid_send_output_report` API function --- hid/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hid/__init__.py b/hid/__init__.py index 69d82eb..e0969c0 100644 --- a/hid/__init__.py +++ b/hid/__init__.py @@ -128,6 +128,9 @@ def as_dict(self): hidapi.hid_set_nonblocking.restype = ctypes.c_int hidapi.hid_send_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int] hidapi.hid_send_feature_report.restype = ctypes.c_int +if version >= (0, 15, 0): + hidapi.hid_send_output_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] + hidapi.hid_send_output_report.restype = ctypes.c_int hidapi.hid_get_feature_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t] hidapi.hid_get_feature_report.restype = ctypes.c_int if version >= (0, 14, 0): @@ -223,6 +226,10 @@ def get_input_report(self, report_id, size): hidapi.hid_get_input_report, self.__dev, data, size) return data.raw[:size] + def send_output_report(self, data): + return self.__hidcall(hidapi.hid_send_output_report, + self.__dev, data, len(data)) + def send_feature_report(self, data): return self.__hidcall(hidapi.hid_send_feature_report, self.__dev, data, len(data))