|
@@ -2,7 +2,7 @@
|
|
|
*
|
|
|
* Copy right: RL.Chen J and Zhen C
|
|
|
* File name: AppFunc.c
|
|
|
- * Description: 搴旂敤灞傚嚱鏁拌皟鐢ㄦ枃浠�
|
|
|
+ * Description: 搴旂敤灞傚嚱鏁拌皟鐢ㄦ枃浠?
|
|
|
* History: 2021-03-15
|
|
|
*
|
|
|
****************************************************************************/
|
|
@@ -24,9 +24,9 @@ UINT8 bcc_chk(UINT8* data, UINT16 length)
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
* LED鎺у埗鍑芥暟
|
|
|
- * 杈撳叆锛氳繍琛岀姸鎬�
|
|
|
+ * 杈撳叆锛氳繍琛岀姸鎬?
|
|
|
* 杈撳嚭锛歀ED鎺у埗
|
|
|
- * 澶勭悊锛氭牴鎹�笉鍚岀姸鎬佽繘琛孡ED鏄剧ず
|
|
|
+ * 澶勭悊锛氭牴鎹?涓嶅悓鐘舵€佽繘琛孡ED鏄剧ず
|
|
|
***********************************************************************************************************************/
|
|
|
void LEDDisplay(void)
|
|
|
{
|
|
@@ -41,7 +41,7 @@ void LEDDisplay(void)
|
|
|
#ifdef USING_PRINTF1
|
|
|
printf("[%d]-%d-%d-%d\n",__LINE__,LightTimer,ErrorLightTimer,battSoc);
|
|
|
#endif
|
|
|
- if(AppDataInfo.BattLock==TRUE)//鐢垫睜鏁村�浜庨攣瀹氱姸鎬�
|
|
|
+ if(AppDataInfo.BattLock==TRUE)//鐢垫睜鏁村?勪簬閿佸畾鐘舵€?
|
|
|
{
|
|
|
if(LightTimer<(UINT8)(LEDFlashPeriod*DutyRatio))
|
|
|
{
|
|
@@ -71,7 +71,7 @@ void LEDDisplay(void)
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- else //鐢垫睜鏈��浜庨攣瀹氱姸鎬�
|
|
|
+ else //鐢垫睜鏈?澶勪簬閿佸畾鐘舵€?
|
|
|
{
|
|
|
if(currentState!=AppDataInfo.BattLock)
|
|
|
{
|
|
@@ -144,8 +144,8 @@ void LEDDisplay(void)
|
|
|
/***********************************************************************************************************************
|
|
|
* BMS鏁呴殰瑙g爜鍑芥暟
|
|
|
* 杈撳叆锛欱MS鏁呴殰缂栫爜
|
|
|
- * 杈撳嚭锛氱姸鎬佸弬鏁�
|
|
|
- * 澶勭悊锛氬皢BMS鏁呴殰缂栫爜渚濇�瑙d负鏍囧噯鏁呴殰鐮�
|
|
|
+ * 杈撳嚭锛氱姸鎬佸弬鏁?
|
|
|
+ * 澶勭悊锛氬皢BMS鏁呴殰缂栫爜渚濇?¤В涓烘爣鍑嗘晠闅滅爜
|
|
|
***********************************************************************************************************************/
|
|
|
static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
@@ -164,7 +164,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 7;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄧ數鑺�繃鏀惧憡璀︽晠闅滐紒锛乗n";鍗曚綋鐢靛帇杩囦綆
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄧ數鑺?杩囨斁鍛婅?︽晠闅滐紒锛乗n";鍗曚綋鐢靛帇杩囦綆
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 1) & 0x01) == 1 ;
|
|
@@ -172,7 +172,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 10;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄦ€荤數鍘嬭繃鏀惧憡璀︽晠闅滐紒锛乗n";鎬荤數鍘嬭繃浣�
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄦ€荤數鍘嬭繃鏀惧憡璀︽晠闅滐紒锛乗n";鎬荤數鍘嬭繃浣?
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 2) & 0x01) == 1 ;
|
|
@@ -180,7 +180,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 8;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄧ數鑺�繃鍘嬪憡璀︽晠闅滐紒锛乗n";
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄧ數鑺?杩囧帇鍛婅?︽晠闅滐紒锛乗n";
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 3) & 0x01) == 1 ;
|
|
@@ -248,7 +248,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 3;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦∕OS楂樻俯鍛婅�鏁呴殰锛侊紒\n";
|
|
|
+ //str += "ERROR锛氬瓨鍦∕OS楂樻俯鍛婅?︽晠闅滐紒锛乗n";
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 16) & 0x01) == 1;
|
|
@@ -256,7 +256,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 18;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄦ俯搴﹂噰闆嗗け鏁�/浼犳劅鍣ㄦ晠闅滐紒锛乗n";
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄦ俯搴﹂噰闆嗗け鏁?/浼犳劅鍣ㄦ晠闅滐紒锛乗n";
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 17) & 0x01) == 1;
|
|
@@ -264,7 +264,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 19;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄧ數鍘嬮噰闆嗗け鏁�/鏂�嚎鏁呴殰锛侊紒\n";
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄧ數鍘嬮噰闆嗗け鏁?/鏂?绾挎晠闅滐紒锛乗n";
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 18) & 0x01) == 1;
|
|
@@ -288,7 +288,7 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
{
|
|
|
ErrorNumTemp = 22;
|
|
|
PutErrorNum((UINT16 *)ErrorNum,sizeof(ErrorNum),ErrorNumTemp);
|
|
|
- //str += "ERROR锛氬瓨鍦ㄧ數鑺�笉鍧囪 鍛婅�锛侊紒\n";
|
|
|
+ //str += "ERROR锛氬瓨鍦ㄧ數鑺?涓嶅潎琛″憡璀︼紒锛乗n";
|
|
|
}
|
|
|
|
|
|
ret = ((battWarningState >> 22) & 0x01) == 1;
|
|
@@ -318,10 +318,10 @@ static UINT8 BmsErrorDecode(UINT32 battWarningState)
|
|
|
return 1;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 鑾峰彇鏁呴殰鐮佸嚱鏁�
|
|
|
+ * 鑾峰彇鏁呴殰鐮佸嚱鏁?
|
|
|
* 杈撳叆锛氭晠闅滄暟缁勫拰闀垮害
|
|
|
- * 杈撳嚭锛氭晠闅滀唬鐮�
|
|
|
- * 澶勭悊锛氫粠鏁呴殰鏁扮粍涓�幏鍙栨晠闅滅爜锛屽苟灏嗕箣鍓嶇殑鏁呴殰鐮佸悜鍓嶇Щ鍔�
|
|
|
+ * 杈撳嚭锛氭晠闅滀唬鐮?
|
|
|
+ * 澶勭悊锛氫粠鏁呴殰鏁扮粍涓?鑾峰彇鏁呴殰鐮侊紝骞跺皢涔嬪墠鐨勬晠闅滅爜鍚戝墠绉诲姩
|
|
|
***********************************************************************************************************************/
|
|
|
UINT16 GetErrorNum(UINT16 *ErrorArray,UINT8 Errorlen)
|
|
|
{
|
|
@@ -336,10 +336,10 @@ UINT16 GetErrorNum(UINT16 *ErrorArray,UINT8 Errorlen)
|
|
|
return OutNum;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 鏁呴殰鐮佹敞鍏ュ嚱鏁�
|
|
|
+ * 鏁呴殰鐮佹敞鍏ュ嚱鏁?
|
|
|
* 杈撳叆锛氭晠闅滄暟缁勶紝鏁呴殰闀垮害锛屾晠闅滅爜
|
|
|
- * 杈撳嚭锛氱姸鎬�
|
|
|
- * 澶勭悊锛氬皢鏁呴殰鐮佸啓鍏ュ埌鏁呴殰鏁扮粍涓�紝濡傛灉瀛樺湪鍒欎笉鍐欏叆锛屽�鏋滃瓨鍦ㄥ垯涓嶅啓鍏�
|
|
|
+ * 杈撳嚭锛氱姸鎬?
|
|
|
+ * 澶勭悊锛氬皢鏁呴殰鐮佸啓鍏ュ埌鏁呴殰鏁扮粍涓?锛屽?傛灉瀛樺湪鍒欎笉鍐欏叆锛屽?傛灉瀛樺湪鍒欎笉鍐欏叆
|
|
|
***********************************************************************************************************************/
|
|
|
UINT8 PutErrorNum(UINT16 *ErrorArray,UINT8 Errorlen,UINT16 ErrorNum)
|
|
|
{
|
|
@@ -365,10 +365,10 @@ UINT8 PutErrorNum(UINT16 *ErrorArray,UINT8 Errorlen,UINT16 ErrorNum)
|
|
|
return 2;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 杩愯�鏁版嵁淇濆瓨鍑芥暟
|
|
|
+ * 杩愯?屾暟鎹?淇濆瓨鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢杩愯�鏁版嵁杩涜�淇濆瓨
|
|
|
+ * 澶勭悊锛氬皢杩愯?屾暟鎹?杩涜?屼繚瀛?
|
|
|
***********************************************************************************************************************/
|
|
|
void SaveAppData(void)
|
|
|
{
|
|
@@ -414,10 +414,10 @@ void SaveAppData(void)
|
|
|
return;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 杩愯�鏁版嵁鍔犺浇鍑芥暟
|
|
|
+ * 杩愯?屾暟鎹?鍔犺浇鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢杩愯�鏁版嵁杩涜�鍔犺浇锛岃嫢鏂板�浜嗘暟鎹�」锛屽垯淇濇寔鍓嶉潰鏁版嵁椤逛笉鍔�
|
|
|
+ * 澶勭悊锛氬皢杩愯?屾暟鎹?杩涜?屽姞杞斤紝鑻ユ柊澧炰簡鏁版嵁椤癸紝鍒欎繚鎸佸墠闈㈡暟鎹?椤逛笉鍔?
|
|
|
***********************************************************************************************************************/
|
|
|
void LoadAppData(void)
|
|
|
{
|
|
@@ -452,7 +452,7 @@ void LoadAppData(void)
|
|
|
SaveAppData();
|
|
|
return;
|
|
|
}
|
|
|
- if(AppDataHr.fileBodySize==sizeof(AppDataInfo))//缁撴瀯浣撴暟鎹�病鍙樺姩锛屽彲鐩存帴璇诲嚭
|
|
|
+ if(AppDataHr.fileBodySize==sizeof(AppDataInfo))//缁撴瀯浣撴暟鎹?娌″彉鍔?锛屽彲鐩存帴璇诲嚭
|
|
|
{
|
|
|
readCount = OsaFread(pReadAppConfig, AppDataHr.fileBodySize, 1, fp);
|
|
|
//crcCheck = OsaCalcCrcValue((UINT8 *)pReadAppConfig, sizeof(AppNVMData));
|
|
@@ -488,7 +488,7 @@ void LoadAppData(void)
|
|
|
* 閰嶇疆鏂囦欢淇濆瓨鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜�淇濆瓨
|
|
|
+ * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜?屼繚瀛?
|
|
|
***********************************************************************************************************************/
|
|
|
void SaveAppConfig(void)
|
|
|
{
|
|
@@ -546,7 +546,7 @@ void SaveAppConfig(void)
|
|
|
* 閰嶇疆鏂囦欢鍔犺浇鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜�鍔犺浇
|
|
|
+ * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜?屽姞杞?
|
|
|
***********************************************************************************************************************/
|
|
|
void LoadAppConfig(void)
|
|
|
{
|
|
@@ -629,38 +629,38 @@ void LoadAppConfig(void)
|
|
|
return;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 閰嶇疆鏂囦欢鍒濆�鍖栧嚱鏁�
|
|
|
+ * 閰嶇疆鏂囦欢鍒濆?嬪寲鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜�鍒濆�鍖�
|
|
|
- * 娉ㄦ剰锛氶厤缃�暟鎹�笉澧炲姞鏁版嵁椤癸紝鑻ュ�鍔犳暟鎹�」锛岄渶瑕佷慨鏀瑰姞杞藉嚱鏁�
|
|
|
+ * 澶勭悊锛氬皢鍏ㄥ眬閰嶇疆鏂囦欢杩涜?屽垵濮嬪寲
|
|
|
+ * 娉ㄦ剰锛氶厤缃?鏁版嵁涓嶅?炲姞鏁版嵁椤癸紝鑻ュ?炲姞鏁版嵁椤癸紝闇€瑕佷慨鏀瑰姞杞藉嚱鏁?
|
|
|
***********************************************************************************************************************/
|
|
|
static void setDefaultAppConfigData(void)
|
|
|
{
|
|
|
UINT8 i = 0;
|
|
|
memset(&AppNVMData, 0x00, sizeof(AppConfigDataType));
|
|
|
- AppNVMData.appDataModify = TRUE; //鏁版嵁鏇存敼鏍囧織浣�
|
|
|
+ AppNVMData.appDataModify = TRUE; //鏁版嵁鏇存敼鏍囧織浣?
|
|
|
// char sn[BATT_SN_LEN];
|
|
|
// appGetSNNumSync(sn);
|
|
|
memcpy(AppNVMData.battSN,DEFAULT_SN,BATT_SN_LEN);
|
|
|
AppNVMData.isBattLocked = 0; //0:not locked; 1:locked
|
|
|
AppNVMData.chargEndWorkTime = 30; //
|
|
|
- AppNVMData.BattTempCount = 5; //鐢垫睜娓╁害涓�暟
|
|
|
+ AppNVMData.BattTempCount = 5; //鐢垫睜娓╁害涓?鏁?
|
|
|
AppNVMData.BattCellCount = 17; //鐢垫睜鐢靛帇涓叉暟
|
|
|
AppNVMData.BmsHwVersion = 0;
|
|
|
AppNVMData.BmsSwVersion = 0;
|
|
|
AppNVMData.BLSwVersion = BLSWVERSION;
|
|
|
AppNVMData.DrvSwVersion = DRVSWVERSION;
|
|
|
- AppNVMData.AppSwVersion = APPSWVERSION; //APP杞�欢鐗堟湰
|
|
|
+ AppNVMData.AppSwVersion = APPSWVERSION; //APP杞?浠剁増鏈?
|
|
|
AppNVMData.EOLState = EOLSTATE;
|
|
|
return;
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
- * 杩愯�鏁版嵁鍒濆�鍖栧嚱鏁�
|
|
|
+ * 杩愯?屾暟鎹?鍒濆?嬪寲鍑芥暟
|
|
|
* 杈撳叆锛氱┖
|
|
|
* 杈撳嚭锛氱┖
|
|
|
- * 澶勭悊锛氬皢杩愯�鏁版嵁杩涜�鍒濆�鍖�
|
|
|
- * 娉�細姣忓�鍔犱竴椤规暟鎹�」锛岄渶瑕佸�鍔犻粯璁ゅ€�
|
|
|
+ * 澶勭悊锛氬皢杩愯?屾暟鎹?杩涜?屽垵濮嬪寲
|
|
|
+ * 娉?锛氭瘡澧炲姞涓€椤规暟鎹?椤癸紝闇€瑕佸?炲姞榛樿?ゅ€?
|
|
|
***********************************************************************************************************************/
|
|
|
static void setDefaultAppDataInfo(void)
|
|
|
{
|
|
@@ -691,9 +691,9 @@ static void setDefaultAppDataInfo(void)
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
* Fota鍗囩骇澶勭悊鍑芥暟
|
|
|
- * 杈撳叆锛氱綉缁滄帴鏀剁殑鏁版嵁锛岀綉缁滈摼鎺�D
|
|
|
- * 杈撳嚭锛�0x00琛ㄧず鏁版嵁鏈�噯澶囧畬鎴愶紝0x01琛ㄧず鏁版嵁妯″潡OTA鏁版嵁鍑嗗�瀹屾垚锛�0x88琛ㄧずBMS鐨凮TA鏁版嵁鍑嗗�瀹屾垚
|
|
|
- * 澶勭悊锛氬皢鎺ユ敹鐨勬暟鎹�繘琛屾牎楠岋紝鎼�繍鑷冲崌绾у尯鍩燂紝骞惰繘琛屽簲绛�
|
|
|
+ * 杈撳叆锛氱綉缁滄帴鏀剁殑鏁版嵁锛岀綉缁滈摼鎺?ID
|
|
|
+ * 杈撳嚭锛?0x00琛ㄧず鏁版嵁鏈?鍑嗗?囧畬鎴愶紝0x01琛ㄧず鏁版嵁妯″潡OTA鏁版嵁鍑嗗?囧畬鎴愶紝0x88琛ㄧずBMS鐨凮TA鏁版嵁鍑嗗?囧畬鎴?
|
|
|
+ * 澶勭悊锛氬皢鎺ユ敹鐨勬暟鎹?杩涜?屾牎楠岋紝鎼?杩愯嚦鍗囩骇鍖哄煙锛屽苟杩涜?屽簲绛?
|
|
|
***********************************************************************************************************************/
|
|
|
void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
{
|
|
@@ -972,10 +972,10 @@ static UINT8 Fota_crc_chk(UINT8* data,UINT8 length)
|
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
- * 鍛ㄦ湡鎬ф姤鏂囨媶鍖�
|
|
|
+ * 鍛ㄦ湡鎬ф姤鏂囨媶鍖?
|
|
|
* 杈撳叆锛氭姤鏂嘔D銆乧an鎶ユ枃鏁版嵁锛堟寚閽堬級
|
|
|
- * 杈撳嚭锛�--
|
|
|
- * 澶勭悊锛氭牴鎹�笉鍚岀殑ID锛屽皢鏁版嵁杩涜�鎷嗗寘锛屽苟鏀剧疆鍒扮浉搴旂殑鍙橀噺涓�
|
|
|
+ * 杈撳嚭锛?--
|
|
|
+ * 澶勭悊锛氭牴鎹?涓嶅悓鐨処D锛屽皢鏁版嵁杩涜?屾媶鍖咃紝骞舵斁缃?鍒扮浉搴旂殑鍙橀噺涓?
|
|
|
***********************************************************************************************************************/
|
|
|
void DecodeFunction(UINT32 ID,UINT8* rawData)
|
|
|
{
|
|
@@ -1841,7 +1841,7 @@ void DecodeFunction(UINT32 ID,UINT8* rawData)
|
|
|
backBreakingPressureErrorStatus = (UINT8)(((*(UINT8*)(rawData +6))>>2)&0x3);
|
|
|
break;
|
|
|
case 0x18FEC117:
|
|
|
- ODB = (UINT32)(((*(UINT32*)(rawData +0)))&0xFFFFFFFF);
|
|
|
+ ODO = (UINT32)(((*(UINT32*)(rawData +0)))&0xFFFFFFFF);
|
|
|
break;
|
|
|
case 0x18FF15A0:
|
|
|
dcdcErrorClass = (UINT8)(((*(UINT8*)(rawData +5)))&0x7);
|
|
@@ -3315,10 +3315,10 @@ void DecodeFunction(UINT32 ID,UINT8* rawData)
|
|
|
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
- * 鍛ㄦ湡鎬ф姤鏂囪瘖鏂�
|
|
|
+ * 鍛ㄦ湡鎬ф姤鏂囪瘖鏂?
|
|
|
* 杈撳叆锛氭姤鏂嘔D
|
|
|
- * 杈撳嚭锛�--
|
|
|
- * 澶勭悊锛氬懆鏈熸€ц瘖鏂瑿AN鎶ユ枃鏄�惁涓㈠け
|
|
|
+ * 杈撳嚭锛?--
|
|
|
+ * 澶勭悊锛氬懆鏈熸€ц瘖鏂瑿AN鎶ユ枃鏄?鍚︿涪澶?
|
|
|
***********************************************************************************************************************/
|
|
|
void canRxDaignose(void)
|
|
|
{
|
|
@@ -3391,8 +3391,8 @@ void canRxDaignose(void)
|
|
|
/***********************************************************************************************************************
|
|
|
* 鎶ユ枃搴忓彿鏌ユ壘
|
|
|
* 杈撳叆锛氭姤鏂嘔D
|
|
|
- * 杈撳嚭锛氭姤鏂嘔D鍦–OMInTable涓�殑搴忓彿
|
|
|
- * 澶勭悊锛�--
|
|
|
+ * 杈撳嚭锛氭姤鏂嘔D鍦–OMInTable涓?鐨勫簭鍙?
|
|
|
+ * 澶勭悊锛?--
|
|
|
***********************************************************************************************************************/
|
|
|
UINT8 canCOMInTableIndexFind(UINT32 canID)
|
|
|
{
|
|
@@ -3409,10 +3409,10 @@ UINT8 canCOMInTableIndexFind(UINT32 canID)
|
|
|
}
|
|
|
|
|
|
/***********************************************************************************************************************
|
|
|
- * 鎶ユ枃闀挎椂涓㈠抚锛屾暟鎹�疆涓烘棤鏁堝€�
|
|
|
+ * 鎶ユ枃闀挎椂涓㈠抚锛屾暟鎹?缃?涓烘棤鏁堝€?
|
|
|
* 杈撳叆锛氭姤鏂嘔D
|
|
|
- * 杈撳嚭锛�--
|
|
|
- * 澶勭悊锛氭姤鏂囬暱鏃朵涪甯у悗锛屽�搴旂殑ID鐨勪俊鍙峰€间负鏃犳晥鍊�
|
|
|
+ * 杈撳嚭锛?--
|
|
|
+ * 澶勭悊锛氭姤鏂囬暱鏃朵涪甯у悗锛屽?瑰簲鐨処D鐨勪俊鍙峰€间负鏃犳晥鍊?
|
|
|
***********************************************************************************************************************/
|
|
|
void canRxMsgSetInvalidValue(UINT32 ID)
|
|
|
{
|
|
@@ -4267,7 +4267,7 @@ void canRxMsgSetInvalidValue(UINT32 ID)
|
|
|
backBreakingPressureErrorStatus = (UINT8)(((*(UINT8*)(rawData +6))>>2)&0x3);
|
|
|
break;
|
|
|
case 0x18FEC117:
|
|
|
- ODB = (UINT32)(((*(UINT32*)(rawData +0)))&0xFFFFFFFF);
|
|
|
+ ODO = (UINT32)(((*(UINT32*)(rawData +0)))&0xFFFFFFFF);
|
|
|
break;
|
|
|
case 0x18FF15A0:
|
|
|
dcdcErrorClass = (UINT8)(((*(UINT8*)(rawData +5)))&0x7);
|
|
@@ -4297,56 +4297,56 @@ void TcpDataAssemble(UINT8 Tcptype,UINT8 *SendBuffer,UTC8TimeType UTC8TimeTcp)
|
|
|
*(SendBuffer + 2 ) = TCP_CMD_SYM;
|
|
|
*(SendBuffer + 3 ) = TCP_ANS_SYM;
|
|
|
memcpy(SendBuffer + 4,AppNVMData.battSN,BATT_SN_LEN);
|
|
|
- *(SendBuffer+0x15) = ((TCP_ENCPT_DISABLE>>8)&0xFF); //uint16 TCP_ENCPT_DISABLE
|
|
|
- *(SendBuffer+0x16) = (TCP_ENCPT_DISABLE&0xFF);
|
|
|
+ *(SendBuffer+0x15) = (TCP_ENCPT_DISABLE&0xFF); //uint8 TCP_ENCPT_DISABLE
|
|
|
UINT16 DataLen =0x3D ;
|
|
|
- *(SendBuffer+0x17) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
- *(SendBuffer+0x18) = (DataLen&0xFF);
|
|
|
- *(SendBuffer+0x19) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x1A) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x1B) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x1C) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x1D) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x1E) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- *(SendBuffer+0x1F) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
- *(SendBuffer+0x20) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x21) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x22) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x23) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x24) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x25) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- memcpy(SendBuffer+0x26,VIN,17);
|
|
|
- *(SendBuffer+0x37) = (vehicleStatus&0xFF); //uint8 鏁磋溅鐘舵€�
|
|
|
- *(SendBuffer+0x38) = (bmsHVOn&0xFF); //uint8 BMS涓婇珮鍘嬫寚浠�
|
|
|
- *(SendBuffer+0x39) = (currentGearPosition&0xFF); //uint8 褰撳墠鎸′綅
|
|
|
- *(SendBuffer+0x3A) = (parkingBreakStatus&0xFF); //uint8 鎵嬪埞淇″彿
|
|
|
- *(SendBuffer+0x3B) = (breakingStatus&0xFF); //uint8 鍒跺姩寮€鍏�
|
|
|
- *(SendBuffer+0x3C) = ((ODB>>24)&0xFF); //uint32 鎬婚噷绋�
|
|
|
- *(SendBuffer+0x3D) = ((ODB>>16)&0xFF);
|
|
|
- *(SendBuffer+0x3E) = ((ODB>>8)&0xFF);
|
|
|
- *(SendBuffer+0x3F) = (ODB&0xFF);
|
|
|
- *(SendBuffer+0x40) = (dcdcWorkStatus&0xFF); //uint8 DCDC鐘舵€�
|
|
|
- *(SendBuffer+0x41) = (numOfChrgableSubsys&0xFF); //uint8 鍙�厖鐢靛瓙绯荤粺鏁�
|
|
|
- *(SendBuffer+0x42) = (chrgableSubsysCode&0xFF); //uint8 鍙�厖鐢靛偍鑳藉瓙绯荤粺鍙�
|
|
|
- *(SendBuffer+0x43) = (maxTempSubsysCode&0xFF); //uint8 鏈€楂樻俯搴﹀瓙绯荤粺鍙�
|
|
|
- *(SendBuffer+0x44) = (maxTempCellCode&0xFF); //uint8 鏈€楂樻俯搴︽帰閽堝崟浣撲唬鍙�
|
|
|
- *(SendBuffer+0x45) = (minTempSubsysCode&0xFF); //uint8 鏈€浣庢俯搴﹀瓙绯荤粺鍙�
|
|
|
- *(SendBuffer+0x46) = (minTempCellCode&0xFF); //uint8 鏈€浣庢俯搴︽帰閽堝瓙绯荤粺浠e彿
|
|
|
- *(SendBuffer+0x47) = (maxVolSubsysCode&0xFF); //uint8 鏈€楂樼數鍘嬬數姹犲瓙绯荤粺鍙�
|
|
|
- *(SendBuffer+0x48) = ((maxVolCellCode>>8)&0xFF); //uint16 鏈€楂樼數鍘嬬數姹犲崟浣撲唬鍙�
|
|
|
- *(SendBuffer+0x49) = (maxVolCellCode&0xFF);
|
|
|
- *(SendBuffer+0x4A) = (minVolSubsysCode&0xFF); //uint8 鏈€浣庣數鍘嬬數姹犲瓙绯荤粺鍙�
|
|
|
- *(SendBuffer+0x4B) = ((minVoCelllCode>>8)&0xFF); //uint16 鏈€浣庣數鍘嬬數姹犲崟浣撲唬鍙�
|
|
|
- *(SendBuffer+0x4C) = (minVoCelllCode&0xFF);
|
|
|
- *(SendBuffer+0x4D) = (ebcStatus&0xFF); //uint8 鎹㈢數鎺у埗鍣ㄧ姸鎬�
|
|
|
- *(SendBuffer+0x4E) = (ebcAskHVOn&0xFF); //uint8 绂佹�楂樺帇涓婄數
|
|
|
- *(SendBuffer+0x4F) = (ebcAskHVOff&0xFF); //uint8 璇锋眰楂樺帇涓嬬數
|
|
|
- *(SendBuffer+0x50) = (retainLockSignal&0xFF); //uint8 閿佺揣鏈烘瀯閿佹�淇″彿
|
|
|
- *(SendBuffer+0x51) = (dischargeLockSignal&0xFF); //uint8 鏀剧數浜掗攣淇″彿
|
|
|
- *(SendBuffer+0x52) = (chargeLockSignal&0xFF); //uint8 鍏呯數浜掗攣淇″彿
|
|
|
- *(SendBuffer+0x53) = (chargeFlag&0xFF); //uint8 鍏呯數鏍囧織浣�
|
|
|
- *(SendBuffer+0x54) = ((vcuDCVol>>8)&0xFF); //uint16 鐢垫満鎺у埗鍣ㄧ洿娴佹瘝绾跨數鍘�
|
|
|
- *(SendBuffer+0x55) = (vcuDCVol&0xFF);
|
|
|
+ *(SendBuffer+0x16) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
+ *(SendBuffer+0x17) = (DataLen&0xFF);
|
|
|
+ *(SendBuffer+0x18) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x19) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x1A) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x1B) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x1C) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x1D) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ *(SendBuffer+0x1E) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
+ *(SendBuffer+0x1F) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x20) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x21) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x22) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x23) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x24) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ memcpy(SendBuffer+0x25,VIN,17);
|
|
|
+ *(SendBuffer+0x36) = (vehicleStatus&0xFF); //uint8 整车状态
|
|
|
+ *(SendBuffer+0x37) = (bmsHVOn&0xFF); //uint8 BMS上高压指令
|
|
|
+ *(SendBuffer+0x38) = (currentGearPosition&0xFF); //uint8 当前挡位
|
|
|
+ *(SendBuffer+0x39) = (parkingBreakStatus&0xFF); //uint8 手刹信号
|
|
|
+ *(SendBuffer+0x3A) = (breakingStatus&0xFF); //uint8 制动开关
|
|
|
+ *(SendBuffer+0x3B) = ((ODO>>24)&0xFF); //uint32 总里程
|
|
|
+ *(SendBuffer+0x3C) = ((ODO>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x3D) = ((ODO>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x3E) = (ODO&0xFF);
|
|
|
+ *(SendBuffer+0x3F) = (dcdcWorkStatus&0xFF); //uint8 DCDC状态
|
|
|
+ *(SendBuffer+0x40) = (numOfChrgableSubsys&0xFF); //uint8 可充电子系统数
|
|
|
+ *(SendBuffer+0x41) = (chrgableSubsysCode&0xFF); //uint8 可充电储能子系统号
|
|
|
+ *(SendBuffer+0x42) = (maxTempSubsysCode&0xFF); //uint8 最高温度子系统号
|
|
|
+ *(SendBuffer+0x43) = (maxTempCellCode&0xFF); //uint8 最高温度探针单体代号
|
|
|
+ *(SendBuffer+0x44) = (minTempSubsysCode&0xFF); //uint8 最低温度子系统号
|
|
|
+ *(SendBuffer+0x45) = (minTempCellCode&0xFF); //uint8 最低温度探针子系统代号
|
|
|
+ *(SendBuffer+0x46) = (maxVolSubsysCode&0xFF); //uint8 最高电压电池子系统号
|
|
|
+ *(SendBuffer+0x47) = ((maxVolCellCode>>8)&0xFF); //uint16 最高电压电池单体代号
|
|
|
+ *(SendBuffer+0x48) = (maxVolCellCode&0xFF);
|
|
|
+ *(SendBuffer+0x49) = (minVolSubsysCode&0xFF); //uint8 最低电压电池子系统号
|
|
|
+ *(SendBuffer+0x4A) = ((minVoCelllCode>>8)&0xFF); //uint16 最低电压电池单体代号
|
|
|
+ *(SendBuffer+0x4B) = (minVoCelllCode&0xFF);
|
|
|
+ *(SendBuffer+0x4C) = (ebcStatus&0xFF); //uint8 换电控制器状态
|
|
|
+ *(SendBuffer+0x4D) = (ebcAskHVOn&0xFF); //uint8 禁止高压上电
|
|
|
+ *(SendBuffer+0x4E) = (ebcAskHVOff&0xFF); //uint8 请求高压下电
|
|
|
+ *(SendBuffer+0x4F) = (retainLockSignal&0xFF); //uint8 锁紧机构锁止信号
|
|
|
+ *(SendBuffer+0x50) = (dischargeLockSignal&0xFF); //uint8 放电互锁信号
|
|
|
+ *(SendBuffer+0x51) = (chargeLockSignal&0xFF); //uint8 充电互锁信号
|
|
|
+ *(SendBuffer+0x52) = (chargeFlag&0xFF); //uint8 充电标志位
|
|
|
+ *(SendBuffer+0x53) = ((vcuDCVol>>8)&0xFF); //uint16 电机控制器直流母线电压
|
|
|
+ *(SendBuffer+0x54) = (vcuDCVol&0xFF);
|
|
|
+ *(SendBuffer+0x55) = bcc_chk(SendBuffer,0x54);
|
|
|
break;
|
|
|
}
|
|
|
case 0x91:
|
|
@@ -4357,76 +4357,76 @@ void TcpDataAssemble(UINT8 Tcptype,UINT8 *SendBuffer,UTC8TimeType UTC8TimeTcp)
|
|
|
*(SendBuffer + 2 ) = TCP_CMD_SYM;
|
|
|
*(SendBuffer + 3 ) = TCP_ANS_SYM;
|
|
|
memcpy(SendBuffer + 4,AppNVMData.battSN,BATT_SN_LEN);
|
|
|
- *(SendBuffer+0x15) = ((TCP_ENCPT_DISABLE>>8)&0xFF); //uint16 TCP_ENCPT_DISABLE
|
|
|
- *(SendBuffer+0x16) = (TCP_ENCPT_DISABLE&0xFF);
|
|
|
- UINT16 DataLen =0x3A + numOfCells*2 + numOfCellTemp ;
|
|
|
- *(SendBuffer+0x17) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
- *(SendBuffer+0x18) = (DataLen&0xFF);
|
|
|
- *(SendBuffer+0x19) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x1A) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x1B) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x1C) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x1D) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x1E) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- *(SendBuffer+0x1F) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
- *(SendBuffer+0x20) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x21) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x22) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x23) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x24) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x25) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- *(SendBuffer+0x26) = (csq&0xFF); //uint8 csq
|
|
|
- *(SendBuffer+0x27) = (bmsStatus&0xFF); //uint8 BMS鐘舵€�
|
|
|
- *(SendBuffer+0x28) = (chrgConctStatus&0xFF); //uint8 鍏呯數杩炴帴鐘舵€�
|
|
|
- *(SendBuffer+0x29) = (bmsErrClass&0xFF); //uint8 BMS鏁呴殰绛夌骇
|
|
|
- *(SendBuffer+0x2A) = (bmsErrNum&0xFF); //uint8 BMS鏁呴殰鐮�
|
|
|
- *(SendBuffer+0x2B) = (highVolPwrDwnReq&0xFF); //uint8 涓嬮珮鍘嬭�姹�
|
|
|
- *(SendBuffer+0x2C) = (chrgStatus&0xFF); //uint8 鍏呯數鐘舵€�
|
|
|
- *(SendBuffer+0x2D) = (battSoc&0xFF); //uint8 SOC
|
|
|
- *(SendBuffer+0x2E) = (battSOH&0xFF); //uint8 鐢垫睜SOH
|
|
|
- *(SendBuffer+0x2F) = ((packTotalVol>>8)&0xFF); //uint16 鐢垫睜鎬荤數鍘�
|
|
|
- *(SendBuffer+0x30) = (packTotalVol&0xFF);
|
|
|
- *(SendBuffer+0x31) = ((packTotalCurr>>8)&0xFF); //uint16 鐢垫睜鎬荤數娴�
|
|
|
- *(SendBuffer+0x32) = (packTotalCurr&0xFF);
|
|
|
- *(SendBuffer+0x33) = ((insulationR>>8)&0xFF); //uint16 缁濈紭鐢甸樆
|
|
|
- *(SendBuffer+0x34) = (insulationR&0xFF);
|
|
|
- *(SendBuffer+0x35) = (mainPosRlyStatus&0xFF); //uint8 涓绘�缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x36) = (preRlyStatus&0xFF); //uint8 棰勫厖缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x37) = (mainNegRlyStatus&0xFF); //uint8 鎬昏礋缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x38) = (thrRlyStatus&0xFF); //uint8 涓夊悎涓€缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x39) = (ptc1RlyStatus&0xFF); //uint8 PTC1缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x3A) = (airCondRlyStatus&0xFF); //uint8 绌鸿皟缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x3B) = (dcChrg1PosRlyStatus&0xFF); //uint8 蹇�厖1姝g户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x3C) = (dcChrg1NegRlyStatus&0xFF); //uint8 蹇�厖1璐熺户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x3D) = (dcChrg2PosRlyStatus&0xFF); //uint8 蹇�厖2姝g户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x3E) = (dcChrg2NegRlyStatus&0xFF); //uint8 蹇�厖2璐熺户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x3F) = (heatPosRlyStatus&0xFF); //uint8 鍔犵儹姝g户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x40) = (heatNegRlyStatus&0xFF); //uint8 鍔犵儹璐熺户鐢靛櫒寮€闂�姸鎬�
|
|
|
- *(SendBuffer+0x41) = (coolRlyStatus&0xFF); //uint8 姘村喎缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x42) = (ptc2RlyStatus&0xFF); //uint8 PTC2缁х數鍣ㄥ紑闂�姸鎬�
|
|
|
- *(SendBuffer+0x43) = (mainPosRlyErrStatus&0xFF); //uint8 涓绘�缁х數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x44) = (preRlyErrStatus&0xFF); //uint8 棰勫厖缁х數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x45) = (mainNegRlyErrStatus&0xFF); //uint8 鎬昏礋缁х數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x46) = (thrRlyErrStatus&0xFF); //uint8 涓夊悎涓€缁х數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x47) = (ptc1RlyErrStatus&0xFF); //uint8 PTC1鐢靛櫒鏁呴殰鐘舵€�
|
|
|
- *(SendBuffer+0x48) = (airCondRlyErrStatus&0xFF); //uint8 绌鸿皟鐢靛櫒鏁呴殰鐘舵€�
|
|
|
- *(SendBuffer+0x49) = (dcChrg1PosRlyErrStatus&0xFF); //uint8 蹇�厖1姝g數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4A) = (dcChrg1NegRlyErrStatus&0xFF); //uint8 蹇�厖1璐熺數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4B) = (dcChrg2PosRlyErrStatus&0xFF); //uint8 蹇�厖2姝g數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4C) = (dcChrg2NegRlyErrStatus&0xFF); //uint8 蹇�厖2璐熺數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4D) = (heatPosRlyErrStatus&0xFF); //uint8 鍔犵儹姝g數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4E) = (heatNegRlyErrStatus&0xFF); //uint8 鍔犵儹璐熺數鍣ㄦ晠闅滅姸鎬�
|
|
|
- *(SendBuffer+0x4F) = (coolRlyErrStatus&0xFF); //uint8 姘村喎鐢靛櫒鏁呴殰鐘舵€�
|
|
|
- *(SendBuffer+0x50) = (ptc2RlyErrStatus&0xFF); //uint8 PTC2鐢靛櫒鏁呴殰鐘舵€�
|
|
|
- *(SendBuffer+0x51) = ((numOfCells>>8)&0xFF); //uint16 鍗曚綋鐢垫睜鎬绘暟
|
|
|
- *(SendBuffer+0x52) = (numOfCells&0xFF);
|
|
|
+ *(SendBuffer+0x15) = (TCP_ENCPT_DISABLE&0xFF); //uint8 TCP_ENCPT_DISABLE
|
|
|
+ UINT16 DataLen =0x3B + numOfCells*2 + numOfCellTemp ;
|
|
|
+ *(SendBuffer+0x16) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
+ *(SendBuffer+0x17) = (DataLen&0xFF);
|
|
|
+ *(SendBuffer+0x18) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x19) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x1A) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x1B) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x1C) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x1D) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ *(SendBuffer+0x1E) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
+ *(SendBuffer+0x1F) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x20) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x21) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x22) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x23) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x24) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ *(SendBuffer+0x25) = (csq&0xFF); //uint8 csq
|
|
|
+ *(SendBuffer+0x26) = (bmsStatus&0xFF); //uint8 BMS状态
|
|
|
+ *(SendBuffer+0x27) = (chrgConctStatus&0xFF); //uint8 充电连接状态
|
|
|
+ *(SendBuffer+0x28) = (bmsErrClass&0xFF); //uint8 BMS故障等级
|
|
|
+ *(SendBuffer+0x29) = (bmsErrNum&0xFF); //uint8 BMS故障码
|
|
|
+ *(SendBuffer+0x2A) = (highVolPwrDwnReq&0xFF); //uint8 下高压请求
|
|
|
+ *(SendBuffer+0x2B) = (chrgStatus&0xFF); //uint8 充电状态
|
|
|
+ *(SendBuffer+0x2C) = (battSoc&0xFF); //uint8 SOC
|
|
|
+ *(SendBuffer+0x2D) = (battSOH&0xFF); //uint8 电池SOH
|
|
|
+ *(SendBuffer+0x2E) = ((packTotalVol>>8)&0xFF); //uint16 电池总电压
|
|
|
+ *(SendBuffer+0x2F) = (packTotalVol&0xFF);
|
|
|
+ *(SendBuffer+0x30) = ((packTotalCurr>>8)&0xFF); //uint16 电池总电流
|
|
|
+ *(SendBuffer+0x31) = (packTotalCurr&0xFF);
|
|
|
+ *(SendBuffer+0x32) = ((insulationR>>8)&0xFF); //uint16 绝缘电阻
|
|
|
+ *(SendBuffer+0x33) = (insulationR&0xFF);
|
|
|
+ *(SendBuffer+0x34) = (mainPosRlyStatus&0xFF); //uint8 主正继电器开闭状态
|
|
|
+ *(SendBuffer+0x35) = (preRlyStatus&0xFF); //uint8 预充继电器开闭状态
|
|
|
+ *(SendBuffer+0x36) = (mainNegRlyStatus&0xFF); //uint8 总负继电器开闭状态
|
|
|
+ *(SendBuffer+0x37) = (thrRlyStatus&0xFF); //uint8 三合一继电器开闭状态
|
|
|
+ *(SendBuffer+0x38) = (ptc1RlyStatus&0xFF); //uint8 PTC1继电器开闭状态
|
|
|
+ *(SendBuffer+0x39) = (airCondRlyStatus&0xFF); //uint8 空调继电器开闭状态
|
|
|
+ *(SendBuffer+0x3A) = (dcChrg1PosRlyStatus&0xFF); //uint8 快充1正继电器开闭状态
|
|
|
+ *(SendBuffer+0x3B) = (dcChrg1NegRlyStatus&0xFF); //uint8 快充1负继电器开闭状态
|
|
|
+ *(SendBuffer+0x3C) = (dcChrg2PosRlyStatus&0xFF); //uint8 快充2正继电器开闭状态
|
|
|
+ *(SendBuffer+0x3D) = (dcChrg2NegRlyStatus&0xFF); //uint8 快充2负继电器开闭状态
|
|
|
+ *(SendBuffer+0x3E) = (heatPosRlyStatus&0xFF); //uint8 加热正继电器开闭状态
|
|
|
+ *(SendBuffer+0x3F) = (heatNegRlyStatus&0xFF); //uint8 加热负继电器开闭状态
|
|
|
+ *(SendBuffer+0x40) = (coolRlyStatus&0xFF); //uint8 水冷继电器开闭状态
|
|
|
+ *(SendBuffer+0x41) = (ptc2RlyStatus&0xFF); //uint8 PTC2继电器开闭状态
|
|
|
+ *(SendBuffer+0x42) = (mainPosRlyErrStatus&0xFF); //uint8 主正继电器故障状态
|
|
|
+ *(SendBuffer+0x43) = (preRlyErrStatus&0xFF); //uint8 预充继电器故障状态
|
|
|
+ *(SendBuffer+0x44) = (mainNegRlyErrStatus&0xFF); //uint8 总负继电器故障状态
|
|
|
+ *(SendBuffer+0x45) = (thrRlyErrStatus&0xFF); //uint8 三合一继电器故障状态
|
|
|
+ *(SendBuffer+0x46) = (ptc1RlyErrStatus&0xFF); //uint8 PTC1电器故障状态
|
|
|
+ *(SendBuffer+0x47) = (airCondRlyErrStatus&0xFF); //uint8 空调电器故障状态
|
|
|
+ *(SendBuffer+0x48) = (dcChrg1PosRlyErrStatus&0xFF); //uint8 快充1正电器故障状态
|
|
|
+ *(SendBuffer+0x49) = (dcChrg1NegRlyErrStatus&0xFF); //uint8 快充1负电器故障状态
|
|
|
+ *(SendBuffer+0x4A) = (dcChrg2PosRlyErrStatus&0xFF); //uint8 快充2正电器故障状态
|
|
|
+ *(SendBuffer+0x4B) = (dcChrg2NegRlyErrStatus&0xFF); //uint8 快充2负电器故障状态
|
|
|
+ *(SendBuffer+0x4C) = (heatPosRlyErrStatus&0xFF); //uint8 加热正电器故障状态
|
|
|
+ *(SendBuffer+0x4D) = (heatNegRlyErrStatus&0xFF); //uint8 加热负电器故障状态
|
|
|
+ *(SendBuffer+0x4E) = (coolRlyErrStatus&0xFF); //uint8 水冷电器故障状态
|
|
|
+ *(SendBuffer+0x4F) = (ptc2RlyErrStatus&0xFF); //uint8 PTC2电器故障状态
|
|
|
+ *(SendBuffer+0x50) = ((numOfCells>>8)&0xFF); //uint16 单体电池总数
|
|
|
+ *(SendBuffer+0x51) = (numOfCells&0xFF);
|
|
|
for(UINT16 index = 0; index < numOfCells;index++)
|
|
|
{
|
|
|
- *(SendBuffer+0x53 + index*2) = ((battCellU[index]>>8)&0xFF);
|
|
|
- *(SendBuffer+0x53 + index*2 +1) = ((battCellU[index])&0xFF);
|
|
|
+ *(SendBuffer+0x52+ index*2) = ((battCellU[index]>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x52+ index*2 +1) = ((battCellU[index])&0xFF);
|
|
|
}
|
|
|
- *(SendBuffer+0x353) = numOfCellTemp; //uint8 鍙�厖鐢靛偍鑳芥俯搴︽帰閽堜釜鏁�
|
|
|
- memcpy(SendBuffer+0x354,battCellTemp,numOfCellTemp);
|
|
|
+ *(SendBuffer+0x352) = (numOfCellTemp&0xFF); //uint8 可充电储能温度探针个数
|
|
|
+ memcpy(SendBuffer+0x353,battCellTemp,numOfCellTemp);
|
|
|
+ *(SendBuffer+0x393) = bcc_chk(SendBuffer,0x392);
|
|
|
break;
|
|
|
}
|
|
|
case 0x92:
|
|
@@ -4437,64 +4437,64 @@ void TcpDataAssemble(UINT8 Tcptype,UINT8 *SendBuffer,UTC8TimeType UTC8TimeTcp)
|
|
|
*(SendBuffer + 2 ) = TCP_CMD_SYM;
|
|
|
*(SendBuffer + 3 ) = TCP_ANS_SYM;
|
|
|
memcpy(SendBuffer + 4,AppNVMData.battSN,BATT_SN_LEN);
|
|
|
- *(SendBuffer+0x15) = ((TCP_ENCPT_DISABLE>>8)&0xFF); //uint16 TCP_ENCPT_DISABLE
|
|
|
- *(SendBuffer+0x16) = (TCP_ENCPT_DISABLE&0xFF);
|
|
|
+ *(SendBuffer+0x15) = (TCP_ENCPT_DISABLE&0xFF); //uint8 TCP_ENCPT_DISABLE
|
|
|
UINT16 DataLen =0x35 ;
|
|
|
- *(SendBuffer+0x17) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
- *(SendBuffer+0x18) = (DataLen&0xFF);
|
|
|
- *(SendBuffer+0x19) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x1A) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x1B) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x1C) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x1D) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x1E) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- *(SendBuffer+0x1F) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
- *(SendBuffer+0x20) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
- *(SendBuffer+0x21) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
- *(SendBuffer+0x22) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
- *(SendBuffer+0x23) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
- *(SendBuffer+0x24) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
- *(SendBuffer+0x25) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
- *(SendBuffer+0x26) = ((accChrgAh>>24)&0xFF); //uint32 绱��鍏呭叆Ah鏁�
|
|
|
- *(SendBuffer+0x27) = ((accChrgAh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x28) = ((accChrgAh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x29) = (accChrgAh&0xFF);
|
|
|
- *(SendBuffer+0x2A) = ((accDischrgAh>>24)&0xFF); //uint32 绱��鏀惧嚭Ah鏁�
|
|
|
- *(SendBuffer+0x2B) = ((accDischrgAh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x2C) = ((accDischrgAh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x2D) = (accDischrgAh&0xFF);
|
|
|
- *(SendBuffer+0x2E) = ((accChrgkWh>>24)&0xFF); //uint32 绱��鍏呭叆kWh鏁�
|
|
|
- *(SendBuffer+0x2F) = ((accChrgkWh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x30) = ((accChrgkWh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x31) = (accChrgkWh&0xFF);
|
|
|
- *(SendBuffer+0x32) = ((accDischrgkWh>>24)&0xFF); //uint32 绱��鏀惧嚭kWh鏁�
|
|
|
- *(SendBuffer+0x33) = ((accDischrgkWh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x34) = ((accDischrgkWh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x35) = (accDischrgkWh&0xFF);
|
|
|
- *(SendBuffer+0x36) = ((accRecvryChrgAh>>24)&0xFF); //uint32 绱��鍔ㄨ兘鍥為�鍏呭叆Ah鏁�
|
|
|
- *(SendBuffer+0x37) = ((accRecvryChrgAh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x38) = ((accRecvryChrgAh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x39) = (accRecvryChrgAh&0xFF);
|
|
|
- *(SendBuffer+0x3A) = ((accRecvryChrgkWh>>24)&0xFF); //uint32 绱��鍔ㄨ兘鍥為�鍏呭叆kWh鏁�
|
|
|
- *(SendBuffer+0x3B) = ((accRecvryChrgkWh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x3C) = ((accRecvryChrgkWh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x3D) = (accRecvryChrgkWh&0xFF);
|
|
|
- *(SendBuffer+0x3E) = ((accStationChrgAh>>24)&0xFF); //uint32 绱��鎹㈢數绔欏厖鍏�h鏁�
|
|
|
- *(SendBuffer+0x3F) = ((accStationChrgAh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x40) = ((accStationChrgAh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x41) = (accStationChrgAh&0xFF);
|
|
|
- *(SendBuffer+0x42) = ((accStationChrgkWh>>24)&0xFF); //uint32 绱��鎹㈢數绔欏厖鍏�Wh鏁�
|
|
|
- *(SendBuffer+0x43) = ((accStationChrgkWh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x44) = ((accStationChrgkWh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x45) = (accStationChrgkWh&0xFF);
|
|
|
- *(SendBuffer+0x46) = ((accGunChrgAh>>24)&0xFF); //uint32 绱��鎻掓灙鍏呯數鍏呭叆Ah鏁�
|
|
|
- *(SendBuffer+0x47) = ((accGunChrgAh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x48) = ((accGunChrgAh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x49) = (accGunChrgAh&0xFF);
|
|
|
- *(SendBuffer+0x4A) = ((accGunChrgkWh>>24)&0xFF); //uint32 绱��鎻掓灙鍏呯數鍏呭叆kWh鏁�
|
|
|
- *(SendBuffer+0x4B) = ((accGunChrgkWh>>16)&0xFF);
|
|
|
- *(SendBuffer+0x4C) = ((accGunChrgkWh>>8)&0xFF);
|
|
|
- *(SendBuffer+0x4D) = (accGunChrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x16) = ((DataLen>>8)&0xFF); //uint16 DataLen
|
|
|
+ *(SendBuffer+0x17) = (DataLen&0xFF);
|
|
|
+ *(SendBuffer+0x18) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x19) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x1A) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x1B) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x1C) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x1D) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ *(SendBuffer+0x1E) = (Tcptype&0xFF); //uint8 BATTMSG
|
|
|
+ *(SendBuffer+0x1F) = (UTC8TimeTcp.year - 0x07D0&0xFF); //uint8 year
|
|
|
+ *(SendBuffer+0x20) = (UTC8TimeTcp.month&0xFF); //uint8 month
|
|
|
+ *(SendBuffer+0x21) = (UTC8TimeTcp.day&0xFF); //uint8 day
|
|
|
+ *(SendBuffer+0x22) = (UTC8TimeTcp.hour&0xFF); //uint8 hour
|
|
|
+ *(SendBuffer+0x23) = (UTC8TimeTcp.minute&0xFF); //uint8 minute
|
|
|
+ *(SendBuffer+0x24) = (UTC8TimeTcp.second&0xFF); //uint8 second
|
|
|
+ *(SendBuffer+0x25) = ((accChrgAh>>24)&0xFF); //uint32 累计充入Ah数
|
|
|
+ *(SendBuffer+0x26) = ((accChrgAh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x27) = ((accChrgAh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x28) = (accChrgAh&0xFF);
|
|
|
+ *(SendBuffer+0x29) = ((accDischrgAh>>24)&0xFF); //uint32 累计放出Ah数
|
|
|
+ *(SendBuffer+0x2A) = ((accDischrgAh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x2B) = ((accDischrgAh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x2C) = (accDischrgAh&0xFF);
|
|
|
+ *(SendBuffer+0x2D) = ((accChrgkWh>>24)&0xFF); //uint32 累计充入kWh数
|
|
|
+ *(SendBuffer+0x2E) = ((accChrgkWh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x2F) = ((accChrgkWh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x30) = (accChrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x31) = ((accDischrgkWh>>24)&0xFF); //uint32 累计放出kWh数
|
|
|
+ *(SendBuffer+0x32) = ((accDischrgkWh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x33) = ((accDischrgkWh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x34) = (accDischrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x35) = ((accRecvryChrgAh>>24)&0xFF); //uint32 累计动能回馈充入Ah数
|
|
|
+ *(SendBuffer+0x36) = ((accRecvryChrgAh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x37) = ((accRecvryChrgAh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x38) = (accRecvryChrgAh&0xFF);
|
|
|
+ *(SendBuffer+0x39) = ((accRecvryChrgkWh>>24)&0xFF); //uint32 累计动能回馈充入kWh数
|
|
|
+ *(SendBuffer+0x3A) = ((accRecvryChrgkWh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x3B) = ((accRecvryChrgkWh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x3C) = (accRecvryChrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x3D) = ((accStationChrgAh>>24)&0xFF); //uint32 累计换电站充入Ah数
|
|
|
+ *(SendBuffer+0x3E) = ((accStationChrgAh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x3F) = ((accStationChrgAh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x40) = (accStationChrgAh&0xFF);
|
|
|
+ *(SendBuffer+0x41) = ((accStationChrgkWh>>24)&0xFF); //uint32 累计换电站充入kWh数
|
|
|
+ *(SendBuffer+0x42) = ((accStationChrgkWh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x43) = ((accStationChrgkWh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x44) = (accStationChrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x45) = ((accGunChrgAh>>24)&0xFF); //uint32 累计插枪充电充入Ah数
|
|
|
+ *(SendBuffer+0x46) = ((accGunChrgAh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x47) = ((accGunChrgAh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x48) = (accGunChrgAh&0xFF);
|
|
|
+ *(SendBuffer+0x49) = ((accGunChrgkWh>>24)&0xFF); //uint32 累计插枪充电充入kWh数
|
|
|
+ *(SendBuffer+0x4A) = ((accGunChrgkWh>>16)&0xFF);
|
|
|
+ *(SendBuffer+0x4B) = ((accGunChrgkWh>>8)&0xFF);
|
|
|
+ *(SendBuffer+0x4C) = (accGunChrgkWh&0xFF);
|
|
|
+ *(SendBuffer+0x4D) = bcc_chk(SendBuffer,0x4C);
|
|
|
break;
|
|
|
}
|
|
|
}
|