|
@@ -38,7 +38,7 @@ UINT8 WorkFlag=0;
|
|
|
extern UINT32 Timer_count;
|
|
|
extern volatile BOOL Sleep_flag;
|
|
|
extern osMutexId_t GpsMutex;
|
|
|
-extern UINT8 GpsData[16];
|
|
|
+extern UINT8 GpsData[20];
|
|
|
extern AppNVMDataType AppNVMData;
|
|
|
extern AppDataBody AppDataInfo;
|
|
|
extern QueueHandle_t UartWriteCmdHandle;
|
|
@@ -113,7 +113,27 @@ static void TcpTask(void* arg)
|
|
|
case QMSG_ID_NW_IP_READY:
|
|
|
if(connectionId < 0)
|
|
|
{
|
|
|
- connectionId = tcpipConnectionCreate(TCPIP_CONNECTION_PROTOCOL_TCP, PNULL, 0, QX_TCP_IPADRRES, QX_TCP_PORT, socketAppConnectionCallBack);
|
|
|
+ struct addrinfo hints;
|
|
|
+ struct addrinfo *servinfo = NULL;
|
|
|
+ char *Tcp_ip_des;
|
|
|
+ memset(&hints, 0, sizeof(hints));
|
|
|
+ hints.ai_family = AF_INET;
|
|
|
+ hints.ai_socktype = SOCK_STREAM;
|
|
|
+ getaddrinfo(QX_TCP_ADD, NULL, &hints, &servinfo);
|
|
|
+ Tcp_ip_des = ip4addr_ntoa((const ip4_addr_t *)(&(servinfo->ai_addr->sa_data[2])));
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("\nservinfo-%d:\n",servinfo->ai_addr->sa_len);
|
|
|
+ for(int i=0;i<4;i++)
|
|
|
+ printf("%d ",servinfo->ai_addr->sa_data[2+i]);
|
|
|
+ printf("\nTcp_ip_des-%d:\n",sizeof(Tcp_ip_des));
|
|
|
+ for(int i=0;i<16;i++)
|
|
|
+ printf("%c",*(Tcp_ip_des+i));
|
|
|
+ #endif
|
|
|
+ connectionId = tcpipConnectionCreate(TCPIP_CONNECTION_PROTOCOL_TCP, PNULL, 0, Tcp_ip_des, QX_TCP_PORT, socketAppConnectionCallBack);
|
|
|
+ if (NULL != servinfo) {
|
|
|
+ freeaddrinfo(servinfo);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if(connectionId >= 0)
|
|
|
{
|