Buttplug sex toy control library

fix: Correct Lovense RotateWithDirection behaviour

I'm not sure why changing the order fixes this behaviour

authored by

blackspherefollower and committed by qdot.tngl.sh 69b8b90f 666747e0

+7 -7
+3 -3
crates/buttplug_server/src/device/protocol_impl/lovense/mod.rs
··· 551 551 change_direction: bool, 552 552 ) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> { 553 553 let mut hardware_cmds = vec![]; 554 - let lovense_cmd = format!("Rotate:{speed};").as_bytes().to_vec(); 555 - hardware_cmds 556 - .push(HardwareWriteCmd::new(&[LOVENSE_ROTATE_UUID], Endpoint::Tx, lovense_cmd, false).into()); 557 554 if change_direction { 558 555 hardware_cmds.push( 559 556 HardwareWriteCmd::new( ··· 565 562 .into(), 566 563 ); 567 564 } 565 + let lovense_cmd = format!("Rotate:{speed};").as_bytes().to_vec(); 566 + hardware_cmds 567 + .push(HardwareWriteCmd::new(&[LOVENSE_ROTATE_UUID], Endpoint::Tx, lovense_cmd, false).into()); 568 568 trace!("{:?}", hardware_cmds); 569 569 Ok(hardware_cmds) 570 570 }
+4 -4
crates/buttplug_tests/tests/util/device_test/device_test_case/test_lovense_nora.yaml
··· 50 50 write_with_response: false 51 51 - !Write 52 52 endpoint: tx 53 - # "Rotate:0;" 54 - data: [82, 111, 116, 97, 116, 101, 58, 48, 59] 55 - write_with_response: false 53 + data: [82, 111, 116, 97, 116, 101, 67, 104, 97, 110, 103, 101, 59] 54 + write_with_response: false 56 55 - !Write 57 56 endpoint: tx 58 - data: [82, 111, 116, 97, 116, 101, 67, 104, 97, 110, 103, 101, 59] 57 + # "Rotate:0;" 58 + data: [82, 111, 116, 97, 116, 101, 58, 48, 59] 59 59 write_with_response: false 60 60 - !Messages 61 61 device_index: 0