Переглянути джерело

1.修改控制回传逻辑
2.修改服务器地址
3.修改版本编号为:1213

CHENJIE-PC\QiXiang_CHENJIE 4 роки тому
батько
коміт
c7bd4f1770
3 змінених файлів з 14 додано та 13 видалено
  1. 4 4
      inc/TcpTask.h
  2. 1 1
      inc/app.h
  3. 9 8
      src/TcpTask.c

+ 4 - 4
inc/TcpTask.h

@@ -19,13 +19,13 @@ extern UINT32 TcpService;
 #define APP_EVENT_QUEUE_SIZE    (10)
 
 
-// #define QX_TCP_IPADRRES				"47.97.127.222"
-// #define QX_TCP_PORT					8712
+#define QX_TCP_IPADRRES				"47.97.127.222"
+#define QX_TCP_PORT					8712
 /*---------------测试IP地址-----------------------------------*/
 // #define QX_TCP_IPADRRES				"39.103.177.126"
 // #define QX_TCP_PORT					8712
-#define QX_TCP_IPADRRES				"120.26.68.165"
-#define QX_TCP_PORT					14319
+// #define QX_TCP_IPADRRES				"120.26.68.165"
+// #define QX_TCP_PORT					14319
 /*---------------测试IP地址END-----------------------------------*/
 #define BATT_SN_LEN             17
 #define TCP_START_SYM1			0x23

+ 1 - 1
inc/app.h

@@ -34,7 +34,7 @@ extern "C" {
 #define HWVERSION		    0x0102    //硬件主版本,现为V1.2板
 #define	BLSWVERSION		0x01020000    //BootLoader版本号V1.2.0.0
 #define	DRVSWVERSION		0x01030000     //驱动层版本号V1.3.0.0
-#define	APPSWVERSION		0x01020102      
+#define	APPSWVERSION		0x01020103      
 
 //--------------------------------------------------------------------------------
 

+ 9 - 8
src/TcpTask.c

@@ -457,6 +457,13 @@ static void TcpDataInfoRecvHandle()
                 else if(*(Ptr+30)==0x80)//远程锁定命令
                 {
                     osMutexAcquire(UartMutex, osWaitForever);
+                    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);
                     if(*(Ptr+31)==0x01)//0x01代表锁定
                     {
                         AppNVMData.appDataModify = TRUE;
@@ -467,6 +474,7 @@ static void TcpDataInfoRecvHandle()
                         if((UartReadMsg.data[(0x03+BATT_CELL_VOL_NUM)*2+1]&0x03)==0x00)
                         {
                             osMessageQueuePut(UartWriteCmdHandle,&UartWriteCmd,0,1000);
+                            tcpipConnectionSend(socContext.id,TcpCmdAnswer,31,0,0,0);
                         }
                     }
                     else                //0x02代表解锁
@@ -477,16 +485,9 @@ static void TcpDataInfoRecvHandle()
                         UartWriteCmd.Data[0] = 0x00;
                         UartWriteCmd.Data[1] = 0x03;
                         osMessageQueuePut(UartWriteCmdHandle,&UartWriteCmd,0,1000);
+                        tcpipConnectionSend(socContext.id,TcpCmdAnswer,31,0,0,0);
                     }
-                    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);
                     osMutexRelease(UartMutex);
-                    tcpipConnectionSend(socContext.id,TcpCmdAnswer,31,0,0,0);
                     TcpService=0x00;
                     
                 }