buttplugio / buttplug

Rust Implementation of the Buttplug Sex Toy Control Protocol

Home Page:https://buttplug.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dual vibe Lovense devices have one vibe value overridden when only the other is updated

blackspherefollower opened this issue · comments

Describe the bug
When you send a VibrateCmd with only a single index specified, the protocol logic sees only 1 vibrator value to update, but mistakes this for a single vibrator device and sends Vibrate:N; rather than VibrateX:N;

Expected behavior
Controlling 1 vibe on the Lovense Edge shouldn't affect the other vibe.

Actual behavior
If the client sends a single index, both vibes are set to that speed.

Additional context

devices:
  - identifier: 
      name: "LVS-DoesntMatter"
    expected_name: "Lovense Edge"
device_init: 
  # Initialization
  - !Commands
      device_index: 0
      commands:
        - !Subscribe
            endpoint: rx
        - !Write
            endpoint: tx
            # "DeviceType;"
            data: [68, 101, 118, 105, 99, 101, 84, 121, 112, 101, 59]
            write_with_response: false
  - !Events
      device_index: 0
      events:
        - !Notifications
          - endpoint: rx
            # "P:02:0082059AD3BD;"
            data: [80, 58, 48, 50, 58, 48, 48, 56, 50, 48, 53, 57, 65, 68, 51, 66, 68, 59]
device_commands:
  - !Messages
      device_index: 0
      messages: 
        - !Vibrate
          - Index: 0
            Speed: 0.5
  - !Commands
      device_index: 0
      commands: 
        - !Write
            endpoint: tx
            # "Vibrate1:10;"
            data: [86, 105, 98, 114, 97, 116, 101, 49, 58, 49, 48, 59]
            write_with_response: false
  - !Messages
      device_index: 0
      messages:
        - !Vibrate
          - Index: 0
            Speed: 0.5
          - Index: 1
            Speed: 0.5
  - !Commands
      device_index: 0
      commands:
        - !Write
            endpoint: tx
            # "Vibrate:10;"
            data: [86, 105, 98, 114, 97, 116, 101, 58, 49, 48, 59]
            write_with_response: false
  - !Messages
      device_index: 0
      messages:
        - !Vibrate
          - Index: 0
            Speed: 0.5
          - Index: 1
            Speed: 0.75
  - !Commands
      device_index: 0
      commands:
        - !Write
          endpoint: tx
          # "Vibrate2:15;"
          data: [86, 105, 98, 114, 97, 116, 101, 50, 58, 49, 53, 59]
          write_with_response: false
  - !Messages
      device_index: 0
      messages: 
        - !Stop 
  - !Commands
      device_index: 0
      commands: 
        - !Write
            endpoint: tx
            # "Vibrate:0;"
            data: [86, 105, 98, 114, 97, 116, 101, 58, 48, 59]
            write_with_response: false