Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol work #675

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version:
major: 3
minor: 9
minor: 10
protocols:
lovense:
defaults:
Expand Down Expand Up @@ -2127,6 +2127,9 @@ protocols:
- 27
messages:
- ScalarCmd
- identifier:
- Jive 2
name: WeVibe Jive 2
communication:
- btle:
names:
Expand All @@ -2139,6 +2142,7 @@ protocols:
- Nova2
- Nova_2
- Nova 2
- Jive 2
services:
f000bb03-0451-4000-b000-000000000000:
tx: f000c000-0451-4000-b000-000000000000
Expand Down Expand Up @@ -2730,6 +2734,34 @@ protocols:
whitelist: 00001901-0000-1000-8000-00805f9b34fb
tx: 00001902-0000-1000-8000-00805f9b34fb
rx: 00001903-0000-1000-8000-00805f9b34fb
kiiroo-prowand:
defaults:
name: Kiiroo ProWand
features:
- feature-type: Vibrate
actuator:
step-range:
- 0
- 255
messages:
- ScalarCmd
- feature-type: Battery
description: Battery Level
sensor:
value-range:
- - 0
- 100
messages:
- SensorReadCmd
communication:
- btle:
names:
- ProWand
services:
00001400-0000-1000-8000-00805f9b34fb:
tx: 00001401-0000-1000-8000-00805f9b34fb
0000180f-0000-1000-8000-00805f9b34fb:
rxblebattery: 00002a19-0000-1000-8000-00805f9b34fb
vorze-cyclone-x:
defaults:
name: Vorze Cyclone X10 Device
Expand Down Expand Up @@ -3605,6 +3637,32 @@ protocols:
services:
0000ffe0-0000-1000-8000-00805f9b34fb:
tx: 0000ffe1-0000-1000-8000-00805f9b34fb
svakom-barney:
defaults:
name: Mutufun Barney
features:
- feature-type: Vibrate
actuator:
step-range:
- 0
- 10
messages:
- ScalarCmd
- feature-type: Vibrate
actuator:
step-range:
- 0
- 10
messages:
- ScalarCmd
communication:
- btle:
names:
- DJ333A
services:
0000ffe0-0000-1000-8000-00805f9b34fb:
tx: 0000ffe1-0000-1000-8000-00805f9b34fb
rx: 0000ffe2-0000-1000-8000-00805f9b34fb
realov:
defaults:
name: Realov Device
Expand Down Expand Up @@ -3833,6 +3891,8 @@ protocols:
tx: 0000fff1-0000-1000-8000-00805f9b34fb
whitelist: 00000a10-0000-1000-8000-00805f9b34fb
rx: 00000a04-0000-1000-8000-00805f9b34fb
txvibrate: 0000fff2-0000-1000-8000-00805f9b34fb
generic0: 00000a11-0000-1000-8000-00805f9b34fb
lelo-harmony:
defaults:
name: Lelo Tiani Harmony
Expand Down Expand Up @@ -5654,6 +5714,25 @@ protocols:
- 1
messages:
- ScalarCmd
- identifier:
- '1006'
name: Hismith G011
features:
- feature-type: Oscillate
description: Stroker Oscillation Speed
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- feature-type: Vibrate
actuator:
step-range:
- 0
- 1
messages:
- ScalarCmd
- identifier:
- '3001'
name: Wildolo Device
Expand Down Expand Up @@ -5694,7 +5773,20 @@ protocols:
name: Auxfun Sex Machine
- identifier:
- '1005'
- '1102'
name: Hismith Sex Machine
- identifier:
- '1004'
name: Hismith Mini Sex Machine
- identifier:
- '1101'
name: Hismith Servo Sex Machine
- identifier:
- '1402'
name: Hismith Ukulele
- identifier:
- '1501'
name: Hismith PleasureDrive
- identifier:
- '2201'
name: Sinloli Automatic Sex Doll
Expand Down Expand Up @@ -5775,6 +5867,49 @@ protocols:
- 100
messages:
- ScalarCmd
- identifier:
- '2204'
name: Sinloli Cosima
features:
- feature-type: Oscillate
description: Stroker Oscillation Speed
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- feature-type: Constrict
description: Air Pump
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- identifier:
- '2202'
name: Sinloli Ethel
features:
- feature-type: Oscillate
description: Stroker Oscillation Speed
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- feature-type: Vibrate
description: Vibrator
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- identifier:
- '2205'
name: Sinloli Aston
communication:
- btle:
names:
Expand All @@ -5783,31 +5918,11 @@ protocols:
- Sinloli-Sherry
- Eropair *
- HISMITH S1
services:
0000ffe5-0000-1000-8000-00805f9b34fb:
tx: 0000ffe9-0000-1000-8000-00805f9b34fb
0000ff90-0000-1000-8000-00805f9b34fb:
rxblemodel: 0000ff96-0000-1000-8000-00805f9b34fb
hismith-servo:
defaults:
name: Hismith servo device
features:
- feature-type: Position
description: Fucking Machine Position
actuator:
step-range:
- 0
- 100
messages:
- LinearCmd
configurations:
- identifier:
- '1101'
name: Hismith Servo
communication:
- btle:
names:
- HISMITH S2
- HISMITH S2 # Servo
- HISMITH S3
- Sinloli Cosima
- Sinloli-Ethel
- Sinloli Aston
services:
0000ffe5-0000-1000-8000-00805f9b34fb:
tx: 0000ffe9-0000-1000-8000-00805f9b34fb
Expand Down Expand Up @@ -8095,10 +8210,41 @@ protocols:
- identifier:
- TDG_LIP_PT2
name: Tracy's Dog Surreal
- identifier:
- MP1P_QC_TL_P6
name: Sistalk MonsterPub 1P Mister Devil
- identifier:
- MPMB_QC_TL_P2
name: Sistalk MonsterPub Sweet
- identifier:
- MPAV_QC_TL_P1
name: Sistalk MonsterPub Amazing
- identifier:
- MH_TOR_TL_P5
name: Sistalk MonsterHub Tornado
- identifier:
- MP_SUCKBANG_P5
name: Sistalk MonsterPub Pop
features:
- feature-type: Oscillate
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
- feature-type: Vibrate
actuator:
step-range:
- 0
- 100
messages:
- ScalarCmd
communication:
- btle:
names:
- MonsterPub
- MonsterHub
- TracyDog
services:
00006000-0000-1000-8000-00805f9b34fb:
Expand Down Expand Up @@ -9233,6 +9379,25 @@ protocols:
- 255
messages:
- ScalarCmd
- identifier:
- J-Marshal
name: JoyHub Marshal
features:
- feature-type: Vibrate
actuator:
step-range:
- 0
- 255
messages:
- ScalarCmd
- feature-type: Constrict
description: Air Pump
actuator:
step-range:
- 0
- 9
messages:
- ScalarCmd
communication:
- btle:
names:
Expand Down Expand Up @@ -9276,6 +9441,7 @@ protocols:
- J-VBarbie2t
- J-Pau
- J-Petalwish3
- J-Marshal
services:
0000ffa0-0000-1000-8000-00805f9b34fb:
tx: 0000ffa1-0000-1000-8000-00805f9b34fb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl ActuatorCommandManager {
.feature_status
.iter()
.filter(|x| x
.messages()
.messages()
.contains(&ButtplugActuatorFeatureMessageType::RotateCmd))
.count()
];
Expand Down
11 changes: 11 additions & 0 deletions buttplug/src/server/device/protocol/hismith.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// for full license information.

