Solaar/lib/logitech_receiver
Ken Sanislo c8a52ecd3c Reject bridge responses for wrong sub-device function
Field testing revealed cross-contamination between function calls on
the same sub-device feature. A late-arriving MessageEvent for
GetRGBZoneInfo (function 1) was being accepted as the response to a
subsequent GetHostModeState (function 7) on the same feature (0x0620),
because _is_bridge_response_for only matched on sub_feat_idx.

Evidence from tester log:
  HeadsetRGBHostMode.write: before=b'\x08\x01\x02\x03\x04\x05\x06\x07\x08...'
The "before" read of GetHostModeState returned what is clearly a
GetRGBZoneInfo response (count=8, zones=[1..8]) queued from earlier.

The device echoes our exact sub-device function byte (function<<4 | sw_id)
in the response. Plumb that expected value from centurion_bridge_request
through _is_bridge_response_for and reject any response whose
sub_func_sw doesn't match. Also validate orig_func_sw for error responses.

Also removes the zone_id==0 filter in HeadsetRGBColor._zone_ids — with
proper response matching the device should now consistently report real
zone IDs (G522 has 8 zones at IDs 1-8 per the delayed response capture),
and filtering is no longer needed.
2026-05-10 15:39:17 -07:00
..
__init__.py Refactor: Distinguish module from package 2024-09-15 09:18:51 -04:00
advanced_para_eq.py Add read-only HeadsetAdvancedEQ (0x020D) display 2026-05-10 15:39:17 -07:00
base.py Tighten Centurion probe and silence FeaturesArray query spam 2026-05-10 15:39:17 -07:00
base_usb.py device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183) 2026-04-17 09:34:58 -04:00
centurion.py Fix FeatureNotSupported crash on pending CenturionReceiver 2026-05-10 15:39:17 -07:00
centurion_constants.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
common.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
descriptors.py Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-05-10 15:39:16 -07:00
desktop_notifications.py testing: upgrade desktop notifications tests to take notifications availability into account 2025-01-02 10:47:53 -05:00
device.py Reject bridge responses for wrong sub-device function 2026-05-10 15:39:17 -07:00
diversion.py rules: remove use of XTest and use uinput in all cases 2026-03-08 20:58:43 -04:00
exceptions.py Use double quotes for module level docstrings 2024-06-02 09:54:21 -04:00
hidpp10.py cli: Fix crash when showing notification flags. (#3070) 2025-12-12 04:54:10 -05:00
hidpp10_constants.py device: Handle composite IntFlag.name on Python < 3.11 (#3187) 2026-04-16 11:38:25 -04:00
hidpp20.py Record feature versions in Centurion Phase A (parent/direct) too 2026-05-10 15:39:17 -07:00
hidpp20_constants.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
i18n.py Unify imports in logitech package 2024-05-23 16:42:18 -04:00
listener.py Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-05-10 15:39:16 -07:00
notifications.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
onboard_eq.py centurion: support PRO X 2 LIGHTSPEED headphones Centurion features (#3150) 2026-04-14 11:43:23 -04:00
receiver.py device: Support per-slot unpair on Lightspeed receivers (CLI + GUI) (#3183) 2026-04-17 09:34:58 -04:00
settings.py Don't misreport empty-ACK writes as failed (Setting.write) 2026-05-10 15:39:17 -07:00
settings_new.py settings: add setting for HAPTIC feature 2025-11-12 14:50:46 -05:00
settings_templates.py Reject bridge responses for wrong sub-device function 2026-05-10 15:39:17 -07:00
settings_validator.py Add per-key RGB color painter and replace MAP_CHOICE color validator 2026-05-10 17:52:55 -04:00
special_keys.py device: add special keys from Logitech 2025-10-16 20:57:15 -04:00