Skip to content

Commit 85caf1f

Browse files
committed
chore: Fix protocol and config issues after PR #784 rebase
Meant to compile as I went along, oops.
1 parent 2c761e6 commit 85caf1f

File tree

17 files changed

+153
-198
lines changed

17 files changed

+153
-198
lines changed

crates/buttplug_server/src/device/protocol_impl/galaku.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl ProtocolInitializer for GalakuInitializer {
107107
async fn initialize(
108108
&mut self,
109109
hardware: Arc<Hardware>,
110-
_: &ServerDeviceDefinition,
110+
def: &ServerDeviceDefinition,
111111
) -> Result<Arc<dyn ProtocolHandler>, ButtplugDeviceError> {
112112
let mut protocol = Galaku::default();
113113
protocol.is_caiping_pump_device = false;

crates/buttplug_server/src/device/protocol_impl/hismith_mini.rs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -184,33 +184,11 @@ impl ProtocolHandler for HismithMini {
184184
feature_id: Uuid,
185185
speed: i32,
186186
) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> {
187-
Ok(vec![
188-
HardwareWriteCmd::new(
189-
&[feature_id],
190-
Endpoint::Tx,
191-
vec![0xCC, 0x03, speed as u8, speed as u8 + 3],
192-
false,
193-
).into(),
194-
HardwareWriteCmd::new(
195-
&vec![HISMITH_MINI_ROTATE_DIRECTIOM_UUID],
196-
Endpoint::Tx,
197-
vec![0xCC, 0x01, if clockwise { 0xc0 } else {0xc1}, if clockwise { 0xc1 } else {0xc2}],
198-
false,
199-
).into(),
200-
])
201-
}
202-
203-
fn handle_output_spray_cmd(&self, _feature_index: u32, feature_id: Uuid, _level: u32) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> {
204187
Ok(vec![
205188
HardwareWriteCmd::new(
206189
&[feature_id],
207190
Endpoint::Tx,
208-
vec![
209-
0xCC,
210-
0x03,
211-
speed.unsigned_abs() as u8,
212-
speed.unsigned_abs() as u8 + 3,
213-
],
191+
vec![0xCC, 0x03, speed.unsigned_abs() as u8, speed.unsigned_abs() as u8 + 3],
214192
false,
215193
)
216194
.into(),
@@ -228,4 +206,21 @@ impl ProtocolHandler for HismithMini {
228206
.into(),
229207
])
230208
}
209+
210+
fn handle_output_spray_cmd(
211+
&self,
212+
_feature_index: u32,
213+
feature_id: Uuid,
214+
_level: u32,
215+
) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> {
216+
Ok(vec![
217+
HardwareWriteCmd::new(
218+
&[feature_id],
219+
Endpoint::Tx,
220+
vec![0xcc, 0x0b, 0x01, 0x0c],
221+
false,
222+
)
223+
.into(),
224+
])
225+
}
231226
}

crates/buttplug_server/src/device/protocol_impl/kiiroo_v3.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::device::{
1818
use async_trait::async_trait;
1919
use buttplug_core::errors::ButtplugDeviceError;
2020
use buttplug_server_device_config::{
21-
DeviceDefinition,
21+
ServerDeviceDefinition,
2222
ProtocolCommunicationSpecifier,
2323
UserDeviceIdentifier,
2424
};
@@ -36,7 +36,7 @@ impl ProtocolInitializer for KiirooV3Initializer {
3636
async fn initialize(
3737
&mut self,
3838
_: Arc<Hardware>,
39-
_: &DeviceDefinition,
39+
_: &ServerDeviceDefinition,
4040
) -> Result<Arc<dyn ProtocolHandler>, ButtplugDeviceError> {
4141
Ok(Arc::new(KiirooV21::default()))
4242
}

0 commit comments

Comments
 (0)