public void TestVorzeA10CycloneCmd() { byte deviceIndex = 1; foreach (var name in _deviceNames) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); testUtil.SetupTest(name); var expected = new byte[] { deviceIndex, 0x1, 50 }; testUtil.TestDeviceMessage(new VorzeA10CycloneCmd(4, 50, false), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); expected = new byte[] { deviceIndex, 0x1, 50 + 128 }; testUtil.TestDeviceMessage(new VorzeA10CycloneCmd(4, 50, true), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); deviceIndex++; } }
internal async Task TestAllowedMessages(string aDeviceName, VorzeSA.CommandType aCommandType) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); await testUtil.SetupTest(aDeviceName); if (aCommandType == VorzeSA.CommandType.Rotate) { testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>() { { typeof(StopDeviceCmd), 0 }, { typeof(VorzeA10CycloneCmd), 0 }, { typeof(RotateCmd), 1 }, }); } else if (aCommandType == VorzeSA.CommandType.Vibrate) { testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>() { { typeof(StopDeviceCmd), 0 }, { typeof(SingleMotorVibrateCmd), 0 }, { typeof(VibrateCmd), 1 }, }); } else { Assert.Fail("Unknown command type"); } }
public async Task TestVibrateCmd() { foreach (var item in KiirooGen2Vibe.DevInfos) { var testUtil = new BluetoothDeviceTestUtils <KiirooGen2VibeBluetoothInfo>(); await testUtil.SetupTest(item.Key); var speeds = new[] { 0.25, 0.5, 0.75 }; var features = new List <VibrateCmd.VibrateSubcommand>(); for (var i = 0u; i < item.Value.VibeCount; ++i) { features.Add(new VibrateCmd.VibrateSubcommand(i, speeds[i])); } var expected = new byte[] { 0, 0, 0 }; for (var i = 0u; i < item.Value.VibeCount; ++i) { item.Value.VibeOrder.Should().Contain(i); expected[Array.IndexOf(item.Value.VibeOrder, i)] = (byte)(speeds[i] * 100); } await testUtil.TestDeviceMessage(new VibrateCmd(4, features), new List <(byte[], uint)>() { (expected, (uint)KiirooGen2VibeBluetoothInfo.Chrs.Tx), }, false); } }
public void Init() { testUtil = new BluetoothDeviceTestUtils <LovenseBluetoothInfo>(); // Just leave name the same as the prefix, we'll set device type via initialize. testUtil.SetupTest("LVS", false); testUtil.AddExpectedRead(testUtil.NoCharacteristic, Encoding.ASCII.GetBytes("A:13:000000000000")); testUtil.Initialize(); }
public void TestInvalidVibrateCmd() { foreach (var item in KiirooGen2Vibe.DevInfos) { var testUtil = new BluetoothDeviceTestUtils <KiirooGen2VibeBluetoothInfo>(); testUtil.SetupTest(item.Key); testUtil.TestInvalidVibrateCmd(item.Value.VibeCount); } }
public async Task TestRotateCmd(string aDeviceName, byte aPrefix) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); await testUtil.SetupTest(aDeviceName); var expected = new byte[] { aPrefix, 0x1, 50 }; await testUtil.TestDeviceMessage( RotateCmd.Create(4, 1, 0.5, false, 1), new List <(byte[], uint)> { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false);
public void TestAllowedMessages() { foreach (var name in _deviceNames) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); testUtil.SetupTest(name); testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>() { { typeof(StopDeviceCmd), 0 }, { typeof(VorzeA10CycloneCmd), 0 }, { typeof(RotateCmd), 1 }, }); } }
public void TestAllowedMessages() { foreach (var item in KiirooGen2Vibe.DevInfos) { var testUtil = new BluetoothDeviceTestUtils <KiirooGen2VibeBluetoothInfo>(); testUtil.SetupTest(item.Key); testUtil.TestDeviceAllowedMessages(new Dictionary <System.Type, uint>() { { typeof(StopDeviceCmd), 0 }, { typeof(SingleMotorVibrateCmd), 0 }, { typeof(VibrateCmd), item.Value.VibeCount }, }); } }
public void TestInvalidVibrateCmd() { foreach (var name in _deviceNames) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); testUtil.SetupTest(name); testUtil.TestInvalidDeviceMessage(RotateCmd.Create(4, 1, 0.5, false, 0)); testUtil.TestInvalidDeviceMessage(RotateCmd.Create(4, 1, 0.5, false, 2)); testUtil.TestInvalidDeviceMessage( new RotateCmd(4, new List <RotateCmd.RotateSubcommand>() { new RotateCmd.RotateSubcommand(0xffffffff, 0.5, true), })); } }
public void TestSingleMotorVibrateCmd() { foreach (var item in KiirooGen2Vibe.DevInfos) { var testUtil = new BluetoothDeviceTestUtils <KiirooGen2VibeBluetoothInfo>(); testUtil.SetupTest(item.Key); var expected = new byte[] { 0, 0, 0 }; for (var i = 0u; i < item.Value.VibeCount; ++i) { Assert.True(item.Value.VibeOrder.Contains(i)); expected[Array.IndexOf(item.Value.VibeOrder, i)] = 50; } testUtil.TestDeviceMessage(new SingleMotorVibrateCmd(4, 0.5), new List <(byte[], uint)>() { (expected, (uint)KiirooGen2VibeBluetoothInfo.Chrs.Tx), }, false); } }
public async Task TestVorzeA10CycloneCmd(string aDeviceName, byte aPrefix) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); await testUtil.SetupTest(aDeviceName); var expected = new byte[] { aPrefix, 0x1, 50 }; await testUtil.TestDeviceMessage(new VorzeA10CycloneCmd(4, 50, false), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); expected = new byte[] { aPrefix, 0x1, 50 + 128 }; await testUtil.TestDeviceMessage(new VorzeA10CycloneCmd(4, 50, true), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); }
// StopDeviceCmd noop test handled in GeneralDeviceTests internal async Task TestStopDeviceCmd(string aDeviceName, byte aPrefix, VorzeSA.CommandType aCommandType) { testUtil = new BluetoothDeviceTestUtils <VorzeSABluetoothInfo>(); await testUtil.SetupTest(aDeviceName); var expected = new byte[] { aPrefix, (byte)aCommandType, 50 }; if (aCommandType == VorzeSA.CommandType.Rotate) { await testUtil.TestDeviceMessage(new VorzeA10CycloneCmd(4, 50, false), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); } else if (aCommandType == VorzeSA.CommandType.Vibrate) { await testUtil.TestDeviceMessage(new SingleMotorVibrateCmd(4, 0.5), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); } else { Assert.Fail("Unknown command type"); } expected = new byte[] { aPrefix, (byte)aCommandType, 0 }; await testUtil.TestDeviceMessage(new StopDeviceCmd(4), new List <(byte[], uint)>() { (expected, (uint)VorzeSABluetoothInfo.Chrs.Tx), }, false); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <MagicMotionBluetoothInfo>(); testUtil.SetupTest("Smart Mini Vibe"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <YoucupsBluetoothInfo>(); testUtil.SetupTest("Youcups"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <VibratissimoBluetoothInfo>(); testUtil.SetupTest("Vibratissimo"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <MysteryVibeBluetoothInfo>(); await testUtil.SetupTest("MV Crescendo"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <FleshlightLaunchBluetoothInfo>(); testUtil.SetupTest("Launch"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <YoucupsBluetoothInfo>(); await testUtil.SetupTest("Youcups"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <FleshlightLaunchBluetoothInfo>(); await testUtil.SetupTest("Launch"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <MagicMotionBluetoothInfo>(); await testUtil.SetupTest("Smart Mini Vibe"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <MagicMotionBluetoothInfo>(); await testUtil.SetupTest("Eidolon"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <LiBoBluetoothInfo>(); await testUtil.SetupTest("PiPiJing"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <LiBoBluetoothInfo>(); testUtil.SetupTest("PiPiJing"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <PicobongBluetoothInfo>(); await testUtil.SetupTest("Diver"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <WeVibeBluetoothInfo>(); testUtil.SetupTest("4plus"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <KiirooOnyx2BluetoothInfo>(); testUtil.SetupTest("Onyx2"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <KiirooOnyx2BluetoothInfo>(); await testUtil.SetupTest("Onyx2"); }
public async Task Init() { testUtil = new BluetoothDeviceTestUtils <VibratissimoBluetoothInfo>(); await testUtil.SetupTest("Vibratissimo"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <MysteryVibeBluetoothInfo>(); testUtil.SetupTest("MV Crescendo"); }
public void Init() { testUtil = new BluetoothDeviceTestUtils <KiirooBluetoothInfo>(); testUtil.SetupTest("PEARL"); }