use crate::server::device::configuration::ProtocolCommunicationSpecifier;
use crate::server::device::protocol::hismith_mini::HismithMiniInitializer;
use crate::{
core::{errors::ButtplugDeviceError, message::Endpoint},
server::device::{
Expand Down Expand Up @@ -36,6 +37,8 @@ pub mod setup {
#[derive(Default)]
pub struct HismithIdentifier {}

const LEGACY_HISMITHS: [&'static str; 6] = ["1001", "1002", "1003", "3001", "2001", "1006"];

#[async_trait]
impl ProtocolIdentifier for HismithIdentifier {
async fn identify(
Expand All @@ -54,6 +57,14 @@ impl ProtocolIdentifier for HismithIdentifier {
.collect::<String>();
info!("Hismith Device Identifier: {}", identifier);

if !LEGACY_HISMITHS.contains(&identifier.as_str()) {
info!("Not a legacy Hismith, using hismith-mini protocol");
return Ok((
UserDeviceIdentifier::new(hardware.address(), "hismith-mini", &Some(identifier)),
Box::new(HismithMiniInitializer::default()),
));
}

Ok((
UserDeviceIdentifier::new(hardware.address(), "hismith", &Some(identifier)),
Box::new(HismithInitializer::default()),
Expand Down
9 changes: 8 additions & 1 deletion buttplug/src/server/device/protocol/hismith_mini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,20 @@ impl ProtocolInitializer for HismithMiniInitializer {
.filter(|x| *x.feature_type() == FeatureType::Vibrate)
.count()
>= 2,
second_constrict: device_definition
.features()
.iter()
.position(|x| *x.feature_type() == FeatureType::Constrict)
.unwrap_or(0)
== 1,
}))
}
}

#[derive(Default)]
pub struct HismithMini {
dual_vibe: bool,
second_constrict: bool,
}

impl ProtocolHandler for HismithMini {
Expand Down Expand Up @@ -135,7 +142,7 @@ impl ProtocolHandler for HismithMini {
_index: u32,
scalar: u32,
) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> {
let idx: u8 = 0x03;
let idx: u8 = if self.second_constrict { 0x05 } else { 0x03 };
let speed: u8 = scalar as u8;

Ok(vec![HardwareWriteCmd::new(
Expand Down
Loading