|
@@ -40,6 +40,7 @@ extern osMutexId_t UartMutex;
|
|
|
extern osMutexId_t GpsMutex;
|
|
|
extern UINT8 GpsData[16];
|
|
|
extern AppNVMDataType AppNVMData;
|
|
|
+extern QueueHandle_t UartWriteCmdHandle;
|
|
|
|
|
|
|
|
|
AppSocketConnectionContext socContext = {-1, APP_SOCKET_CONNECTION_CLOSED};
|
|
@@ -413,9 +414,13 @@ static void TcpDataInfoRecvHandle()
|
|
|
TcpipConnectionRecvDataInd *TcpRecvData;
|
|
|
osMessageQueueGet(TcpRecvHandle,&TcpRecvData,0,0);
|
|
|
osDelay(100);
|
|
|
+ Uart_Write_Data_Type UartWriteCmd;
|
|
|
UINT8 Tcp_Cmd;
|
|
|
UINT8 Control_Cmd;
|
|
|
UINT8 *Ptr;
|
|
|
+ UINT8 TcpCmdAnswer[31];
|
|
|
+ TcpCmdAnswer[0] = TCP_START_SYM1;
|
|
|
+ TcpCmdAnswer[1] = TCP_START_SYM1;
|
|
|
if(TcpRecvData != PNULL)
|
|
|
{
|
|
|
Ptr = TcpRecvData->data;
|
|
@@ -434,10 +439,41 @@ static void TcpDataInfoRecvHandle()
|
|
|
break;
|
|
|
case TCP_CONCMD_SYM:
|
|
|
{
|
|
|
+ TcpCmdAnswer[2] = TCP_CONCMD_SYM;
|
|
|
if(*(Ptr+30)==0x01)
|
|
|
{
|
|
|
Fota_Func(Ptr,socContext.id);
|
|
|
}
|
|
|
+ else if(*(Ptr+30)==0x80)
|
|
|
+ {
|
|
|
+ if(*(Ptr+31)==0x01)
|
|
|
+ {
|
|
|
+ AppNVMData.appDataModify = TRUE;
|
|
|
+ AppNVMData.isBattLocked = TRUE;
|
|
|
+ UartWriteCmd.WriteCmd = 0x01;
|
|
|
+ UartWriteCmd.Data[0] = 0x00;
|
|
|
+ UartWriteCmd.Data[1] = 0x00;
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AppNVMData.appDataModify = TRUE;
|
|
|
+ AppNVMData.isBattLocked = FALSE;
|
|
|
+ UartWriteCmd.WriteCmd = 0x01;
|
|
|
+ UartWriteCmd.Data[0] = 0x00;
|
|
|
+ UartWriteCmd.Data[1] = 0x03;
|
|
|
+ osMessageQueuePut(UartWriteCmdHandle,&UartWriteCmd,0,1000);
|
|
|
+ }
|
|
|
+
|
|
|
+ TcpCmdAnswer[3] = 0x01;
|
|
|
+ memcpy(&TcpCmdAnswer[4],(Ptr+4),BATT_SN_LEN);
|
|
|
+ TcpCmdAnswer[21] = TCP_ENCPT_DISABLE;
|
|
|
+ TcpCmdAnswer[22] = 0x00;
|
|
|
+ TcpCmdAnswer[23] = 0x06;
|
|
|
+ memcpy(&TcpCmdAnswer[24],(Ptr+24),6);
|
|
|
+ TcpCmdAnswer[30] = bcc_chk(TcpCmdAnswer,30);
|
|
|
+ tcpipConnectionSend(socContext.id,TcpCmdAnswer,31,0,0,0);
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
default:
|