Example #1
0
 /// <summary>
 /// Throws an exception if bytes received contain a command error,
 /// address error, or overflow error.
 /// </summary>
 /// <param name="receivedBytes">The bytes received.</param>
 /// <returns></returns>
 public bool IsDeviceResponseValid(byte[] receivedBytes)
 {
     if (ByteUtils.ByteArrayContains(receivedBytes, ByteResponseEnum.COMMAND_ERROR))
     {
         throw new Exception(); // TODO: Throw command error exception
     }
     if (ByteUtils.ByteArrayContains(receivedBytes, ByteResponseEnum.ADDRESS_ERROR))
     {
         throw new Exception(); // TODO: Throw address error exception
     }
     if (ByteUtils.ByteArrayContains(receivedBytes, ByteResponseEnum.OVERFLOW_ERROR))
     {
         throw new Exception(); // TODO: Throw overflow error exception
     }
     return(true);
 }