diff --git a/crates/buttplug_server/src/device/protocol_impl/mod.rs b/crates/buttplug_server/src/device/protocol_impl/mod.rs index 4e3a275d..677eb8f6 100644 --- a/crates/buttplug_server/src/device/protocol_impl/mod.rs +++ b/crates/buttplug_server/src/device/protocol_impl/mod.rs @@ -69,6 +69,7 @@ pub mod mizzzee_v2; pub mod mizzzee_v3; pub mod monsterpub; pub mod motorbunny; +pub mod muse2040; pub mod mysteryvibe; pub mod mysteryvibe_v2; pub mod nextlevelracing; @@ -359,6 +360,10 @@ pub fn get_default_protocol_map() -> HashMap Result, ButtplugDeviceError> { + + let data = ((_feature_index << 2) + speed) as u8; + + Ok(vec![ + HardwareWriteCmd::new(&[feature_id], Endpoint::Tx, vec![data], true).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 b4f91519..95a2e108 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 @@ -13321,6 +13321,61 @@ "name": "Muse Device" } }, + "muse2040": { + "communication": [ + { + "serial": { + "baud_rate": 115200, + "data_bits": 8, + "parity": "N", + "port": "default", + "stop_bits": 1 + } + } + ], + "defaults": { + "features": [ + { + "description": "Channel 0 (single-channel devices)", + "id": "e9594130-280a-4ec0-aff9-c799f35321e6", + "output": { + "vibrate": { + "value": [ + 0, + 3 + ] + } + } + }, + { + "description": "Channel 1", + "id": "12c1a484-8aae-48e2-a041-099d59f86ef6", + "output": { + "vibrate": { + "value": [ + 0, + 3 + ] + } + } + }, + { + "description": "Channel 2", + "id": "4d541da0-f607-43b4-a4ab-90e52c3677c3", + "output": { + "vibrate": { + "value": [ + 0, + 3 + ] + } + } + } + ], + "id": "eed7545b-3016-494a-b611-77941455dfed", + "name": "Love Spouse/MuSe Device (muse2040)" + } + }, "mysteryvibe": { "communication": [ { diff --git a/crates/buttplug_server_device_config/device-config-v4/protocols/muse2040.yml b/crates/buttplug_server_device_config/device-config-v4/protocols/muse2040.yml new file mode 100644 index 00000000..1fc4523e --- /dev/null +++ b/crates/buttplug_server_device_config/device-config-v4/protocols/muse2040.yml @@ -0,0 +1,39 @@ +# Integration is licensed under the BSD 3-Clause license. See LICENSE file in +# the project root for full license information. +# +# Driver (muse2040) is licensed under LGPLv3. See LICENSE file in the muse2040 +# project root @ https://git.girlcock.wang/may/muse2040 for full license +# information. + +defaults: + name: Love Spouse/MuSe Device (muse2040) + features: + - description: Channel 0 (single-channel devices) + id: e9594130-280a-4ec0-aff9-c799f35321e6 + output: + vibrate: + value: + - 0 + - 3 + - description: Channel 1 + id: 12c1a484-8aae-48e2-a041-099d59f86ef6 + output: + vibrate: + value: + - 0 + - 3 + - description: Channel 2 + id: 4d541da0-f607-43b4-a4ab-90e52c3677c3 + output: + vibrate: + value: + - 0 + - 3 + id: eed7545b-3016-494a-b611-77941455dfed +communication: + - serial: + port: default + baud_rate: 115200 + data_bits: 8 + parity: 'N' + stop_bits: 1 \ No newline at end of file