private SendCommandAsyncInternal ( Lego.Ev3.Core.Command c ) : Task | ||
c | Lego.Ev3.Core.Command | |
return | Task |
internal async Task DeleteFileAsyncInternal(string devicePath) { Command c = _brick.NewCommand(CommandType.System); c.DeleteFile(devicePath); var r = await _brick.SendCommandAsyncInternal(c); if (r.SystemReplyStatus != SystemReplyStatus.Success) { throw new Exception("Error deleting file: " + r.SystemReplyStatus); } }
internal async Task DeleteFileAsyncInternal(string devicePath) { Response r = ResponseManager.CreateResponse(); Command c = new Command(CommandType.SystemReply); c.DeleteFile(devicePath); await _brick.SendCommandAsyncInternal(c); if (r.SystemReplyStatus != SystemReplyStatus.Success) { throw new Exception("Error deleting file: " + r.SystemReplyStatus); } }
SendCommandAsync() { #if WINRT return(AsyncInfo.Run(async _ => { await _brick.SendCommandAsyncInternal(this); byte[] response = Response.Data; Initialize(CommandType.DirectNoReply); return response.AsBuffer(); })); #else await _brick.SendCommandAsyncInternal(this); byte[] response = Response.Data; Initialize(CommandType.DirectNoReply); return(response); #endif }
internal async Task TurnMotorAtPowerAsyncInternal(OutputPort ports, int power) { Command c = new Command(CommandType.DirectNoReply); c.TurnMotorAtPower(ports, power); c.StartMotor(ports); await _brick.SendCommandAsyncInternal(c); }