You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Actions run on every device when several are connected and no -d is given #607
With more than one supported device connected, an action without -d should be refused with Multiple devices, specify with -d. Instead it is executed on every device, and the refusal message never appears.
Reproduce with the mock device plus a real headset (here a Logitech G PRO X 2 LIGHTSPEED, HeadsetControl 4.2.0-10-ga8120a6 = current master, hidapi 0.15.0). -l 1 is safe to try because the G PRO X 2 has no lights:
$ headsetcontrol --test-device -l 1
Found 2 supported device(s):
HeadsetControl Test device (Test Device) [0xf00b:0xa00c]
Logitech G PRO X 2 LIGHTSPEED (PRO X 2 LIGHTSPEED) [0x046d:0x0af7]
Successfully set lights!
This headset doesn't support lights
-o json shows the same: the mock's CAP_LIGHTS action has "status": "success", the G PRO X 2 reports its capability error. With -s 64 the sidetone was set on both the mock and the real G PRO X 2.
Cause, in cli/main.cpp: handleMultiDeviceActions marks the request with req.result.status = FEATURE_NOT_PROCESSED plus the message. But FeatureResult::status defaults to NotProcessed, and processFeatureRequests executes exactly the requests with should_process && status == FEATURE_NOT_PROCESSED. Before the C++ rewrite (#443) the check was != FEATURE_NOT_PROCESSED, so the marker worked. That makes it a regression since 4.0.0.
tests/test_cli_output.cpp runs --test-device -s 20 -o json without -d, so ctest on a machine with a headset attached sets that headset's sidetone to 20.
Related: #585 (the same status check breaks follow mode).
Activity
fix(cli): refuse actions on multiple devices without -d (Sapd#608)