123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- #ifndef __BU_BIAO_H_
- #define __BU_BIAO_H_
- typedef unsigned char BYTE;
- typedef unsigned short WORD;
- typedef unsigned long DWORD;
- typedef unsigned int BOOL;
- #define TSGPS_PACK_HEAD 0x7e
- #define TSGPS_PACK_END 0x7e
- /***终端通用应答***/
- #define TS_TERMINAL_UNIVERSAL_ANSWER 0x0001
- //平台通用应答
- #define TS_PLATFORM_UNIVERSAL_ANSWER 0x8001
- //终端心跳
- #define TS_TERMINAL_HEARTBEAT 0x0002
- //分包
- #define TS_SUBCONTRACTPACKET 0x8003
- //终端注册
- #define TS_TERMINAL_REGISTRATION 0X0100
- //终端注册应答
- #define TS_TERMINAL_REGISTRATION_REPLY 0X8100
- //终端鉴权
- #define TS_TERMINAL_AUTHENTICATION 0x0102
- //位置信息汇报
- #define TS_LOCATION_INFORMATION_REPORTING 0x0200
- //文本信息下发
- #define TS_TEXT_INFORMATION_ISSUED 0x8300
- //设置终端参数
- #define TS_SETTING_TERMINAL_PARAMETERS 0x8103
- #if 0
- //设置终端参数
- #define TS_SETTING_TERMINAL_PARAMETERS 0x8103
- //查询终端参数
- #define TS_QUERY_TERMINAL_PARAMETERS 0x8104
- //查询终端参数应答
- #define TS_QUERY_PARAMETER_RESPONSE_TERMINAL 0x0104
- //终端控制
- #define TS_TERMINAL_CONTROL 0x8105
- //终端注销
- #define TS_TERMINAL_CANCELLATION 0x0003
- //位置信息查询
- #define TS_LOCATION_INFORMATION_INQUIRY 0x8201
- //位置信息查询应答
- #define TS_LOCATION_INFORMATION_INQUIRY_RESPONSE 0x0201
- //临时位置跟踪控制
- #define TS_PROVISIONAL_INFORMATION_TRACKING_CONTROL 0x8202
- //事件设置
- #define TS_EVENT_SETTINGS 0x8301
- //事件报告
- #define TS_EVENT_REPORT 0x0301
- //提问下发
- #define TS_QUESTION_ISSUED 0x8302
- //提问应答
- #define TS_QUESTION_ANSWER 0x0302
- //信息点播菜单设置
- #define TS_INFORMATION_ON_DEMAND_MENU_SETTINGS 0x8303
- //信息点播/取消
- #define TS_INFORMATION_ON_DEMAND_CANCELLATIONS 0x0303
- //信息服务
- #define TS_INFORMATION_SERVICES 0x8304
- //电话回拨
- #define TS_CALL_BACK 0x8400
- //设置电话本
- #define TS_SET_THE_PHONE_BOOK 0x8401
- //车辆控制
- #define TS_THE_VEHICLE_CONTROL 0x8500
- //车辆控制应答
- #define TS_VEHICLE_CONTROL_RESPONSES 0x0500
- //设置圆形区域
- #define TS_SET_CIRCULAR_AREA 0x8600
- //删除圆形区域
- #define TS_REMOVE_CIRCULAR_AREA 0x8601
- //设置矩形区域
- #define TS_SETTING_RECTANGULAR_AREA 0x8602
- //删除矩形区域
- #define TS_DELETE_RECTANGULAR_AREA 0x8603
- //设置多边形区域
- #define TS_SET_POLYGON_AREA 0x8604
- //删除多边形区域
- #define TS_DELETE_POLYGON_AREA 0x8605
- //设置线路
- #define TS_SET_LINE 0x8606
- //删除线路
- #define TS_DELETE_SET_LINE 0x8607
- //行驶记录数据采集命令
- #define TS_WITH_RECORD_DATA_COLLECTION 0x8700
- //行驶记录数据上传
- #define TS_WITH_RECORDING_DATA_UPLOAD 0x0700
- //行驶记录参数下传
- #define TS_WITH_RECORDING_DATA_DOWNLINK 0x8101
- //电子运单上报
- #define TS_ELECTRONIC_WAYBILL_REPORTED 0x0701
- //驾驶员身份信息采集上报
- #define TS_DRIVER_IDENTITY_DATA_COLLECTION 0x0702
- //多媒体事件信息上传
- #define TS_MULTIMEDIA_EVENT_UPLOAD 0x0800
- //多媒体数据上传
- #define TS_MULTIMEDIA_DATA_UPLOAD 0x0801
- //多媒体数据上传应答
- #define TS_MULTIMEDIA_DATA_UPLOAD_REPLY 0x8800
- //摄像头立即拍摄命令
- #define TS_CAMERA_IMMEDIATELY_SHOOTING_COMMAND 0x8801
- //存储多媒体数据检索
- #define TS_STORING_MULTIMEDIA_DATA_RETRIEVAL 0x8802
- //存储多媒体数据检索应答
- #define TS_STORING_MULTIMEDIA_DATA_RETRIEVAL_RESPONSE 0x0802
- //存储多媒体数据上传命令
- #define TS_STORING_MULTIMEDIA_DATA_UPLOAD_COMMAND 0x8803
- //录音开始命令
- #define TS_RECORDING_START_COMMAND 0x8804
- //数据下行透传
- #define TS_DOWNLINK_DATA_PASSTHROUGH 0x8900
- //数据上行透传
- #define TS_UPLINK_DATA_PASSTHROUGH 0x0900
- //数据压缩上报
- #define TS_DATA_COMPRESSION_REPORTING 0x0901
- //平台RSA公钥
- #define TS_PLATFORM_RSA_PUBLIC_KEY 0x8A00
- //终端RSA公钥
- #define TS_TERMINAL_RSA_PUBLIC_KEY 0x0A00
- #endif
- //保留自定义
- //终端上传SOS消息
- #define TS_SEND_SOS_SMS 0x0F01
- #define TS_TERMINAL_REQTIME 0x0F02
- typedef struct registration{
- WORD proID;//省域ID 16byte
- WORD CityID; //市域ID16byte
- BYTE Manufacturers[5]; //制造商
- BYTE TerMod[20]; //终端型号 不足补0x00
- BYTE TerID[7]; //终端ID 不足补0x00 本来7个字节 为了跟星安一致 取4个字节
- BYTE PlateColor; //车牌颜色 未上牌取值为0
- // STRING Plate; //车牌
- BYTE Plate[8];//WORD 8
- }REGISTRATION;
- typedef enum ENCRYPTYPE1{NO_ENCRYP=0,RSA=1}ENCRYPTYPE;
- typedef struct msgBodyAttrib{
- BOOL bSepartePack;//是否分包
- ENCRYPTYPE EncrypType; //加密
- int msgBodyLength; //消息长度
- }AVL_MSG_BODY_ATTRIB;
- typedef struct SUT_GPS_SEND_DATA{
- unsigned int St;
- unsigned int status;
- unsigned char WWWW[4];
- unsigned char JJJJ[4];
- unsigned short Mileag;
- unsigned short SSFF;
- unsigned short Acpect;
- unsigned char Time[6];
- }__attribute__((packed)) SUT_GPS_SEND_DATA;
- typedef struct{
- unsigned char feedBackStart:1;
- unsigned short feedID;
- unsigned short feedliushuiID;
- unsigned char result;
- }__attribute__ ((packed)) FEEDBACK_DEF;
- extern FEEDBACK_DEF sutFeed;
- extern unsigned char buBiaoSosSendNow;
- void buBiaoLogic(unsigned char socketID);
- int reduce(unsigned char *pData,int DataLen);
- void TSMakeGpsSendData(SUT_GPS_SEND_DATA *sendGpsData);
- void buBiaoDataProcess(unsigned char *msg, unsigned short len);
- void TSGpsDataInit(void);
- void PrintBufferData(unsigned char *data, unsigned short length);
- #endif
|