Example #1
0
        private static async Task RunExample()
        {
            var client = new ButtplugClient("Test Client");

            client.DeviceAdded += async(obj, args) =>
            {
                var device = args.Device;
                if (device.AllowedMessages.ContainsKey(ButtplugFFI.MessageAttributeType.VibrateCmd))
                {
                    await device.SendVibrateCmd(0.5);
                }
                device.Dispose();
                device = null;
            };
            await client.ConnectLocal();

            //await client.ConnectWebsocket();
            await client.StartScanning();

            await WaitForKey();

            client.Dispose();
            client = null;
            await WaitForKey();
        }