From 04c74d47d5cb622ead1d8b0487089874f896a6f3 Mon Sep 17 00:00:00 2001 From: ktnyt Date: Sat, 19 Oct 2024 20:03:53 +0900 Subject: [PATCH] Modify to allow multiple reports in an Application collection --- adafruit_ble/services/standard/hid.py | 39 ++++++++++++++------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/adafruit_ble/services/standard/hid.py b/adafruit_ble/services/standard/hid.py index 6409f21..b618448 100755 --- a/adafruit_ble/services/standard/hid.py +++ b/adafruit_ble/services/standard/hid.py @@ -442,24 +442,27 @@ def get_report_info(collection: Dict, reports: Dict) -> None: usage = collection["locals"][0][0] reports = {} get_report_info(collection, reports) - if len(reports) > 1: - raise NotImplementedError( - "Only one report id per Application collection supported" - ) - - report_id, report = list(reports.items())[0] - output_size = report["output_size"] - if output_size > 0: - self.devices.append( - ReportOut( - self, report_id, usage_page, usage, max_length=output_size // 8 + for report_id, report in reports: + output_size = report["output_size"] + if output_size > 0: + self.devices.append( + ReportOut( + self, + report_id, + usage_page, + usage, + max_length=output_size // 8, + ) ) - ) - input_size = reports[report_id]["input_size"] - if input_size > 0: - self.devices.append( - ReportIn( - self, report_id, usage_page, usage, max_length=input_size // 8 + input_size = reports[report_id]["input_size"] + if input_size > 0: + self.devices.append( + ReportIn( + self, + report_id, + usage_page, + usage, + max_length=input_size // 8, + ) ) - ) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy