From acfd02abe8e17447fc3e8ce86260ebd6844f560a Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Fri, 17 Apr 2026 21:08:55 -0700 Subject: [PATCH] Log bridge sub-device error responses at INFO, not DEBUG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The feature_request path for Centurion sub-device features routes through centurion_bridge_request, which returned None silently when the sub-device replied with sub_feat_idx=0xFF (error marker). The existing log was at DEBUG, invisible for users whose -dd doesn't turn on DEBUG-level output. The write-returned-no-reply INFO we added recently caught mic-gain / sidetone / auto-sleep writes failing with no visible log about WHY. Bumping this log to INFO surfaces the original feat_idx, function, and error code so we can distinguish transport timeout vs device rejection, and debug what exactly the G522 dislikes about our writes. No behavior change — same return value (None), just more visible log. --- lib/logitech_receiver/device.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/device.py b/lib/logitech_receiver/device.py index fbdac80a..e964d41c 100644 --- a/lib/logitech_receiver/device.py +++ b/lib/logitech_receiver/device.py @@ -842,9 +842,18 @@ class Device: sub_feat_idx = reply_data[5] # Error response from sub-device if sub_feat_idx == 0xFF: - error_code = reply_data[8] if len(reply_data) > 8 else 0 + # Error frame layout after sub_cpl: [0xFF, orig_feat_idx, orig_func_sw, error_code, ...] orig_feat_idx = reply_data[6] if len(reply_data) > 6 else 0 - logger.debug("bridge sub-device error: feat_idx=%d error=0x%02X", orig_feat_idx, error_code) + orig_func_sw = reply_data[7] if len(reply_data) > 7 else 0 + error_code = reply_data[8] if len(reply_data) > 8 else 0 + # INFO level so the error is visible without -dd — lets testers see when + # the device rejects a write even if they can't get DEBUG logs. + logger.info( + "bridge sub-device error: orig_feat_idx=%d orig_func=0x%02X error=0x%02X", + orig_feat_idx, + orig_func_sw, + error_code, + ) return None return reply_data[7:] # response data after sub_cpl, sub_feat_idx, sub_func_sw