-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correct VibrateCmd -> ScalarCmd conversion when the devices has …
…non-vibrate features This change reworks the conversion from VibrateCmd to ScalarCmd by building a map of indexes of vibrate features on a devices that supports ScalarCmd so that devices that have non-vibrators before or embedded between vibrators don't try to send vibrate commands to the those features. `VibrateCmd( 0, [1.0, 0.5] )` for a device with `ScalarCmd(Vibrate, Rotate, Vibrate)` now generates `ScalarCmd( 0, [ {0, 1.0, Vibrate}, {2, 0.5, Vibrate}] )` vs previously just copying the feature index, which would have produced the invalid: `ScalarCmd( 0, [ {0, 1.0, Vibrate}, {1, 0.5, Vibrate}] )`
- Loading branch information
1 parent
89d14bb
commit 47d8ee2
Showing
5 changed files
with
86 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
buttplug/tests/util/device_test/device_test_case/test_joyhub_petalwish_compat.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
devices: | ||
- identifier: | ||
name: "J-Petalwish2" | ||
expected_name: "JoyHub Petalwish 2" | ||
device_commands: | ||
# Commands | ||
- !Messages | ||
device_index: 0 | ||
messages: | ||
- !Vibrate | ||
- Index: 0 | ||
Speed: 0.5 | ||
- !Commands | ||
device_index: 0 | ||
commands: | ||
- !Write | ||
endpoint: tx | ||
data: [0xa0, 0x03, 0x00, 0x00, 0x80, 0x00, 0xaa] | ||
write_with_response: false | ||
- !Messages | ||
device_index: 0 | ||
messages: | ||
- !Stop | ||
- !Commands | ||
device_index: 0 | ||
commands: | ||
- !Write | ||
endpoint: tx | ||
data: [0xa0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xaa] | ||
write_with_response: false |