Пример #1
0
 internal SysExMessage RunCommand(SysExMessage msg, int Timeout = 30)
 {
     if (sp.BytesToRead != 0) //clear the buffer from any sent bytes previously
         sp.ReadExisting();
     Send(msg.ToArray());
     var r = ReadSysEx(Timeout);
     if (r.Command != msg.Command)
         throw new ArrayTypeMismatchException($"Command Mismatch. Command Sent: '{msg.Command}', Command Read: '{r.Command}'");
     return r;
 }
Пример #2
0
 private void SendSysExMsg(SysExMessage sysEx)
 {
     Send(sysEx.ToArray());
 }