This commit is contained in:
Peter F. Patel-Schneider 2026-06-02 12:32:42 +00:00 committed by GitHub
commit 669f1c9f7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -706,6 +706,14 @@ class Device:
long_message=long, long_message=long,
protocol=self.protocol, protocol=self.protocol,
) )
if logger.isEnabledFor(logging.WARN):
logger.warning(
"%s: request failure for device %s %s %s",
self,
self.handle,
self.receiver,
self.receiver._devices if self.receiver else None,
)
def feature_request(self, feature, function=0x00, *params, no_reply=False): def feature_request(self, feature, function=0x00, *params, no_reply=False):
if self.protocol >= 2.0: if self.protocol >= 2.0:
@ -730,6 +738,8 @@ class Device:
if sub_idx is not None: if sub_idx is not None:
return self.centurion_bridge_request(sub_idx, function, *params, no_reply=no_reply) return self.centurion_bridge_request(sub_idx, function, *params, no_reply=no_reply)
return hidpp20.feature_request(self, feature, function, *params, no_reply=no_reply) return hidpp20.feature_request(self, feature, function, *params, no_reply=no_reply)
if logger.isEnabledFor(logging.WARN):
logger.warning("%s: feature request failure for device with protocol %s", self, self.protocol)
# Max sub-message bytes in the first bridge fragment (for 0x51): # Max sub-message bytes in the first bridge fragment (for 0x51):
# 64 - 1 (report ID) - 1 (cpl_len) - 1 (flags) - 2 (bridge prefix) - 2 (bridge hdr) = 57; # 64 - 1 (report ID) - 1 (cpl_len) - 1 (flags) - 2 (bridge prefix) - 2 (bridge hdr) = 57;

View File

@ -1756,6 +1756,10 @@ def feature_request(device, feature, function=0x00, *params, no_reply=False):
if feature in device.features: if feature in device.features:
feature_index = device.features[feature] feature_index = device.features[feature]
return device.request((feature_index << 8) + (function & 0xFF), *params, no_reply=no_reply) return device.request((feature_index << 8) + (function & 0xFF), *params, no_reply=no_reply)
if logger.isEnabledFor(logging.WARN):
logger.warning(
"%s: feature request failure for device online %s and features %s", device, device.online, device.features
)
class Hidpp20: class Hidpp20: