예제 #1
0
 void SendCommand(UartCommand command, ushort address, Task data)
 {
     var dta = new byte[7];
     dta[0] = (byte)command;
     dta[1] = (byte)(address << 8);
     dta[2] = (byte)(address);
     if (data != null)
     {
         data.GetBytes().CopyTo(dta, 3);
     }
     port.Send(dta, 1, false);
 }