-
-
Notifications
You must be signed in to change notification settings - Fork 104
OSSM speed support through BLE #800
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
Open
RubberyFun
wants to merge
14
commits into
buttplugio:dev
Choose a base branch
from
RubberyFun:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
080bc23
OSSM speed support through BLE
RubberyFun c58e474
The future Marty!
RubberyFun 6ba48ef
used the old TX
RubberyFun 401aa0f
feat: Remove Lovense Dongle
qdot 0639305
feat: Remove Lovense Connect support
qdot 456a699
feat(tests): add VersionGated TestCommand variant for protocol versio…
qdot ff14f48
feat(tests): wrap v3+ command sequences in VersionGated blocks
qdot ab0cea0
feat(tests): enable v2 protocol test suite
qdot 82d6294
feat(tests): Create V0 protocol client stack implementation
qdot ca6db4f
feat(tests): create V1 protocol client stack
qdot cb4cc76
fix: Resolve V0 and V1 protocol client stack compilation errors
qdot 0f6f10f
feat(tests): enable v1 protocol test suite and fix v1 JSON serialization
qdot 298de7d
feat(tests): enable v0 protocol test suite with SingleMotorVibrateCmd
qdot 9b1262e
Merge branch 'dev' into dev
RubberyFun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // Buttplug Rust Source Code File - See https://buttplug.io for more info. | ||
| // | ||
| // Copyright 2016-2024 Nonpolynomial Labs LLC. All rights reserved. | ||
| // | ||
| // Licensed under the BSD 3-Clause license. See LICENSE file in the project root | ||
| // for full license information. | ||
|
|
||
|
|
||
| use crate::device::{ | ||
| hardware::{Hardware, HardwareCommand, HardwareWriteCmd}, | ||
| protocol::{ | ||
| ProtocolHandler, | ||
| ProtocolIdentifier, | ||
| ProtocolInitializer, | ||
| generic_protocol_initializer_setup | ||
| }, | ||
| }; | ||
| use buttplug_core::errors::ButtplugDeviceError; | ||
| use buttplug_server_device_config::{ | ||
| Endpoint, | ||
| ServerDeviceDefinition, | ||
| UserDeviceIdentifier, | ||
| ProtocolCommunicationSpecifier, | ||
| }; | ||
| use std::sync::Arc; | ||
| use uuid::{Uuid, uuid}; | ||
| use async_trait::async_trait; | ||
|
|
||
| const OSSM_PROTOCOL_UUID: Uuid = uuid!("a817e40d-acda-439d-bebf-420badbabe69"); | ||
| generic_protocol_initializer_setup!(OSSM, "ossm"); | ||
|
|
||
| #[derive(Default)] | ||
| pub struct OSSMInitializer {} | ||
|
|
||
| #[async_trait] | ||
| impl ProtocolInitializer for OSSMInitializer { | ||
| async fn initialize( | ||
| &mut self, | ||
| hardware: Arc<Hardware>, | ||
| _: &ServerDeviceDefinition, | ||
| ) -> Result<Arc<dyn ProtocolHandler>, 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<Vec<HardwareCommand>, 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(), | ||
| ]) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
crates/buttplug_server_device_config/device-config-v4/protocols/ossm.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
2 changes: 1 addition & 1 deletion
2
crates/buttplug_server_device_config/device-config-v4/version.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| version: | ||
| major: 4 | ||
| minor: 95 | ||
| minor: 96 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 2025