public virtual void parseData(PacketHeader header, byte[] data, int dataCount, ref int offset) { mHeader = header; offset = mHeader.mHeaderLength; mCmdID = BinaryUtility.readByte(data, ref offset); mKeyID = BinaryUtility.readByte(data, ref offset); mValueLength = BinaryUtility.readByte(data, ref offset); }
public void read(ref byte value, bool inverse = false) { int readLen = sizeof(byte); if (!readCheck(readLen)) { return; } value = BinaryUtility.readByte(mBuffer, ref mIndex); }
public override void parseData(PacketHeader header, byte[] data, int dataCount, ref int offset) { base.parseData(header, data, dataCount, ref offset); mPower = (ushort)BinaryUtility.readShort(data, ref offset, true); mRPM = (ushort)BinaryUtility.readShort(data, ref offset, true); // 最高位为0,角度为正 if ((data[offset] & 0x80) == 0) { mAngle = BinaryUtility.readShort(data, ref offset, true); } // 最高位为1,角度为负 else { data[offset] &= 0x7f; mAngle = BinaryUtility.readShort(data, ref offset, true); mAngle = (short)-mAngle; } mKeyStatus = BinaryUtility.readByte(data, ref offset); }
public override void parseData(PacketHeader header, byte[] data, int dataCount, ref int offset) { base.parseData(header, data, dataCount, ref offset); mFriction = BinaryUtility.readByte(data, ref offset); }
public override void readFromBuffer(byte[] buffer, ref int index) { mValue = BinaryUtility.readByte(buffer, ref index); }