Skip to content

Fix operator precedence bug and end-of-configuration timing in device.changed()#3173

Open
ksanislo wants to merge 1 commit intopwr-Solaar:masterfrom
ksanislo:fix-reconfiguration-ack
Open

Fix operator precedence bug and end-of-configuration timing in device.changed()#3173
ksanislo wants to merge 1 commit intopwr-Solaar:masterfrom
ksanislo:fix-reconfiguration-ack

Conversation

@ksanislo
Copy link
Copy Markdown
Contributor

Summary

  • Fix operator precedence bug where push and (not self.features ...) caused
    push=True from WIRELESS_DEVICE_STATUS to only trigger settings push for
    devices WITHOUT that feature (the opposite of intended behavior)
  • Send set_configuration(0x11) after every settings push, not just on first
    activation — devices that request reconfiguration via WIRELESS_DEVICE_STATUS
    need the end-of-configuration acknowledgment or they keep retrying

When a HID++ 2.0 device requests software reconfiguration via
WIRELESS_DEVICE_STATUS, apply_all_settings runs but
set_configuration(0x11) was only sent on the initial offline→online
transition. Without the end-of-configuration signal, the device
keeps sending reconfiguration requests, causing redundant settings
pushes that flood the bus.

Send set_configuration(0x11) after every settings push for HID++ 2.0
devices, not just on first activation. This properly acknowledges the
reconfiguration and stops the device from retrying.

Also fixes an operator precedence issue where `push and (not
self.features ...)` bound tighter than the surrounding `or` clauses,
making the `push` flag ineffective for devices with
WIRELESS_DEVICE_STATUS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant