|
@@ -119,20 +119,6 @@ void Uart_4G_Task(void *pvParameters)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case PROCESS_TCP_ATSYS:
|
|
|
|
- {
|
|
|
|
- sint8 ATRet = -1;
|
|
|
|
- AtcmdTransmit(AT_CMD_TEST, NULL, 0, &ATRet, 100);
|
|
|
|
- if (ATRet == 0)
|
|
|
|
- {
|
|
|
|
- PROC_TCP_STATE_SWITCH(PROCESS_TCP_IDLE);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- PROC_TCP_STATE_SWITCH(PROCESS_TCP_ERROR);
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
case PROCESS_TCP_REGCHK: // 驻网检查,包括SIM,CPIN检查,ICCID获取
|
|
case PROCESS_TCP_REGCHK: // 驻网检查,包括SIM,CPIN检查,ICCID获取
|
|
{
|
|
{
|
|
RegChkRet = TcpRegisterChkFunc();
|
|
RegChkRet = TcpRegisterChkFunc();
|
|
@@ -155,6 +141,7 @@ void Uart_4G_Task(void *pvParameters)
|
|
if (ConnectRet > 0)
|
|
if (ConnectRet > 0)
|
|
{
|
|
{
|
|
PROC_TCP_STATE_SWITCH(PROCESS_TCP_IDLE);
|
|
PROC_TCP_STATE_SWITCH(PROCESS_TCP_IDLE);
|
|
|
|
+ TcpSendTimeCounter = 0;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -181,8 +168,6 @@ void Uart_4G_Task(void *pvParameters)
|
|
}
|
|
}
|
|
case PROCESS_TCP_RECV: // 网络数据接收,100ms空闲状态下即可接收
|
|
case PROCESS_TCP_RECV: // 网络数据接收,100ms空闲状态下即可接收
|
|
{
|
|
{
|
|
- // Dio_FlipChannel(DioConf_DioChannel_PTE0_GPIO_OUT_MCU_LED1);
|
|
|
|
-
|
|
|
|
if (pReadLen > 0 && SocketId >= 0)
|
|
if (pReadLen > 0 && SocketId >= 0)
|
|
{
|
|
{
|
|
TcpDataInfoRecvHandle(UartRecvPtr, pReadLen);
|
|
TcpDataInfoRecvHandle(UartRecvPtr, pReadLen);
|
|
@@ -771,7 +756,7 @@ void TcpDataEncode(uint32 *PtrSendAddr, uint16 *SendLen)
|
|
static UTC8TimeType UTC8TimeTcp;
|
|
static UTC8TimeType UTC8TimeTcp;
|
|
uint8 *SendBuffer = NULL;
|
|
uint8 *SendBuffer = NULL;
|
|
uint8 DataIdx = 0;
|
|
uint8 DataIdx = 0;
|
|
- if ((TcpSendTimeCounter) % (10 * 60) == 1)
|
|
|
|
|
|
+ if ((TcpSendTimeCounter) % (60 * 60) == 1)
|
|
{
|
|
{
|
|
DataIdx = VerMsg; // 版本信息发送
|
|
DataIdx = VerMsg; // 版本信息发送
|
|
}
|
|
}
|
|
@@ -1072,18 +1057,6 @@ void TcpDataEncode(uint32 *PtrSendAddr, uint16 *SendLen)
|
|
case 0x91:
|
|
case 0x91:
|
|
{
|
|
{
|
|
GetCSQValue(&CSQValue);
|
|
GetCSQValue(&CSQValue);
|
|
- if (BMS_Mode == 1)
|
|
|
|
- {
|
|
|
|
- BMS_Mode = 2;
|
|
|
|
- }
|
|
|
|
- else if (BMS_Mode == 2)
|
|
|
|
- {
|
|
|
|
- BMS_Mode = 3;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- BMS_Mode = 1;
|
|
|
|
- }
|
|
|
|
*SendLen = 0x54 + min(BMS_CellTotal, BMS_CELL_MAX_NUM) * 2 + min(BMS_TempTotal, BMS_TEMP_MAX_NUM);
|
|
*SendLen = 0x54 + min(BMS_CellTotal, BMS_CELL_MAX_NUM) * 2 + min(BMS_TempTotal, BMS_TEMP_MAX_NUM);
|
|
SendBuffer = pvPortMalloc(*SendLen);
|
|
SendBuffer = pvPortMalloc(*SendLen);
|
|
*(SendBuffer + 0) = TCP_START_SYM1;
|
|
*(SendBuffer + 0) = TCP_START_SYM1;
|