00001 // Copyright (c) 2004, Thomas Lochmatter, thl@lothosoft.ch 00002 00003 #ifndef classMipRxMessage 00004 #define classMipRxMessage 00005 00006 #include "MipMessage.h" 00007 00009 00012 class MipRxMessage: public MipMessage { 00013 00014 private: 00016 int mReadIndex; 00018 int mReceiveIndex; 00020 bool mErronous; 00022 bool mComplete; 00024 int mDataLength; 00025 00026 public: 00028 MipRxMessage(); 00029 00031 int GetLength() const {return mDataLength+7;} 00033 bool IsErronous() const {return mErronous;} 00035 bool IsComplete() const {return mComplete;} 00036 00038 void AddReceivedData(unsigned char *data, int len); 00039 00041 unsigned char ReadCommand() {ReadByte();} 00043 unsigned char ReadByte(); 00045 unsigned short int ReadUnsignedInteger16(); 00047 short int ReadSignedInteger16(); 00049 unsigned int ReadUnsignedInteger32(); 00051 int ReadSignedInteger32(); 00053 float ReadFloat(); 00055 bool ReadBool(); 00056 00058 bool ReadHeader(); 00060 bool ReadLength(); 00062 bool CheckCRC(); 00063 }; 00064 00065 #endif