Buttplug sex toy control library
at dev 59 lines 1.4 kB view raw
1// Since all of the uses of this module are generated, dead code resolution doesn't work. 2#![allow(dead_code)] 3pub mod client; 4pub mod connector; 5use super::{TestDeviceIdentifier, TestHardwareEvent}; 6use buttplug_server::device::hardware::HardwareCommand; 7use buttplug_server::message::{ 8 RotationSubcommandV1, 9 ScalarSubcommandV3, 10 VectorSubcommandV1, 11 VibrateSubcommandV1, 12}; 13use serde::{Deserialize, Serialize}; 14 15#[derive(Serialize, Deserialize)] 16struct TestDevice { 17 identifier: TestDeviceIdentifier, 18 expected_name: Option<String>, 19 expected_display_name: Option<String>, 20} 21 22#[derive(Serialize, Deserialize, Debug)] 23enum TestCommand { 24 Messages { 25 device_index: u32, 26 messages: Vec<TestClientCommand>, 27 }, 28 Commands { 29 device_index: u32, 30 commands: Vec<HardwareCommand>, 31 }, 32 Events { 33 device_index: u32, 34 events: Vec<TestHardwareEvent>, 35 }, 36} 37 38#[derive(Serialize, Deserialize, Debug)] 39enum TestClientCommand { 40 Scalar(Vec<ScalarSubcommandV3>), 41 Vibrate(Vec<VibrateSubcommandV1>), 42 Rotate(Vec<RotationSubcommandV1>), 43 Linear(Vec<VectorSubcommandV1>), 44 Battery { 45 expected_power: f64, 46 run_async: bool, 47 }, 48 Stop, 49 RSSI, 50} 51 52#[derive(Serialize, Deserialize)] 53pub struct DeviceTestCase { 54 devices: Vec<TestDevice>, 55 device_config_file: Option<String>, 56 user_device_config_file: Option<String>, 57 device_init: Option<Vec<TestCommand>>, 58 device_commands: Vec<TestCommand>, 59}