123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- #ifndef DATAFORMAT_H
- #define DATAFORMAT_H
- //////////////////////////////
- // 命令标识 //
- /////////////////////////////
- #define carCheckin (0x01)//车辆登入
- #define realtimeInfoUpload (0x02)//实时信息上报
- #define supplementInfoUpload (0x03)//补发信息上报
- #define carCheckout (0x04)//车辆登出
- #define platformReserve1 (0x05)//平台数据传输占用
- #define platfoemReserve2 (0x06)//平台数据传输占用
- #define heartbeats (0x07)//心跳
- #define terminalCheckTime (0x08)//终端校时
- #define carStatus (0x09)//车身状态
- #define driveDataLow (0x0A)//驾驶行为数据(低频)
- #define driveDataHigh (0x0B)//驾驶行为数据(高频)
- #define carAlarm (0x0C)//车辆报警信息
- #define sensorConfig (0x0D)//传感器配置信息
- #define multimedia (0x0E)//多媒体信息
- #define V2X (0x0F)//V2X信息
- #define APPcarcall (0x10)//APP约车上行信息
- #define humanIntervene (0x11)//人工干预信息
- #define inquire (0x80)//查询命令
- #define setting (0x81)//设置命令
- #define carTerminalControl (0x82)//车载终端控制命令
- #define carLongdistanceControl (0x83)//车身远程遥控命令
- #define longdistanceDrive (0x84)//远程遥控驾驶
- #define appointmentDispatch (0x85)//预约与远程调度
- #define routePlane (0x86)//路径规划
- #define carCamControl (0x87)//车载摄像头控制
- #define platformTo (0x88)//与APP通讯下行信息
- #define downDataReserve (0x89)//下行数据系统预留
- #define platformReserve (0xC0)//平台交换自定义数据
- //////////////////////////////
- // 应答标识 //
- /////////////////////////////
- #define resuccess (0x01)//成功
- #define reerror (0x02)//错误
- #define VINrepetition (0x03)//VIN重复
- #define reserves (0x40)//保留
- #define comment (0xFE)//命令
- #include <string>
- using namespace std;
- namespace iv {
- namespace platform {
- struct DataPackageHead//数据包结构
- {
- unsigned char startSymbol1;//起始符1
- unsigned char startSymbol2;//起始符2
- unsigned char commentSymbol;//命令标识
- unsigned char responseSymbol;//应答标识
- char VIN[17];//车辆识别码
- unsigned char encryptionType;//数据加密方式
- char dataLength[2];//数据单元长度
- // unsigned char *data;//数据单元
- // unsigned char verifyCode;//校验码
- };
- struct CarcheckinData //车辆登入数据包格式 0x01
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- char checkinID[2];//登入号
- char ICCID[20];//sim卡iccid号
- unsigned char storageSysCount;//可充电储能系统数
- unsigned char storageSysEncodeLen;//可充电储能系统编码长度
- //string storageSysEncode[];//可充电储能系统编码
- };
- struct RealtimeInfo//实时数据上报 0x02
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- };
- struct CarData//整车数据
- {
- unsigned char head;//头
- unsigned char carstatus;//车辆状态
- unsigned char chargeStatus;//充电状态
- unsigned char runMode;//运行模式
- char carSpeed[2];//车速
- char carMileage[4];//累计里程
- char totalVoltage[2];//总电压
- char totalElectricity[2];//总电流
- unsigned char SOC;//SOC
- unsigned char DCDC;//DC-DC状态
- unsigned char gear;//档位
- char resistance[2];//绝缘电阻
- unsigned char accelerateMile;//加速踏板行程值
- unsigned char brakingMile;//制动踏板行程值
- };
- struct DriveMotorInfo//驱动电机数据
- {
- unsigned char head;//头
- unsigned char motorCount;//驱动电机个数
- unsigned char motorNum;//驱动电机序号
- unsigned char motorStatus;//驱动电机状态
- unsigned char motorControlTemperature;//驱动电机控制器温度
- char motorRevolveSpeed[2];//驱动电机转速
- char motorTorque[2];//驱动电机转矩
- unsigned char motorTemperature;//驱动电机温度
- char motorInputVoltage[2];//电机控制器输入电压
- char motorElectricity[2];//电机控制器直流母线电流
- };
- struct FuelCellInfo//燃料电池数据
- {
- unsigned char head;//头
- char fuelCellVoltage[2];//燃料电池电压
- char fuelCellElectricity[2];//燃料电池电流
- char fuelConsumptionRate[2];//燃料消耗率
- char fuelTemperatureNeedleCount[2];//燃料电池温度探针总数
- char needleTemperature[4];//探针温度值
- char hydrogenTemperature[2];//氢系统中最高温度
- unsigned char hydrogenTemperatureNum;//氢系统中最高温度探针代号
- char hydrogenConcentration[2];//氢气最高浓度
- unsigned char hydrogenConcentrationNum;//氢气最高浓度传感器代号
- char hydrogenPressure[2];//氢气最高压力
- unsigned char hydrogenPressureNum;//氢气最高压力传感器代号
- unsigned char DCDC;//高压DC-DC状态
- };
- struct EngineInfo//发动机数据
- {
- unsigned char head;//头
- unsigned char engineStatus;//发动机状态
- char bentAxleRevolveSpeed[2];//曲轴转速
- char fuelConsumptionRate[2];//燃料消耗率
- };
- struct LocationInfo//定位数据
- {
- unsigned char head;//头
- unsigned char localStatus;//定位状态
- char longtitude[4];//经度
- char latitude[4];//纬度
- };
- struct ExtremumInfo//极值数据
- {
- unsigned char highVoltageNum;//最高电压电池子系统号
- unsigned char highCellVoltageNum;//最高电池电压单体代号
- char highCellVoltage[2];//电池单体电压最高值
- unsigned char lowVoltageNum;//最低电压电池子系统代号
- unsigned char lowCellVoltageNum;//最低电压电池单体代号
- char lowCellVoltage[2];//电池单体电压最低值
- unsigned char highTemperatureNum;//最高温度子系统号
- unsigned char highNeedleTemNum;//最高温度探针序号
- unsigned char highTemperature;//最高温度值
- unsigned char lowTemperatureNum;//最低温度子系统号
- unsigned char lowNeedleTemNum;//最低温度探针序号
- unsigned char lowTemperature;//最低温度值
- };
- struct AlarmInfo//报警数据
- {
- unsigned char head;//头
- unsigned char highAlarmGrade;//最高报警等级
- char normalAlarm[4];//通用报警
- unsigned char chargeableDeviceCount;//可充电储能装置故障总数
- char chargeableDevice;//可充电储能装置故障代码列表
- unsigned char driveMotorCount;//驱动电机故障总数
- char driveMotor[4];//驱动电机故障代码列表
- unsigned char engineCount;//发动机故障总数
- char engine[4];//发动机故障列表
- unsigned char elseCount;//其他故障总数
- char elses[4];//其他故障代码列表
- };
- struct ChargeableDeviceVoltageInfo//可充电储能系统单体电压数据
- {
- unsigned char head;//头
- unsigned char chargeableDeviceCount;//可充电储能装置子系统个数
- unsigned char chargeableDeviceNum;//可充电储能装置子系统号
- char chargeableDeviceVoltage[2];//可充电储能装置电压
- char chargeableDeviceElectricity[2];//可充电储能装置电流
- char cellCount[2];//单体电池总数
- char beginCellNum[2];//本帧起始电池序号
- unsigned char beginCellCount;//本帧单体电池总数
- };
- struct ChargeableDeviceTemperatureInfo//可充电储能装置温度数据
- {
- unsigned char head;//头
- unsigned char chargeableDeviceCount;//可充电储能装置子系统个数
- unsigned char chargeableDeviceNum;//可充电储能装置子系统号
- char temperatureNeedleCount[2];//可充电储能温度探针个数
- char temperature[4];//可充电储能子系统温度探针温度值
- };
- struct CarcheckoutData //车辆登出数据包格式 0x04
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- char checkoutID[2];//登入号
- };
- struct CarStatus//车身状态 0x09
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char leftFrontdoor;//左前车门
- unsigned char rightFrontdoor;//右前车门
- unsigned char leftBackdoor;//左后车门
- unsigned char rightBackdoor;//右后车门
- unsigned char backTrunk;//后尾箱
- unsigned char leftFrontWindow;//左前车窗
- unsigned char rightFrontWindow;//右前车窗
- unsigned char leftBackWindow;//左后车窗
- unsigned char rightBackWindow;//右后车窗
- unsigned char skyWindow;//天窗
- unsigned char leftFrontLock;//左前车锁
- unsigned char rightFrontLock;//右前车锁
- unsigned char leftBackLock;//左后车锁
- unsigned char rightBackLock;//右后车锁
- unsigned char handBrake;//手刹
- unsigned char positionLight;//位置灯
- unsigned char nearLight;//近光灯
- unsigned char farLight;//远光灯
- unsigned char frontFogLight;//前雾灯
- unsigned char backFogLight;//后雾灯
- unsigned char airConditioner;//空调
- unsigned char block;//档位
- unsigned char key;//钥匙
- };
- struct DriveDataLow//驾驶行为数据 (低频) 0x0A
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char autoDriveMode;//自动驾驶模式
- unsigned char urgentStop;//急停开关状态
- unsigned char UCStatus;//UC工作状态
- unsigned char UCError;//UC故障状态
- unsigned char UCMode;//UC工作模式
- unsigned char UC2EPSRequest;//UC请求控制EPS请求位
- unsigned char UC2EPSMess;//UC请求控制EPS消息有效性
- unsigned char CDDAccelerate;//指示CDD加速度请求信号有效性
- unsigned char UCBlock;//UC请求档位
- unsigned char brakeSatus;//刹车踏板状态
- unsigned char leftStatus;//左转向状态
- unsigned char rightStatus;//右转向状态
- unsigned char UC2ACCStart;//指示UC是否有ACC起步请求
- unsigned char UC2ACCStandstill;//指示UC是否有ACC standstill 刹停请求
- };
- struct DriveDataHigh//驾驶行为数据 (高频) 0x0B
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char collectCycle;//数据采集周期
- char UC2EPSAngle[2];//UC请求控制EPS目标角度
- unsigned char UC2AEBDecelerate;//指示UC是否有AEB减速请求
- char carSpeed[2];//车速
- char engineRevolve[2];//发动机转速
- char accelerate[2];//实际加速度(减速度)
- unsigned char UC2Accelerator;//UC请求油门踏板开度
- };
- struct CarAlarm//车辆报警信息 0x0C
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char EPSStatus;//EPS状态
- unsigned char UCStatus;//UC工作状态
- unsigned char UCError;//UC故障状态
- unsigned char MCUStatus;//MCU工作状态反馈
- unsigned char BCMStatus;//BCM当前状态反馈
- unsigned char VCMStatus;//VCM工作状态反馈
- unsigned char EPS2ACCError;//指示ESP检测到ACC发出的信息是否有误
- };
- struct SensorConfig//传感器配置信息 0x0D
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char lidar64;//64线激光雷达
- unsigned char lidar16left;//左16线激光雷达
- unsigned char lidar16right;//右16线激光雷达
- unsigned char lidar4;//4线激光雷达
- unsigned char radarFront;//前毫米波雷达
- unsigned char radarBack;//后毫米波雷达
- unsigned char GPS;//GPS
- unsigned char camera;//摄像头
- };
- struct Multimedia//多媒体信息上报 0X0E
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- char multimediaID[4];//多媒体ID
- unsigned char multimediaType;//多媒体类型
- unsigned char multimediaEncode;//多媒体格式编码
- unsigned char eventEncode;//事件项编码
- unsigned char channelID;//通道ID
- char localzation[28];//位置信息上报
- char multimediaData[100];//多媒体数据包
- };
- struct V2XInfo//V2X 信息 0x0F
- {
- };
- struct ToPlatform//与云平台服务的上行消息 0x10
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char commID1;//上传信息ID
- unsigned char commInfo;//约车反馈
- };
- struct HumanIntervene//人工干预信息上报 0x11
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char humanInterType;//人工干预类型
- char humanInterTime[2];//人工干预转换时间
- };
- struct CarControl//车辆远程控制信息 0x83 下行
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char controlID1;//控制ID1
- unsigned char leftFrontdoor;//左前门控制
- unsigned char controlID2;//控制ID2
- unsigned char rightFrontdoor;//右前门控制
- unsigned char controlID3;//控制ID3
- unsigned char leftBackdoor;//左后门控制
- unsigned char controlID4;//控制ID4
- unsigned char rightBackdoor;//右后门控制
- unsigned char controlID5;//控制ID5
- unsigned char backTrunk;//后尾箱控制
- unsigned char controlID6;//控制ID6
- unsigned char leftFrontWindow;//左前窗控制
- unsigned char controlID7;//控制ID7
- unsigned char rightFrontWindow;//右前窗控制
- unsigned char controlID8;//控制ID8
- unsigned char leftBackWindow;//左后窗控制
- unsigned char controlID9;//控制ID9
- unsigned char rightBackWindow;//右后窗控制
- unsigned char controlID0A;//控制ID10
- unsigned char skyWindow;//天窗
- unsigned char controlID0B;//控制ID11
- unsigned char leftFrontLock;//左前车锁
- unsigned char controlID0C;//控制ID12
- unsigned char rightFrontLock;//右前车锁
- unsigned char controlID0D;//控制ID13
- unsigned char leftBackLock;//左后车锁
- unsigned char controlID0E;//控制ID14
- unsigned char rightBackLock;//右后车锁
- unsigned char controlID0F;//控制ID15
- unsigned char handBrake;//手刹
- unsigned char controlID10;//控制ID16
- unsigned char positionLight;//位置灯
- unsigned char controlID11;//控制ID17
- unsigned char nearLight;//近光灯
- unsigned char controlID12;//控制ID18
- unsigned char farLight;//远光灯
- unsigned char controlID13;//控制ID19
- unsigned char frontFogLight;//前雾灯
- unsigned char controlID14;//控制ID20
- unsigned char backFogLight;//后雾灯
- unsigned char controlID15;//控制ID21
- unsigned char airConditioner;//空调
- unsigned char controlID16;//控制ID22
- char speed[2];//速度设置
- unsigned char controlID17;//控制ID23
- unsigned char key;//钥匙
- };
- struct FarControl//远程遥控驾驶 0x84 下行
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char platMode;//云平台工作模式
- char CP2EPSAngle[2];//CP请求控制EPS目标角度
- char CP2Decelerate[2];//CP请求制动减速度值
- unsigned char CP2Accelerate;//CP请求油门开度
- unsigned char CP2Block;//CP请求档位信息
- };
- struct AppointmentDispatch//预约与远程调度 0x85 下行
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char appointYear;//年 预约时间
- unsigned char appointMonth;//月 预约时间
- unsigned char appointDay;//日 预约时间
- unsigned char appointHour;//时 预约时间
- unsigned char appointMinute;//分 预约时间
- unsigned char appointSecond;//秒 预约时间
- unsigned char humanCount;//预约人数
- unsigned char srcLocalStatus;//预约出发地定位状态
- char srcLocalLong[4];//预约出发地经度
- char srcLocalLat[4];//预约出发地纬度
- unsigned char desLocalStatus;//目的地定位状态
- char desLocalLong[4];//目的地定位经度
- char desLocalLat[4];//目的地定位纬度
- };
- struct RoutePlaning
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char lineID;
- char numName[5];
- char usename[3];
- char password[3];
- char address[6];
- char port[2];
- char filename1[7];
- char filename2[12];
- char URLAddress[16];
- char connectTime[2];
- };
- struct PlatformTo//与云平台服务的下行消息 0x88
- {
- unsigned char year;//年
- unsigned char month;//月
- unsigned char day;//日
- unsigned char hour;//时
- unsigned char minute;//分
- unsigned char second;//秒
- unsigned char infoID1;//下发信息ID
- unsigned char appointStart;//出发
- unsigned char infoID2;//下发信息ID
- unsigned char carStart;//车辆出发
- unsigned char infoID3;//下发信息ID
- unsigned char carStop;//停车
- unsigned char infoID4;//下发信息ID
- unsigned char backToGarage;//返回车库
- unsigned char infoID5;//下发信息ID
- unsigned char reAppoint;//重新预约
- unsigned char infoID6;//下发信息ID
- unsigned char keepGoing;//继续行程
- };
- struct station
- {
- double longtitude;
- double latitude;
- int ID;
- };
- }
- }
- #endif // DATAFORMAT_H
|