|
@@ -255,7 +255,7 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
|
|
TcpDataFeq.GpsFeqCnt[1] = 60*3;
|
|
TcpDataFeq.GpsFeqCnt[1] = 60*3;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 10;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 10;
|
|
}
|
|
}
|
|
- else if(BMS_Mode==0)//放电中
|
|
|
|
|
|
+ else if(BMS_Mode==2)//放电中
|
|
{
|
|
{
|
|
TcpDataFeq.GpsFeqCnt[1] = 10;
|
|
TcpDataFeq.GpsFeqCnt[1] = 10;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 30;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 30;
|
|
@@ -265,7 +265,17 @@ static void TcpDataSendFeqHandFunc(uint8* DataIdx)
|
|
TcpDataFeq.GpsFeqCnt[1] = 60;
|
|
TcpDataFeq.GpsFeqCnt[1] = 60;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 60;
|
|
TcpDataFeq.TrkBattFeqCnt[1] = 60;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ TcpDataFeq.DebugMsgFeqCnt[1] = TcpDataFeq.TrkBattFeqCnt[1];
|
|
|
|
+ //读取硬线唤醒源状态,若没有硬线唤醒,则降低调试信息发送频率
|
|
|
|
+ Dio_LevelType wakeup1,wakeup2 = STD_HIGH;
|
|
|
|
+ wakeup1 = Dio_ReadChannel(DioConf_DioChannel_PTB0_GPIO_IN_MCU_WAKEUP1);
|
|
|
|
+ wakeup2 = Dio_ReadChannel(DioConf_DioChannel_PTE2_GPIO_IN_MCU_WAKEUP2);
|
|
|
|
+ if(wakeup1==STD_LOW && wakeup2==STD_LOW)
|
|
|
|
+ {
|
|
|
|
+ TcpDataFeq.DebugMsgFeqCnt[1] = 10*60;
|
|
|
|
+ TcpDataFeq.TrkVehichleFeqCnt[1] = 10*60;
|
|
|
|
+ TcpDataFeq.GpsFeqCnt[1] = 3*60;
|
|
|
|
+ }
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
sint8 TcpDataSendFunc(sint8 ConnectId,uint8 DataSendIdxIn)
|
|
sint8 TcpDataSendFunc(sint8 ConnectId,uint8 DataSendIdxIn)
|
|
@@ -967,7 +977,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
|
|
{%.2f,%.2f,%.2f,%.2f,%.2f;\
|
|
{%.2f,%.2f,%.2f,%.2f,%.2f;\
|
|
%.2f,%.2f,%.2f,%.2f,%.2f,}\
|
|
%.2f,%.2f,%.2f,%.2f,%.2f,}\
|
|
{%.2f,%.2f,%.2f,%.2f,%.2f;\
|
|
{%.2f,%.2f,%.2f,%.2f,%.2f;\
|
|
- %.2f,%.2f,%.2f,%.2f,%.2f,},%s,%d",
|
|
|
|
|
|
+ %.2f,%.2f,%.2f,%.2f,%.2f,},%s,%d-M-%d,P-%d,N-%d,C-%d,A-%d",
|
|
returnFreq[0][0], returnFreq[0][1], returnFreq[0][2], returnFreq[0][3], returnFreq[0][4],
|
|
returnFreq[0][0], returnFreq[0][1], returnFreq[0][2], returnFreq[0][3], returnFreq[0][4],
|
|
returnP[0][0], returnP[0][1], returnP[0][2], returnP[0][3], returnP[0][4],
|
|
returnP[0][0], returnP[0][1], returnP[0][2], returnP[0][3], returnP[0][4],
|
|
|
|
|
|
@@ -975,7 +985,8 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
|
|
returnP[1][0], returnP[1][1], returnP[1][2], returnP[1][3], returnP[1][4],
|
|
returnP[1][0], returnP[1][1], returnP[1][2], returnP[1][3], returnP[1][4],
|
|
|
|
|
|
returnFreq[2][0], returnFreq[2][1], returnFreq[2][2], returnFreq[2][3], returnFreq[2][4],
|
|
returnFreq[2][0], returnFreq[2][1], returnFreq[2][2], returnFreq[2][3], returnFreq[2][4],
|
|
- returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp,DeviceErrNum);
|
|
|
|
|
|
+ returnP[2][0], returnP[2][1], returnP[2][2], returnP[2][3], returnP[2][4],tmp,DeviceErrNum,
|
|
|
|
+ BMS_Mode,BMS_StPosRly,BMS_StNegRly,BMS_CharSt,BMS_PackCurr-10000);
|
|
|
|
|
|
BufferLen = strlen((const char *)rbuf);
|
|
BufferLen = strlen((const char *)rbuf);
|
|
*SendLen = BufferLen + sizeof(DebugMsgInfo);
|
|
*SendLen = BufferLen + sizeof(DebugMsgInfo);
|
|
@@ -1033,17 +1044,13 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
|
|
*(SendBuffer + 0x24) = (UTC8TimeTcp.second & 0xFF); // uint8 second
|
|
*(SendBuffer + 0x24) = (UTC8TimeTcp.second & 0xFF); // uint8 second
|
|
memcpy(SendBuffer + 0x25, VIN, 17);
|
|
memcpy(SendBuffer + 0x25, VIN, 17);
|
|
*(SendBuffer + 0x36) = (vehicleStatus & 0xFF); // uint8 整车状态
|
|
*(SendBuffer + 0x36) = (vehicleStatus & 0xFF); // uint8 整车状态
|
|
- if (BMS_Mode == 1)
|
|
|
|
|
|
+ if (BMS_Mode == 2)
|
|
{
|
|
{
|
|
bmsHVOn = 1;
|
|
bmsHVOn = 1;
|
|
}
|
|
}
|
|
- else if (BMS_Mode == 2)
|
|
|
|
- {
|
|
|
|
- bmsHVOn = 0;
|
|
|
|
- }
|
|
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- bmsHVOn = 0xFF;
|
|
|
|
|
|
+ bmsHVOn = 2;
|
|
}
|
|
}
|
|
*(SendBuffer + 0x37) = (bmsHVOn & 0xFF); // uint8 bms上高压指令
|
|
*(SendBuffer + 0x37) = (bmsHVOn & 0xFF); // uint8 bms上高压指令
|
|
*(SendBuffer + 0x38) = (currentGearPosition & 0xFF); // uint8 当前档位
|
|
*(SendBuffer + 0x38) = (currentGearPosition & 0xFF); // uint8 当前档位
|
|
@@ -1077,7 +1084,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
|
|
}
|
|
}
|
|
case 0x91:
|
|
case 0x91:
|
|
{
|
|
{
|
|
- if(BMS_CellRecvCounter<128)
|
|
|
|
|
|
+ if(BMS_CellRecvFlg==false)//CAN上电压数据未接收完成
|
|
{
|
|
{
|
|
*SendLen = 0; // 不发送,长度为0
|
|
*SendLen = 0; // 不发送,长度为0
|
|
return;
|
|
return;
|
|
@@ -1108,7 +1115,7 @@ void TcpDataEncode(uint8 DataIdx,uint32 *PtrSendAddr, uint16 *SendLen)
|
|
*(SendBuffer + 0x23) = (UTC8TimeTcp.minute & 0xFF); // uint8 minute
|
|
*(SendBuffer + 0x23) = (UTC8TimeTcp.minute & 0xFF); // uint8 minute
|
|
*(SendBuffer + 0x24) = (UTC8TimeTcp.second & 0xFF); // uint8 second
|
|
*(SendBuffer + 0x24) = (UTC8TimeTcp.second & 0xFF); // uint8 second
|
|
*(SendBuffer + 0x25) = (CSQValue & 0xFF); // uint8 csq
|
|
*(SendBuffer + 0x25) = (CSQValue & 0xFF); // uint8 csq
|
|
- *(SendBuffer + 0x26) = (BMS_Mode & 0xFF); // uint8 BMS当前状态,0:预留;1:高压上电;2:高压下电;3:无效;,Re-1,Off-0,
|
|
|
|
|
|
+ *(SendBuffer + 0x26) = (bmsHVOn & 0xFF); // uint8 BMS当前状态,0:预留;1:高压上电;2:高压下电;3:无效;,Re-1,Off-0,
|
|
*(SendBuffer + 0x27) = (BMS_CharGunSt & 0xFF); // uint8 直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,
|
|
*(SendBuffer + 0x27) = (BMS_CharGunSt & 0xFF); // uint8 直流充电枪连接状态,0:未连接1 : 连接, Re - 1, Off - 0,
|
|
*(SendBuffer + 0x28) = (BMS_FtLvl & 0xFF); // uint8 当前最高故障等级,0-正常 1-1级 轻微故障 2-2级 较严重故障 3-3级 最严重故障,精度_1,偏移量_0,单位_
|
|
*(SendBuffer + 0x28) = (BMS_FtLvl & 0xFF); // uint8 当前最高故障等级,0-正常 1-1级 轻微故障 2-2级 较严重故障 3-3级 最严重故障,精度_1,偏移量_0,单位_
|
|
*(SendBuffer + 0x29) = (BMS_FtCode & 0xFF); // uint8 故障码,见BMS_ErrCode,精度_1,偏移量_0,单位_
|
|
*(SendBuffer + 0x29) = (BMS_FtCode & 0xFF); // uint8 故障码,见BMS_ErrCode,精度_1,偏移量_0,单位_
|