/**************************************************************************** * * 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 (2) //BMS制造商表示1-超力源,2-美顺 #define BMS_INFO (3) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺4830,2-2表示美顺6060 2-3表示美顺7250 #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1 #define EOLSTATE (1) //1表示下线检测跳过,使用默认值,0表示使用下线检测 #define DEFAULT_SN "RRRRRR0000000003" //默认上传的SN编码 #define APPSWVERSION 0x0300000B //数据模块软件版本号 #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 BCU_DATAINFO_FILE_NAME "qxBcuDataInfo.nvm" #define BATT_SN_LEN 17 #define BMS_OTHER_TEMP 2 #define WORK_TIME 5 #define SLEEP_TIME 60 #define ErrorNumLength 20 #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 reserved1; // UINT8 reserved2; //电池温度个数 UINT8 reserved3; //电池电压串数 UINT8 reserved4; UINT8 reserved5; UINT32 reserved6; UINT32 reserved7; UINT32 reserved8; //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 BattCellCount; //电池模组个数 UINT8 BattTempCount; //电池温度个数 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 BattForceLock; //电池强制锁定状态 UINT8 BattLock; //电池锁定状态 UINT8 BattStolenFlag; //电池被盗状态 UINT8 UserLock; // 用户锁锁定 UINT8 RentalLock; //租期锁锁定 UINT8 RentalType; //租期类型 UINT8 ExpiryTimeArray[6]; //超期时间 UINT8 ErrorMsg; }AppDataBody; typedef struct _AppAlgorithmType { BOOL appDataModify; //数据更改标志位 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; //充电前静置时间读取量; BOOL sohd_flg_chrgEndE; //充电结束标志位读取量; UINT16 sohv_V_chrgStartStatE[28]; //充电开始时刻的单体电压(数组)读取量; UINT16 sohd_Q_chrgE; //充入容量读取量; UINT16 sohv_Q_packCapArrE[10]; //10次整包容量(数组)读取量; UINT16 sohv_Q_cellCapArrE[28]; // }AppAlgorithmData; typedef struct _AppDataHeader { UINT16 fileBodySize; //file body size, not include size of header; UINT8 checkSum; }AppDataHeader; typedef struct _BCUDataHeader { UINT16 fileBodySize; //file body size, not include size of header; UINT8 checkSum; }BcuDataHeader; 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]; }GPSInfo; #endif