File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
buttplug/src/server/device/protocol Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 66// for full license information.
77
88use crate :: server:: device:: configuration:: ProtocolCommunicationSpecifier ;
9+ use crate :: server:: device:: protocol:: hismith_mini:: HismithMiniInitializer ;
910use crate :: {
1011 core:: { errors:: ButtplugDeviceError , message:: Endpoint } ,
1112 server:: device:: {
@@ -16,7 +17,6 @@ use crate::{
1617} ;
1718use async_trait:: async_trait;
1819use std:: sync:: Arc ;
19- use crate :: server:: device:: protocol:: hismith_mini:: HismithMiniInitializer ;
2020
2121pub mod setup {
2222 use crate :: server:: device:: protocol:: { ProtocolIdentifier , ProtocolIdentifierFactory } ;
Original file line number Diff line number Diff line change @@ -43,10 +43,13 @@ impl ProtocolInitializer for LeloF1sV2Initializer {
4343 hardware : Arc < Hardware > ,
4444 _: & UserDeviceDefinition ,
4545 ) -> Result < Arc < dyn ProtocolHandler > , ButtplugDeviceError > {
46-
47- let use_harmony= !hardware. endpoints ( ) . contains ( & Endpoint :: Whitelist ) ;
48- let sec_endpoint = if use_harmony { Endpoint :: Generic0 } else { Endpoint :: Whitelist } ;
49-
46+ let use_harmony = !hardware. endpoints ( ) . contains ( & Endpoint :: Whitelist ) ;
47+ let sec_endpoint = if use_harmony {
48+ Endpoint :: Generic0
49+ } else {
50+ Endpoint :: Whitelist
51+ } ;
52+
5053 // The Lelo F1s V2 has a very specific pairing flow:
5154 // * First the device is turned on in BLE mode (long press)
5255 // * Then the security endpoint (Whitelist) needs to be read (which we can do via subscribe)
@@ -100,7 +103,7 @@ impl ProtocolInitializer for LeloF1sV2Initializer {
100103}
101104
102105pub struct LeloF1sV2 {
103- use_harmony : bool
106+ use_harmony : bool ,
104107}
105108
106109impl LeloF1sV2 {
@@ -122,8 +125,7 @@ impl ProtocolHandler for LeloF1sV2 {
122125 & self ,
123126 cmds : & [ Option < ( ActuatorType , u32 ) > ] ,
124127 ) -> Result < Vec < HardwareCommand > , ButtplugDeviceError > {
125- if self . use_harmony
126- {
128+ if self . use_harmony {
127129 let mut cmd_vec: Vec < HardwareCommand > = vec ! [ ] ;
128130 for ( i, cmd) in cmds. iter ( ) . enumerate ( ) {
129131 if let Some ( pair) = cmd {
@@ -144,7 +146,7 @@ impl ProtocolHandler for LeloF1sV2 {
144146 ] ,
145147 false ,
146148 )
147- . into ( ) ,
149+ . into ( ) ,
148150 ) ;
149151 }
150152 }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl ProtocolHandler for SvakomBarney {
5050 mode = 3;
5151 }
5252 let speed = (scalar as f64 / 3.0).ceil() as u8;*/
53-
53+
5454 Ok ( vec ! [ HardwareWriteCmd :: new(
5555 Endpoint :: Tx ,
5656 [
You can’t perform that action at this time.
0 commit comments