public void onSerialByteReceived(byte byteValue){
		if(byteValue == PREAMBLE){
			rxFrame.position(0);
			return;
		}
		if(byteValue == ESCAPE){
			isLastByteEscape = true;
			return;
		}
		if(isLastByteEscape){
			byteValue = (byte) (byteValue ^ 0x20);
			isLastByteEscape = false;
		}
		if(rxFrame.position()==0){
			currPayloadLength = (int) byteValue & 0xff;
			if(currPayloadLength > MAX_FRAME_SIZE-5){
				return;
			}
		}
		rxFrame.put(byteValue);
		if(rxFrame.position() == currPayloadLength+5){
			rxFrame.position(0);
			try {
				Frame frame = new Frame(rxFrame.array());
				if(frame.getDestMac() == myMacAddress || frame.getDestMac() == 0){
					layer3.onFrameReceived(ByteBuffer.wrap(frame.getPayload()), this, frame.getSrcMac());
				}
			} catch (InvalidPacketException e) {
				e.printStackTrace();
			}
			rxFrame = ByteBuffer.allocate(MAX_FRAME_SIZE);
		}
	}