async Task SendCommand(string commandName) { var command = CommandSchemaHelper.CreateNewCommand(commandName); foreach (var partitionKey in this.PartitionKeys()) { await this.iotHubRepository.SendCommand(partitionKey, command); } }
async Task SendCommand(string commandName) { var command = CommandSchemaHelper.CreateNewCommand(commandName); foreach (var partitionKey in _deviceService.GetDeviceIds()) { await _iotHubRepository.SendCommand(partitionKey, command); } }
private static void AssignCommands(dynamic device) { dynamic command = CommandSchemaHelper.CreateNewCommand("PingDevice"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StartTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StopTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); }
private static void AssignCommands(dynamic device) { dynamic command = CommandSchemaHelper.CreateNewCommand("PingDevice"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("SendBuzzer"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("SendWaypoints"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "data", "string"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("EmergencyStop"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("SetLights"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "data", "boolean"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("SetCameras"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "data", "boolean"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StartTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StopTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("DemoRun"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "data", "int"); CommandSchemaHelper.AddCommandToDevice(device, command); /*command = CommandSchemaHelper.CreateNewCommand("ChangeSetPointTemp"); * CommandSchemaHelper.DefineNewParameterOnCommand(command, "SetPointTemp", "double"); * CommandSchemaHelper.AddCommandToDevice(device, command); * * command = CommandSchemaHelper.CreateNewCommand("DiagnosticTelemetry"); * CommandSchemaHelper.DefineNewParameterOnCommand(command, "Active", "boolean"); * CommandSchemaHelper.AddCommandToDevice(device, command); * * command = CommandSchemaHelper.CreateNewCommand("ChangeDeviceState"); * CommandSchemaHelper.DefineNewParameterOnCommand(command, "DeviceState", "string"); * CommandSchemaHelper.AddCommandToDevice(device, command);*/ }
private static void AssignCommands(dynamic device) { dynamic command = CommandSchemaHelper.CreateNewCommand("PingDevice"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StartTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("StopTelemetry"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("ChangeSetPointTemp"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "SetPointTemp", "double"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("DiagnosticTelemetry"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "Active", "boolean"); CommandSchemaHelper.AddCommandToDevice(device, command); command = CommandSchemaHelper.CreateNewCommand("ChangeDeviceState"); CommandSchemaHelper.DefineNewParameterOnCommand(command, "DeviceState", "string"); CommandSchemaHelper.AddCommandToDevice(device, command); }