123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- /****************************************************************************
- *
- * Copy right: 2021-, Copyrigths of RLWL Ltd.Chen J
- * File name: AppConfig.h
- * Description: App Config H file 配置文件,可以针对不同参数进行更改
- * History: Rev3.0 2021-07-06
- *
- ****************************************************************************/
- #ifndef APPCONFIG_H
- #define APPCONFIG_H
- #define BMS_MANUFACTURE (3) //BMS制造商表示1-超力源,2-美顺,3-金茂卡车项目
- #define BMS_INFO (1) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455
- #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1
- #define EOLSTATE (0) //1表示下线检测跳过,使用默认值,0表示使用下线检测
- #define DEFAULT_SN "JMTEST00000000001" //默认上传的SN编码
- #define APPSWVERSION 0x0300000E //数据模块软件版本号
- #define TCP_ADD "iotp.fast-fun.cn" //数据上传的地址
- #define TCP_PORT 8712 //数据上传的端口
- #define NB_OTHER_TEMP_NUM (4) //NB采集的温度个数
- #define HWVERSION 0x0102 //硬件主版本,现为V1.2板
- #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0
- #define DRVSWVERSION 0x01050000 //驱动层版本号V1.4.0.0 驱动层1.5.0.0,增加了三轴
- #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
- #define APP_DATAINFO_FILE_NAME "qxappDataInfo3.nvm"
- #define BATT_SN_LEN 17
- #define BMS_OTHER_TEMP 2
- #define CELL_NUM 384
- #define CELL_TEMP_NUM 64
- #define BATT_IDLE_SYM 0x00 //静置
- #define BATT_CHARGE_SYM 0x02 //充电
- #define BATT_DISCHARGE_SYM 0x01 //放电
- #define BATT_MOVE_SYM 0x01 //移动
- #define BATT_NO_MOVE_SYM 0x00 //静止
- #define TCP_START_SYM1 0x23
- #define TCP_START_SYM2 0x23
- #define TCP_CMD_SYM 0x02 //实时信息上报是0x02
- #define TCP_HEART_SYM 0x07 //心跳包标志
- #define TCP_ANS_SYM 0xFE
- /*-------以下为下行指令定义区----------*/
- #define TCP_QUERY_SYM 0x80
- #define TCP_SETCMD_SYM 0x81
- #define TCP_CONCMD_SYM 0x82
- /*----------------end----------------*/
- //encrypt methord
- #define TCP_ENCPT_ENABLE 0x00
- #define TCP_ENCPT_DISABLE 0x01
- //message type mark 0x02上报数据单元定义区
- #define BATTMSG 0x80
- #define GPSMSG 0x82
- #define STATESMSG 0x85
- #define VERSIONMSG 0x86
- #define DEBUGMSG 0x8C
- //BMS升级区定义
- #define FLASH_BMS_FOTA_START_ADDR 0x2E6000 //BMS升级文件存储起始地址
- #define FLASH_BMS_FOTA_LEN 0x32000 //BMS升级文件存储长度 = =200k
- #define FLASH_BMS_FOTA_END_ADDR 0x318000 //BMS升级文件存储结束地址
- //declear struct vars 结构体变量定义
- typedef struct _AppConfigDataType
- {
- BOOL appDataModify; //数据更改标志位
- UINT8 battSN[BATT_SN_LEN]; //电池SN号码
- BOOL isBattLocked; //0:not locked; 1:locked
- UINT8 chargEndWorkTime; //
- UINT8 BattTempCount; //电池温度个数
- UINT16 BattCellCount; //电池电压串数
- UINT8 BmsHwVersion;
- UINT8 BmsSwVersion;
- UINT32 BLSwVersion;
- UINT32 DrvSwVersion;
- UINT32 AppSwVersion; //APP软件版本
- UINT8 EOLState;
- } AppConfigDataType;
- typedef struct _AppConfigDataHeader
- {
- UINT16 fileBodySize; //file body size, not include size of header;
- UINT8 checkSum;
- } AppConfigDataHeader;
- typedef struct _AppDataType
- {
- BOOL appDataModify; //数据更改标志位
- UINT8 BattInfoSendFreqHigh; //电池信息发送间隔高频,单位s
- UINT8 BattInfoSendFreqNomal; //电池信息发送间隔正常,单位s
- UINT8 BattInfoSendFreqLow; //电池信息发送间隔低频,单位s
- UINT8 PosInfoSendFreqHigh; //定位信息发送间隔高频,单位s
- UINT8 PosInfoSendFreqNormal; //定位信息发送间隔正常,单位s
- UINT8 PosInfoSendFreqLow; //定位信息发送间隔低频,单位s
- UINT32 AccMileage; //累计里程,单位m
- UINT16 SysReStartCount; //系统重启次数
- UINT8 RelayControl; //继电器控制
- UINT8 BattLock; //电池锁定状态
- UINT8 BattStolenFlag; //电池被盗状态
- UINT32 blcv_Q_totalCpE[28]; //累计均衡容量 读取量 数组最大28
- UINT16 blcv_Q_reqCpE[28]; //均衡需求容量 读取量 数组最大28
- UINT16 socd_pct_bcuSocE; //电池显示SOC 读取量;
- UINT16 socd_pct_battSocE; //电池真实SOC 读取量;
- UINT16 sohd_tm_chrgStartStatE; //充电前静置时间读取量;
- UINT8 sohd_flg_chrgEndE; //充电结束标志位读取量;
- UINT16 sohv_V_chrgStartStatE[28]; //充电开始时刻的单体电压(数组)读取量;
- UINT16 sohd_Q_chrgE; //充入容量读取量;
- UINT16 sohv_Q_packCapArrE[10]; //10次整包容量(数组)读取量;
- UINT8 VIN[17]; //电池SN号码
- } AppDataBody;
- typedef struct _AppDataHeader
- {
- UINT16 fileBodySize; //file body size, not include size of header;
- UINT8 checkSum;
- } AppDataHeader;
- typedef struct AppSocketConnectionContext_Tag
- {
- INT32 id;
- INT32 status;
- } AppSocketConnectionContext;
- typedef enum
- {
- IDLE = 0,
- WORK,
- LISTEN
- } process_app;
- typedef struct _GPSInfo
- {
- UINT8 locateMark;
- UINT8 satelliteNum;
- UINT8 direction[2];
- UINT8 speed[2];
- UINT8 altitude[2];
- UINT8 latitude[4];
- UINT8 longitude[4];
- UINT8 AccMileage[4];
- //若此处新增gps信息,需要同步修改tcp线程的定义
- } GPSInfo;
- #endif
|