Example #1
0
        private static byte WriteCommandWithResult(IDevice device, byte command)
        {
            byte resp = device.WriteCommand(command);
            if ((command & 0x0f) != (resp >> 4))
                throw new Exception("Communication Error");

            return (byte)(resp & 0x0f);
        }
Example #2
0
 private static void WriteCommandWithEchoCheck(IDevice device, byte command)
 {
     byte resp = device.WriteCommand(command);
     if (command != resp)
         throw new Exception("Communication Error");
 }