#ifndef PLATFORM_H #define PLATFORM_H #include #include #include #include #include #include #include #include "dataformat.h" //#include //#include //#include #include #include #include #include #include #include #include #include //#include #include #include #define SRV_ADDR_ "123.127.164.44" #define SRV_PORT_ 5602 using namespace std; namespace iv { namespace platform { class Client { public: Client(); ~Client(); double srclng; double srclat; double deslng; double deslat; void start(); void run(); void stop(); void Heartdetect(); int PackagetHeadInfo(unsigned char commendID, int dataLen); bool CarCheckin(int count);//车辆登入0x01 void RealtimeInfo();//实时信息上报0x01 void SupplementInfo();//补发信息上报0x03 bool CarCheckout(int count);//车辆登出0x04 void Heartbeat();//发送心跳 0x07 void TerminalCheckTime();//终端校时0x08 void CarStatusInfo();//车身状态数据0x09 void DriveDataLowInfo();//驾驶行为数据 低频 0x0A void DriveDataHighInfo();//驾驶行为数据 高频 0x0B void SenserConfig(); void CarControlInfo(char recvBuf[]); void LongdistanceDriveInfo(char recvBuf[]); void AppointmentDispatchInfo(char recvBuf[]); void PlatformtToInfo(char recvBuf[]); void RoutePlaningInfo(char recvBuf[]); void CarCallSwitch(); void Receive();//接收数据 char BCCEncode(char sbuf[],int len);//计算校验 bool BCCDecode(char sbuf[], int len); void ReadStation(char *filepath); private: QTcpSocket *socket; bool is_checkin ; bool is_receive; int heartdetect; int heartdetect_last; int checkInOutNum; bool is_order; bool is_going; bool is_stopnext; bool is_stopend; bool is_stopmid; bool is_endnow; bool is_endbegin; bool is_reorder; bool is_keepgoing; iv::platform::CarStatus carStatusInfo; iv::platform::DataPackageHead packageDataHead; }; } } #endif // PLATFORM_H