private Task <MethodResponse> SendCommand(MethodRequest methodRequest, object userContext) { bool success = false; var payloadDefintion = new { commandName = (CommandName)(-1), }; var payload = JsonConvert.DeserializeAnonymousType(methodRequest.DataAsJson, payloadDefintion); if (payload.commandName.Valid()) { success = _device.SendCommand(payload.commandName); } return(methodRequest.GetMethodResponse(success)); }
public IActionResult OnPostOSSCSendCommand(CommandName commandName) { _ossc.SendCommand(commandName); return(RedirectToPage()); }
public IActionResult OnPostSendCommand(CommandName commandName) { _device.SendCommand(commandName); return(RedirectToPage()); }
public void GivenDevice_WhenSendCommand_ThenSuccessIsTrue() { Assert.IsTrue(_device.SendCommand(CommandName.Menu)); }