Buttplug sex toy control library

feat: Add Support for 3 more Luvmazer devices

authored by

blackspherefollower and committed by qdot.tngl.sh 55003ba6 60eaee35

+243 -13
+38 -10
crates/buttplug_server/src/device/protocol_impl/luvmazer.rs
··· 22 22 impl ProtocolHandler for Luvmazer { 23 23 fn handle_output_vibrate_cmd( 24 24 &self, 25 - _feature_index: u32, 25 + feature_index: u32, 26 26 feature_id: Uuid, 27 27 speed: u32, 28 28 ) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> { 29 - Ok(vec![ 30 - HardwareWriteCmd::new( 31 - &[feature_id], 32 - Endpoint::Tx, 33 - vec![0xa0, 0x01, 0x00, 0x00, 0x64, speed as u8], 34 - false, 35 - ) 36 - .into(), 37 - ]) 29 + Ok(vec![HardwareWriteCmd::new( 30 + &[feature_id], 31 + Endpoint::Tx, 32 + vec![0xa0, 0x01, 0x00, feature_index as u8, 0x64, speed as u8], 33 + false, 34 + ) 35 + .into()]) 38 36 } 39 37 40 38 fn handle_output_rotate_cmd( ··· 52 50 ) 53 51 .into(), 54 52 ]) 53 + } 54 + 55 + fn handle_output_oscillate_cmd( 56 + &self, 57 + _feature_index: u32, 58 + feature_id: Uuid, 59 + speed: u32, 60 + ) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> { 61 + Ok(vec![HardwareWriteCmd::new( 62 + &[feature_id], 63 + Endpoint::Tx, 64 + vec![0xa0, 0x06, 0x01, 0x00, 0x64, speed as u8], 65 + false, 66 + ) 67 + .into()]) 68 + } 69 + 70 + fn handle_output_constrict_cmd( 71 + &self, 72 + _feature_index: u32, 73 + feature_id: Uuid, 74 + speed: u32, 75 + ) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> { 76 + Ok(vec![HardwareWriteCmd::new( 77 + &[feature_id], 78 + Endpoint::Tx, 79 + vec![0xa0, 0x0d, 0x00, 0x00, if speed == 0 { 0x00} else { 0x14 }, speed as u8], 80 + false, 81 + ) 82 + .into()]) 55 83 } 56 84 }
+125 -2
crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json
··· 1 1 { 2 2 "version": { 3 3 "major": 4, 4 - "minor": 88 4 + "minor": 91 5 5 }, 6 6 "protocols": { 7 7 "activejoy": { ··· 11828 11828 { 11829 11829 "btle": { 11830 11830 "names": [ 11831 - "TKLM-W001-BT" 11831 + "TKLM-W001-BT", 11832 + "TKLM-W003-BT-RX", 11833 + "TKLM-C003-BT", 11834 + "TKLM-C004-BT" 11832 11835 ], 11833 11836 "services": { 11834 11837 "0000ffa0-0000-1000-8000-00805f9b34fb": { ··· 11836 11839 } 11837 11840 } 11838 11841 } 11842 + } 11843 + ], 11844 + "configurations": [ 11845 + { 11846 + "id": "cb63c51d-ed29-4e07-81ce-aca8162e52ba", 11847 + "identifier": [ 11848 + "TKLM-W001-BT" 11849 + ], 11850 + "name": "Luvmazer Finger Magic" 11851 + }, 11852 + { 11853 + "features": [ 11854 + { 11855 + "feature-type": "Vibrate", 11856 + "id": "8deea69f-ea53-46bb-80ae-51dd5d49bba9", 11857 + "output": { 11858 + "Vibrate": { 11859 + "step-range": [ 11860 + 0, 11861 + 255 11862 + ] 11863 + } 11864 + } 11865 + }, 11866 + { 11867 + "feature-type": "Oscillate", 11868 + "id": "5ae8bb6f-6280-4a8d-9e08-a3d5e5fb89a8", 11869 + "output": { 11870 + "Oscillate": { 11871 + "step-range": [ 11872 + 0, 11873 + 255 11874 + ] 11875 + } 11876 + } 11877 + } 11878 + ], 11879 + "id": "54723a02-4d77-4d58-90ee-1e692768db9d", 11880 + "identifier": [ 11881 + "TKLM-W003-BT-RX" 11882 + ], 11883 + "name": "Luvmazer Cat Paw" 11884 + }, 11885 + { 11886 + "features": [ 11887 + { 11888 + "feature-type": "Vibrate", 11889 + "id": "4dd378c8-a91b-400e-846b-f16e81ac5690", 11890 + "output": { 11891 + "Vibrate": { 11892 + "step-range": [ 11893 + 0, 11894 + 255 11895 + ] 11896 + } 11897 + } 11898 + }, 11899 + { 11900 + "feature-type": "Vibrate", 11901 + "id": "c04a2518-81a2-49cb-8a0a-1a5b9c163737", 11902 + "output": { 11903 + "Vibrate": { 11904 + "step-range": [ 11905 + 0, 11906 + 255 11907 + ] 11908 + } 11909 + } 11910 + } 11911 + ], 11912 + "id": "3f3cb905-d570-41dc-80ed-720762770093", 11913 + "identifier": [ 11914 + "TKLM-C003-BT" 11915 + ], 11916 + "name": "Luvmazer Cock Ring" 11917 + }, 11918 + { 11919 + "features": [ 11920 + { 11921 + "feature-type": "Vibrate", 11922 + "id": "e04ad6f5-278e-4acc-b6fa-711954c2e1ab", 11923 + "output": { 11924 + "Vibrate": { 11925 + "step-range": [ 11926 + 0, 11927 + 255 11928 + ] 11929 + } 11930 + } 11931 + }, 11932 + { 11933 + "feature-type": "Oscillate", 11934 + "id": "8a4f2884-887f-46e3-9a36-c0b91b1b1363", 11935 + "output": { 11936 + "Oscillate": { 11937 + "step-range": [ 11938 + 0, 11939 + 255 11940 + ] 11941 + } 11942 + } 11943 + }, 11944 + { 11945 + "feature-type": "Constrict", 11946 + "id": "389aa8b8-2550-462c-bd4f-1158c0981606", 11947 + "output": { 11948 + "Constrict": { 11949 + "step-range": [ 11950 + 0, 11951 + 54 11952 + ] 11953 + } 11954 + } 11955 + } 11956 + ], 11957 + "id": "d76d8d49-beca-49f3-931e-5a040b463111", 11958 + "identifier": [ 11959 + "TKLM-C004-BT" 11960 + ], 11961 + "name": "Luvmazer Interstellar" 11839 11962 } 11840 11963 ], 11841 11964 "defaults": {
+79
crates/buttplug_server_device_config/device-config-v4/protocols/luvmazer.yml
··· 14 14 - 0 15 15 - 255 16 16 id: c6d24bef-8263-4e3b-898d-7aeb7e58cc11 17 + configurations: 18 + - identifier: 19 + - TKLM-W001-BT 20 + name: Luvmazer Finger Magic 21 + id: cb63c51d-ed29-4e07-81ce-aca8162e52ba 22 + - identifier: 23 + - TKLM-W003-BT-RX 24 + name: Luvmazer Cat Paw 25 + features: 26 + - feature-type: Vibrate 27 + id: 8deea69f-ea53-46bb-80ae-51dd5d49bba9 28 + output: 29 + Vibrate: 30 + step-range: 31 + - 0 32 + - 255 33 + - feature-type: Oscillate 34 + id: 5ae8bb6f-6280-4a8d-9e08-a3d5e5fb89a8 35 + output: 36 + Oscillate: 37 + step-range: 38 + - 0 39 + - 255 40 + #- feature-type: Inflate 41 + # id: 4a0abbbd-75b6-4034-8012-2be2f1442c1c 42 + # output: 43 + # Inflate: 44 + # step-range: 45 + # - 0 46 + # - 1 47 + id: 54723a02-4d77-4d58-90ee-1e692768db9d 48 + - identifier: 49 + - TKLM-C003-BT 50 + name: Luvmazer Cock Ring 51 + features: 52 + - feature-type: Vibrate 53 + id: 4dd378c8-a91b-400e-846b-f16e81ac5690 54 + output: 55 + Vibrate: 56 + step-range: 57 + - 0 58 + - 255 59 + - feature-type: Vibrate 60 + id: c04a2518-81a2-49cb-8a0a-1a5b9c163737 61 + output: 62 + Vibrate: 63 + step-range: 64 + - 0 65 + - 255 66 + id: 3f3cb905-d570-41dc-80ed-720762770093 67 + - identifier: 68 + - TKLM-C004-BT 69 + name: Luvmazer Interstellar 70 + features: 71 + - feature-type: Vibrate 72 + id: e04ad6f5-278e-4acc-b6fa-711954c2e1ab 73 + output: 74 + Vibrate: 75 + step-range: 76 + - 0 77 + - 255 78 + - feature-type: Oscillate 79 + id: 8a4f2884-887f-46e3-9a36-c0b91b1b1363 80 + output: 81 + Oscillate: 82 + step-range: 83 + - 0 84 + - 255 85 + - feature-type: Constrict 86 + id: 389aa8b8-2550-462c-bd4f-1158c0981606 87 + output: 88 + Constrict: 89 + step-range: 90 + - 0 91 + - 54 92 + id: d76d8d49-beca-49f3-931e-5a040b463111 17 93 communication: 18 94 - btle: 19 95 names: 20 96 - TKLM-W001-BT 97 + - TKLM-W003-BT-RX 98 + - TKLM-C003-BT 99 + - TKLM-C004-BT 21 100 services: 22 101 0000ffa0-0000-1000-8000-00805f9b34fb: 23 102 tx: 0000ffa1-0000-1000-8000-00805f9b34fb
+1 -1
crates/buttplug_server_device_config/device-config-v4/version.yaml
··· 1 1 version: 2 2 major: 4 3 - minor: 88 3 + minor: 91