From 080bc23a84a2c695200cb0bb1ff8dff636b19048 Mon Sep 17 00:00:00 2001 From: Claus Macher Date: Mon, 24 Nov 2025 23:33:33 -0600 Subject: [PATCH 1/3] OSSM speed support through BLE --- .../src/device/protocol_impl/mod.rs | 2 + .../src/device/protocol_impl/ossm.rs | 81 +++++++++++++++++++ .../buttplug-device-config-v4.json | 38 ++++++++- .../device-config-v4/protocols/luvmazer.yml | 2 +- .../device-config-v4/protocols/ossm.yml | 18 +++++ .../device-config-v4/version.yaml | 2 +- 6 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 crates/buttplug_server/src/device/protocol_impl/ossm.rs create mode 100644 crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml diff --git a/crates/buttplug_server/src/device/protocol_impl/mod.rs b/crates/buttplug_server/src/device/protocol_impl/mod.rs index 4e3a275d1..872b3a3af 100644 --- a/crates/buttplug_server/src/device/protocol_impl/mod.rs +++ b/crates/buttplug_server/src/device/protocol_impl/mod.rs @@ -76,6 +76,7 @@ pub mod nexus_revo; pub mod nintendo_joycon; pub mod nobra; pub mod omobo; +pub mod ossm; pub mod patoo; pub mod picobong; pub mod pink_punch; @@ -381,6 +382,7 @@ pub fn get_default_protocol_map() -> HashMap, + _: &ServerDeviceDefinition, + ) -> Result, ButtplugDeviceError> { + let msg = HardwareWriteCmd::new( + &[OSSM_PROTOCOL_UUID], + Endpoint::Tx, + format!("go:strokeEngine").into_bytes(), + false, + ); + hardware.write_value(&msg).await?; + Ok(Arc::new(OSSM::default())) + } +} + +#[derive(Default)] +pub struct OSSM {} + +impl ProtocolHandler for OSSM { + fn handle_output_oscillate_cmd( + &self, + feature_index: u32, + feature_id: Uuid, + value: u32, + ) -> Result, ButtplugDeviceError> { + let param = if feature_index == 0 { + "speed" + } else { + return Err(ButtplugDeviceError::DeviceFeatureMismatch( + format!("OSSM command received for unknown feature index: {}", feature_index), + )); + }; + + Ok(vec![ + HardwareWriteCmd::new( + &[feature_id], + Endpoint::Tx, + format!("set:{param}:{value}").into_bytes(), + false, + ) + .into(), + ]) + } +} diff --git a/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json b/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json index b4f915192..63f2b2326 100644 --- a/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json +++ b/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json @@ -1,7 +1,7 @@ { "version": { "major": 4, - "minor": 95 + "minor": 96 }, "protocols": { "activejoy": { @@ -11872,7 +11872,7 @@ { "id": "5ae8bb6f-6280-4a8d-9e08-a3d5e5fb89a8", "output": { - "sscillate": { + "oscillate": { "value": [ 0, 255 @@ -14004,6 +14004,40 @@ "name": "Omobo ViVegg Vibrator" } }, + "ossm": { + "communication": [ + { + "btle": { + "names": [ + "OSSM" + ], + "services": { + "522b443a-4f53-534d-0001-420badbabe69": { + "tx": "522b443a-4f53-534d-0002-420badbabe69" + } + } + } + } + ], + "defaults": { + "features": [ + { + "description": "Stroke Speed", + "id": "6ff53ba2-a5c0-462e-b2d6-420badbabe69", + "output": { + "oscillate": { + "value": [ + 0, + 100 + ] + } + } + } + ], + "id": "6beebf46-3dfd-4e11-b0f9-420badbabe69", + "name": "OSSM" + } + }, "patoo": { "communication": [ { diff --git a/crates/buttplug_server_device_config/device-config-v4/protocols/luvmazer.yml b/crates/buttplug_server_device_config/device-config-v4/protocols/luvmazer.yml index 0a60cb879..6581dc7d4 100644 --- a/crates/buttplug_server_device_config/device-config-v4/protocols/luvmazer.yml +++ b/crates/buttplug_server_device_config/device-config-v4/protocols/luvmazer.yml @@ -31,7 +31,7 @@ configurations: - 255 - id: 5ae8bb6f-6280-4a8d-9e08-a3d5e5fb89a8 output: - sscillate: + oscillate: value: - 0 - 255 diff --git a/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml b/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml new file mode 100644 index 000000000..7c60c4bf2 --- /dev/null +++ b/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml @@ -0,0 +1,18 @@ +defaults: + name: OSSM + features: + - description: Stroke Speed + id: 6ff53ba2-a5c0-462e-b2d6-420badbabe69 + output: + oscillate: + value: + - 0 + - 100 + id: 6beebf46-3dfd-4e11-b0f9-420badbabe69 +communication: + - btle: + names: + - OSSM + services: + 522b443a-4f53-534d-0001-420badbabe69: + tx: 522b443a-4f53-534d-0002-420badbabe69 diff --git a/crates/buttplug_server_device_config/device-config-v4/version.yaml b/crates/buttplug_server_device_config/device-config-v4/version.yaml index 37c4801fe..e8d3b38e0 100644 --- a/crates/buttplug_server_device_config/device-config-v4/version.yaml +++ b/crates/buttplug_server_device_config/device-config-v4/version.yaml @@ -1,3 +1,3 @@ version: major: 4 - minor: 95 + minor: 96 From c58e4745c3aa34e6c48a7aee8169fe3a58449c2f Mon Sep 17 00:00:00 2001 From: Claus Macher Date: Wed, 26 Nov 2025 08:46:00 -0600 Subject: [PATCH 2/3] The future Marty! --- crates/buttplug_server/src/device/protocol_impl/ossm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/buttplug_server/src/device/protocol_impl/ossm.rs b/crates/buttplug_server/src/device/protocol_impl/ossm.rs index 31edf2681..7931a9601 100644 --- a/crates/buttplug_server/src/device/protocol_impl/ossm.rs +++ b/crates/buttplug_server/src/device/protocol_impl/ossm.rs @@ -1,6 +1,6 @@ // Buttplug Rust Source Code File - See https://buttplug.io for more info. // -// Copyright 2016-2024 Nonpolynomial Labs LLC. All rights reserved. +// Copyright 2016-2025 Nonpolynomial Labs LLC. All rights reserved. // // Licensed under the BSD 3-Clause license. See LICENSE file in the project root // for full license information. From 6ba48ef777ba9a5ee84d9da73378e3222348794b Mon Sep 17 00:00:00 2001 From: Claus Macher Date: Wed, 3 Dec 2025 00:32:33 -0600 Subject: [PATCH 3/3] used the old TX --- .../build-config/buttplug-device-config-v4.json | 2 +- .../device-config-v4/protocols/ossm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json b/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json index 63f2b2326..c4ca52c56 100644 --- a/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json +++ b/crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json @@ -14013,7 +14013,7 @@ ], "services": { "522b443a-4f53-534d-0001-420badbabe69": { - "tx": "522b443a-4f53-534d-0002-420badbabe69" + "tx": "522b443a-4f53-534d-1000-420badbabe69" } } } diff --git a/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml b/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml index 7c60c4bf2..ea7669a3e 100644 --- a/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml +++ b/crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml @@ -15,4 +15,4 @@ communication: - OSSM services: 522b443a-4f53-534d-0001-420badbabe69: - tx: 522b443a-4f53-534d-0002-420badbabe69 + tx: 522b443a-4f53-534d-1000-420badbabe69