internal static Task <ButtplugFFIServerMessage> SendVibrateCmd(ButtplugFFIMessageSorter aSorter, ButtplugFFIDeviceHandle aHandle, uint aDeviceIndex, Dictionary <uint, double> aSpeeds, ButtplugCallback aCallback, IntPtr aCallbackCtx) { var command_list = new List <DeviceMessage.Types.VibrateComponent>(); foreach (var pair in aSpeeds) { command_list.Add(new DeviceMessage.Types.VibrateComponent { Index = pair.Key, Speed = pair.Value, }); } var cmd = new DeviceMessage.Types.VibrateCmd(); cmd.Speeds.Add(command_list); var msg = new DeviceMessage { Index = aDeviceIndex, Message = new DeviceMessage.Types.FFIMessage { VibrateCmd = cmd } }; return(SendDeviceMessage(aSorter, aHandle, msg, aCallback, aCallbackCtx)); }
internal static Task <ButtplugFFIServerMessage> SendVibrateCmd(ButtplugFFIMessageSorter aSorter, ButtplugFFIDeviceHandle aHandle, uint aDeviceIndex, Dictionary <uint, double> aSpeeds) { var msg = new DeviceMessage(); msg.Message = new DeviceMessage.Types.FFIMessage(); var command_list = new List <DeviceMessage.Types.VibrateComponent>(); foreach (var pair in aSpeeds) { command_list.Add(new DeviceMessage.Types.VibrateComponent { Index = pair.Key, Speed = pair.Value, }); } msg.Index = aDeviceIndex; var vibrate_cmd = new DeviceMessage.Types.VibrateCmd(); vibrate_cmd.Speeds.Add(command_list); msg.Message.VibrateCmd = vibrate_cmd; return(SendDeviceMessage(aSorter, aHandle, msg)); }