예제 #1
0
  @Override
  public boolean isInitialized(IByteQueue byteQueue) {
    if (byteQueue.size() < 1) return false;

    byte firstByteInQueue = byteQueue.deque();

    return firstByteInQueue == ACK;
  }
예제 #2
0
  @Override
  public boolean isReseted(IByteQueue byteQueue) {
    if (byteQueue.size() < 2) return false;

    byte firstByteInQueue = byteQueue.deque();
    byte secondByteInQueue = byteQueue.deque();

    return firstByteInQueue == ACK && secondByteInQueue == HEALTH_PING;
  }
예제 #3
0
 private byte expectedLength() {
   return (byte) (byteQueueToParse.size() - 2);
 }
예제 #4
0
 private byte getRequestSize(IByteQueue parameterBytes) {
   return (byte) (parameterBytes.size() + 2);
 }