|
@@ -217,15 +217,15 @@ static void TcpTask(void *arg)
|
|
|
break;
|
|
|
}
|
|
|
free(queueItem);
|
|
|
- } //if
|
|
|
- } //while 循环
|
|
|
+ } // if
|
|
|
+ } // while 循环
|
|
|
}
|
|
|
/***********************************************************************************************************************
|
|
|
* 网络组包发送函数
|
|
|
* 输入:空
|
|
|
* 输出:空
|
|
|
* 处理:将相关信息组包之后进行按一定频率发送,每次调用间隔为1s
|
|
|
-***********************************************************************************************************************/
|
|
|
+ ***********************************************************************************************************************/
|
|
|
static void TcpDataInfoAssembleSend()
|
|
|
{
|
|
|
OsaUtcTimeTValue TimeStracture;
|
|
@@ -236,7 +236,7 @@ static void TcpDataInfoAssembleSend()
|
|
|
UINT16 DataLen = 0;
|
|
|
UINT8 BattSendFreq = 30;
|
|
|
UINT8 GpsSendFreq = 30;
|
|
|
- UINT8 DebugFeq = 10; //zhengchao 20211128 10-> 1 just for test
|
|
|
+ UINT8 DebugFeq = 10; // zhengchao 20211128 10-> 1 just for test
|
|
|
UINT16 year;
|
|
|
UINT8 month, day, hour, minute, sec;
|
|
|
UTC8TimeType UTC8TimeTcp;
|
|
@@ -260,7 +260,7 @@ static void TcpDataInfoAssembleSend()
|
|
|
case BATT_DISCHARGE_SYM:
|
|
|
{
|
|
|
BattSendFreq = AppDataInfo.BattInfoSendFreqNomal;
|
|
|
- //BattSendFreq = 1;
|
|
|
+ // BattSendFreq = 1;
|
|
|
GpsSendFreq = AppDataInfo.PosInfoSendFreqHigh;
|
|
|
break;
|
|
|
}
|
|
@@ -281,7 +281,7 @@ static void TcpDataInfoAssembleSend()
|
|
|
}
|
|
|
}
|
|
|
DebugFeq = BattSendFreq;
|
|
|
- //DebugFeq = 1;
|
|
|
+ // DebugFeq = 1;
|
|
|
if (send_counter % BattSendFreq == 0 && send_counter != 0)
|
|
|
{
|
|
|
UINT16 ErrorTemp = 0x00;
|
|
@@ -306,24 +306,24 @@ static void TcpDataInfoAssembleSend()
|
|
|
*(SendBuffer + 1) = TCP_START_SYM2; //起始码-2
|
|
|
*(SendBuffer + 2) = TCP_CMD_SYM; //命令标识-3
|
|
|
*(SendBuffer + 3) = TCP_ANS_SYM; //应答标识-4
|
|
|
- memcpy(SendBuffer + 4, AppNVMData.battSN, BATT_SN_LEN); //SN码 5-21
|
|
|
+ memcpy(SendBuffer + 4, AppNVMData.battSN, BATT_SN_LEN); // SN码 5-21
|
|
|
*(SendBuffer + 21) = TCP_ENCPT_DISABLE; //加密方式-22
|
|
|
DataLen = ProtocolFixedLen + ProtocolFluctedLen - ProtocolHeaderLen; //电池信息单元协议固定长度
|
|
|
*(SendBuffer + 22) = (DataLen >> 8) & 0xFF; //数据长度H-23
|
|
|
*(SendBuffer + 23) = DataLen & 0xFF; //数据长度L-24
|
|
|
- *(SendBuffer + 24) = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year-25
|
|
|
- *(SendBuffer + 25) = UTC8TimeTcp.month & 0xFF; //month-26
|
|
|
- *(SendBuffer + 26) = UTC8TimeTcp.day & 0xFF; //day-27
|
|
|
- *(SendBuffer + 27) = UTC8TimeTcp.hour & 0xFF; //hour-28
|
|
|
- *(SendBuffer + 28) = UTC8TimeTcp.minute & 0xFF; //mins-29
|
|
|
- *(SendBuffer + 29) = UTC8TimeTcp.second & 0xFF; //sec-30
|
|
|
+ *(SendBuffer + 24) = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year-25
|
|
|
+ *(SendBuffer + 25) = UTC8TimeTcp.month & 0xFF; // month-26
|
|
|
+ *(SendBuffer + 26) = UTC8TimeTcp.day & 0xFF; // day-27
|
|
|
+ *(SendBuffer + 27) = UTC8TimeTcp.hour & 0xFF; // hour-28
|
|
|
+ *(SendBuffer + 28) = UTC8TimeTcp.minute & 0xFF; // mins-29
|
|
|
+ *(SendBuffer + 29) = UTC8TimeTcp.second & 0xFF; // sec-30
|
|
|
*(SendBuffer + 30) = BATTMSG; //电池信息发送-31
|
|
|
- *(SendBuffer + 31) = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year-32
|
|
|
- *(SendBuffer + 32) = UTC8TimeTcp.month & 0xFF; //month-33
|
|
|
- *(SendBuffer + 33) = UTC8TimeTcp.day & 0xFF; //day-34
|
|
|
- *(SendBuffer + 34) = UTC8TimeTcp.hour & 0xFF; //hour-35
|
|
|
- *(SendBuffer + 35) = UTC8TimeTcp.minute & 0xFF; //mins-36
|
|
|
- *(SendBuffer + 36) = UTC8TimeTcp.second & 0xFF; //sec-37
|
|
|
+ *(SendBuffer + 31) = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year-32
|
|
|
+ *(SendBuffer + 32) = UTC8TimeTcp.month & 0xFF; // month-33
|
|
|
+ *(SendBuffer + 33) = UTC8TimeTcp.day & 0xFF; // day-34
|
|
|
+ *(SendBuffer + 34) = UTC8TimeTcp.hour & 0xFF; // hour-35
|
|
|
+ *(SendBuffer + 35) = UTC8TimeTcp.minute & 0xFF; // mins-36
|
|
|
+ *(SendBuffer + 36) = UTC8TimeTcp.second & 0xFF; // sec-37
|
|
|
*(SendBuffer + 37) = csq; //信号强度-38
|
|
|
*(SendBuffer + 38) = sfmd_st_fltLevel; //故障等级-39
|
|
|
if (osOK == osMutexAcquire(Error_Mutex, 100))
|
|
@@ -343,9 +343,9 @@ static void TcpDataInfoAssembleSend()
|
|
|
*(SendBuffer + 44) = battPackVol & 0xFF; //电压-45
|
|
|
*(SendBuffer + 45) = battPackVol >> 8; //电压-46
|
|
|
*(SendBuffer + 46) = battPackVol & 0xFF; //电压-47
|
|
|
- *(SendBuffer + 47) = battMOSSwitchState; //mos状态-48
|
|
|
- *(SendBuffer + 48) = (UINT8)(socd_pct_vcuSoc / 10); //soc-49
|
|
|
- *(SendBuffer + 49) = (UINT8)(sohd_pct_bcuSoh / 10); //soh-50
|
|
|
+ *(SendBuffer + 47) = battMOSSwitchState; // mos状态-48
|
|
|
+ *(SendBuffer + 48) = (UINT8)(socd_pct_vcuSoc / 10); // soc-49
|
|
|
+ *(SendBuffer + 49) = (UINT8)(sohd_pct_bcuSoh / 10); // soh-50
|
|
|
*(SendBuffer + 50) = (battBalanceoInfo >> 24) & 0xFF;
|
|
|
*(SendBuffer + 51) = (battBalanceoInfo >> 16) & 0xFF;
|
|
|
*(SendBuffer + 52) = (battBalanceoInfo >> 8) & 0xFF;
|
|
@@ -361,7 +361,7 @@ static void TcpDataInfoAssembleSend()
|
|
|
*(SendBuffer + 56 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount) = battWorkState; //电池工作状态
|
|
|
*(SendBuffer + 57 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount) = battHeatEnableState; //电池加热使能
|
|
|
*(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount) = BMS_OTHER_TEMP + NB_OTHER_TEMP_NUM; //其他温度个数
|
|
|
- *(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount + 1) = MOSTemp; //mos温度
|
|
|
+ *(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount + 1) = MOSTemp; // mos温度
|
|
|
*(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount + 2) = packTemp; //环境温度
|
|
|
*(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount + 3) = fastChargeTemp; //快充温度
|
|
|
*(SendBuffer + 58 + AppDataInfo.BattCellCount * 2 + AppDataInfo.BattTempCount + 4) = normalChargeTemp; //慢充温度
|
|
@@ -411,21 +411,21 @@ static void TcpDataInfoAssembleSend()
|
|
|
GpsToTcpInfo.cmdSymbol = TCP_CMD_SYM;
|
|
|
GpsToTcpInfo.ansSymbol = TCP_ANS_SYM;
|
|
|
memcpy(GpsToTcpInfo.SN, AppNVMData.battSN, BATT_SN_LEN);
|
|
|
- GpsToTcpInfo.encryptMethod = TCP_ENCPT_DISABLE; //not encrypt
|
|
|
+ GpsToTcpInfo.encryptMethod = TCP_ENCPT_DISABLE; // not encrypt
|
|
|
GpsToTcpInfo.dataLength[0] = (DataLen >> 8) & 0xFF;
|
|
|
GpsToTcpInfo.dataLength[1] = DataLen & 0xFF;
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
- GpsToTcpInfo.gpsInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; //sec
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
+ GpsToTcpInfo.gpsInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; // sec
|
|
|
GpsToTcpInfo.gpsInfo.msgMark = GPSMSG;
|
|
|
- GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
+ GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
GpsToTcpInfo.gpsInfo.msgCollectionTimeUTC[5] = UTC8TimeTcp.second & 0xFF;
|
|
|
osStatus_t ret = osMessageQueueGet(GpsRecvHandle, (UINT8 *)&GpsRecvData, 0, 1000);
|
|
|
if (ret == 0)
|
|
@@ -510,21 +510,21 @@ static void TcpDataInfoAssembleSend()
|
|
|
VerMsgToTcpInfo.cmdSymbol = TCP_CMD_SYM;
|
|
|
VerMsgToTcpInfo.ansSymbol = TCP_ANS_SYM;
|
|
|
memcpy(VerMsgToTcpInfo.SN, AppNVMData.battSN, BATT_SN_LEN);
|
|
|
- VerMsgToTcpInfo.encryptMethod = TCP_ENCPT_DISABLE; //not encrypt
|
|
|
+ VerMsgToTcpInfo.encryptMethod = TCP_ENCPT_DISABLE; // not encrypt
|
|
|
VerMsgToTcpInfo.dataLength[0] = (DataLen >> 8) & 0xFF;
|
|
|
VerMsgToTcpInfo.dataLength[1] = DataLen & 0xFF;
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
- VerMsgToTcpInfo.VerInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; //sec
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
+ VerMsgToTcpInfo.VerInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; // sec
|
|
|
VerMsgToTcpInfo.VerInfo.msgMark = VERSIONMSG;
|
|
|
- VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
+ VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
VerMsgToTcpInfo.VerInfo.msgCollectionTimeUTC[5] = UTC8TimeTcp.second & 0xFF;
|
|
|
memcpy(VerMsgToTcpInfo.VerInfo.ICCID, iccid, 20);
|
|
|
memcpy(VerMsgToTcpInfo.VerInfo.IMEI, imei, 15);
|
|
@@ -583,10 +583,10 @@ static void TcpDataInfoAssembleSend()
|
|
|
{
|
|
|
sprintf((char *)rbuf, "B-%d,%d,%d,%d,%d,%d,%d,%d,%d,,\
|
|
|
%d,%d,%d,%d,,\
|
|
|
- %d,%d,%d,%d,%d,%d,%d",
|
|
|
+ %d,%d,%d,%d,%d,%d,%d,%d",
|
|
|
socd_pct_ahSoc, socd_pct_ekfSoc, socd_pct_estSoc, socd_pct_battSoc, socd_pct_vcuSoc, battSOC * 10, socd_pct_cellBattSoc, sohv_Q_packCapArrEo[9], cdmv_ohm_deltR[sfmd_idx_cellUMin],
|
|
|
battI - 10000, maxCellVol, minCellVol, sfmd_V_cellUAvrg,
|
|
|
- cand_Nr_cellNr, cand_Q_cellCap, cand_V_chrgStartStat, test_cellCap[cand_Nr_cellNr - 1], test_countEn, ihd_tm_parkTime, sohd_Q_chrgEo);
|
|
|
+ cand_Nr_cellNr, cand_Q_cellCap, cand_V_chrgStartStat, test_cellCap[cand_Nr_cellNr - 1], sorv_ohm_cellREo[cand_Nr_cellNr - 1], test_countEn, ihd_tm_parkTime, sohd_Q_chrgEo);
|
|
|
}
|
|
|
Debugcounter++;
|
|
|
if (Debugcounter > 100)
|
|
@@ -610,15 +610,15 @@ static void TcpDataInfoAssembleSend()
|
|
|
DebugMsgInfo.cmdSymbol = TCP_CMD_SYM;
|
|
|
DebugMsgInfo.ansSymbol = TCP_ANS_SYM;
|
|
|
memcpy(DebugMsgInfo.SN, AppNVMData.battSN, BATT_SN_LEN);
|
|
|
- DebugMsgInfo.encryptMethod = TCP_ENCPT_DISABLE; //not encrypt
|
|
|
+ DebugMsgInfo.encryptMethod = TCP_ENCPT_DISABLE; // not encrypt
|
|
|
DebugMsgInfo.dataLength[0] = (DataLen >> 8) & 0xFF;
|
|
|
DebugMsgInfo.dataLength[1] = DataLen & 0xFF;
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; //sec
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; // sec
|
|
|
DebugMsgInfo.DebugInfo.msgMark = DEBUGMSG;
|
|
|
DebugMsgInfo.DebugInfo.DebugLen[0] = BufferLen >> 8;
|
|
|
DebugMsgInfo.DebugInfo.DebugLen[1] = BufferLen;
|
|
@@ -675,15 +675,15 @@ static void TcpDataInfoAssembleSend()
|
|
|
DebugMsgInfo.cmdSymbol = TCP_CMD_SYM;
|
|
|
DebugMsgInfo.ansSymbol = TCP_ANS_SYM;
|
|
|
memcpy(DebugMsgInfo.SN, AppNVMData.battSN, BATT_SN_LEN);
|
|
|
- DebugMsgInfo.encryptMethod = TCP_ENCPT_DISABLE; //not encrypt
|
|
|
+ DebugMsgInfo.encryptMethod = TCP_ENCPT_DISABLE; // not encrypt
|
|
|
DebugMsgInfo.dataLength[0] = (DataLen >> 8) & 0xFF;
|
|
|
DebugMsgInfo.dataLength[1] = DataLen & 0xFF;
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; //year
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; //month
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; //day
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; //hour
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; //mins
|
|
|
- DebugMsgInfo.DebugInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; //sec
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[0] = (UTC8TimeTcp.year - 0x07D0) & 0xFF; // year
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[1] = UTC8TimeTcp.month & 0xFF; // month
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[2] = UTC8TimeTcp.day & 0xFF; // day
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[3] = UTC8TimeTcp.hour & 0xFF; // hour
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[4] = UTC8TimeTcp.minute & 0xFF; // mins
|
|
|
+ DebugMsgInfo.DebugInfo.sendTimeUTC[5] = UTC8TimeTcp.second & 0xFF; // sec
|
|
|
DebugMsgInfo.DebugInfo.msgMark = DEBUGMSG;
|
|
|
DebugMsgInfo.DebugInfo.DebugLen[0] = BufferLen >> 8;
|
|
|
DebugMsgInfo.DebugInfo.DebugLen[1] = BufferLen;
|
|
@@ -726,7 +726,7 @@ static void TcpHeartDataSend()
|
|
|
HeartMsgToTcp.cmdSymbol = TCP_HEART_SYM;
|
|
|
HeartMsgToTcp.ansSymbol = TCP_ANS_SYM;
|
|
|
memcpy(HeartMsgToTcp.SN, AppNVMData.battSN, BATT_SN_LEN);
|
|
|
- HeartMsgToTcp.encryptMethod = TCP_ENCPT_DISABLE; //not encrypt
|
|
|
+ HeartMsgToTcp.encryptMethod = TCP_ENCPT_DISABLE; // not encrypt
|
|
|
HeartMsgToTcp.dataLength[0] = 0;
|
|
|
HeartMsgToTcp.dataLength[1] = 0;
|
|
|
HeartMsgToTcp.CRC = bcc_chk((UINT8 *)&HeartMsgToTcp, sizeof(HeartMsgToTcp) - 1);
|
|
@@ -773,7 +773,7 @@ static void TcpDataInfoRecvHandle()
|
|
|
{
|
|
|
Fota_Func(Ptr, socContext.id);
|
|
|
}
|
|
|
- else if (*(Ptr + 30) == 0x88) //BMS远程升级数据传输命令
|
|
|
+ else if (*(Ptr + 30) == 0x88) // BMS远程升级数据传输命令
|
|
|
{
|
|
|
Fota_Func(Ptr, socContext.id);
|
|
|
}
|
|
@@ -786,13 +786,13 @@ static void TcpDataInfoRecvHandle()
|
|
|
TcpCmdAnswer[23] = 0x06;
|
|
|
memcpy(&TcpCmdAnswer[24], (Ptr + 24), 6);
|
|
|
TcpCmdAnswer[30] = bcc_chk(TcpCmdAnswer, 30);
|
|
|
- if (*(Ptr + 31) == 0x01) //0x01代表锁定
|
|
|
+ if (*(Ptr + 31) == 0x01) // 0x01代表锁定
|
|
|
{
|
|
|
AppDataInfo.appDataModify = TRUE;
|
|
|
AppDataInfo.UserLock = TRUE;
|
|
|
tcpipConnectionSend(socContext.id, TcpCmdAnswer, 31, 0, 0, 0);
|
|
|
}
|
|
|
- else if (*(Ptr + 31) == 0x02) //0x02代表解锁
|
|
|
+ else if (*(Ptr + 31) == 0x02) // 0x02代表解锁
|
|
|
{
|
|
|
AppDataInfo.appDataModify = TRUE;
|
|
|
AppDataInfo.UserLock = FALSE;
|
|
@@ -809,7 +809,7 @@ static void TcpDataInfoRecvHandle()
|
|
|
TcpCmdAnswer[23] = 0x06;
|
|
|
memcpy(&TcpCmdAnswer[24], (Ptr + 24), 6);
|
|
|
TcpCmdAnswer[30] = bcc_chk(TcpCmdAnswer, 30);
|
|
|
- if (*(Ptr + 31) == 0x01) //0x01代表断开
|
|
|
+ if (*(Ptr + 31) == 0x01) // 0x01代表断开
|
|
|
{
|
|
|
|
|
|
AppDataInfo.appDataModify = TRUE;
|
|
@@ -820,7 +820,7 @@ static void TcpDataInfoRecvHandle()
|
|
|
AppDataInfo.BattForceLock = TRUE;
|
|
|
tcpipConnectionSend(socContext.id, TcpCmdAnswer, 31, 0, 0, 0);
|
|
|
}
|
|
|
- else if (*(Ptr + 31) == 0x00) //0x00代表关闭
|
|
|
+ else if (*(Ptr + 31) == 0x00) // 0x00代表关闭
|
|
|
{
|
|
|
AppDataInfo.appDataModify = TRUE;
|
|
|
if (RelayForceControl == 0)
|
|
@@ -841,12 +841,12 @@ static void TcpDataInfoRecvHandle()
|
|
|
TcpCmdAnswer[23] = 0x06;
|
|
|
memcpy(&TcpCmdAnswer[24], (Ptr + 24), 6);
|
|
|
TcpCmdAnswer[30] = bcc_chk(TcpCmdAnswer, 30);
|
|
|
- if (*(Ptr + 31) == 0x01) //0x01代表断开
|
|
|
+ if (*(Ptr + 31) == 0x01) // 0x01代表断开
|
|
|
{
|
|
|
BuzzerControl = TRUE;
|
|
|
tcpipConnectionSend(socContext.id, TcpCmdAnswer, 31, 0, 0, 0);
|
|
|
}
|
|
|
- else if (*(Ptr + 31) == 0x00) //0x00代表关闭
|
|
|
+ else if (*(Ptr + 31) == 0x00) // 0x00代表关闭
|
|
|
{
|
|
|
BuzzerControl = FALSE;
|
|
|
tcpipConnectionSend(socContext.id, TcpCmdAnswer, 31, 0, 0, 0);
|
|
@@ -903,7 +903,7 @@ static void TcpDataInfoRecvHandle()
|
|
|
}
|
|
|
TcpRecvData = NULL;
|
|
|
}
|
|
|
-//Tcp线程初始化
|
|
|
+// Tcp线程初始化
|
|
|
void AppTaskTcpInit(void *arg)
|
|
|
{
|
|
|
osThreadAttr_t task_attr;
|
|
@@ -923,7 +923,7 @@ void AppTaskTcpDeInit(void *arg)
|
|
|
osThreadTerminate(TcpTaskId);
|
|
|
TcpTaskId = NULL;
|
|
|
}
|
|
|
-//Tcp 状态转换函数
|
|
|
+// Tcp 状态转换函数
|
|
|
static void sendQueueMsg(UINT32 msgId, UINT32 xTickstoWait)
|
|
|
{
|
|
|
eventCallbackMessage_t *queueMsg = NULL;
|
|
@@ -937,7 +937,7 @@ static void sendQueueMsg(UINT32 msgId, UINT32 xTickstoWait)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-//Tcp状态注册函数
|
|
|
+// Tcp状态注册函数
|
|
|
static INT32 socketRegisterPSUrcCallback(urcID_t eventID, void *param, UINT32 paramLen)
|
|
|
{
|
|
|
CmiSimImsiStr *imsi = NULL;
|
|
@@ -958,7 +958,7 @@ static INT32 socketRegisterPSUrcCallback(urcID_t eventID, void *param, UINT32 pa
|
|
|
}
|
|
|
case NB_URC_ID_MM_SIGQ:
|
|
|
{
|
|
|
-//rssi = *(UINT8 *)param;
|
|
|
+// rssi = *(UINT8 *)param;
|
|
|
#ifdef USING_PRINTF1
|
|
|
printf("RSSI signal=%d\n", rssi);
|
|
|
#endif
|
|
@@ -998,7 +998,7 @@ static INT32 socketRegisterPSUrcCallback(urcID_t eventID, void *param, UINT32 pa
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
-//Tcpz连接状态回调函数
|
|
|
+// Tcpz连接状态回调函数
|
|
|
static void socketAppConnectionCallBack(UINT8 connectionEventType, void *bodyEvent)
|
|
|
{
|
|
|
switch (connectionEventType)
|