|
@@ -351,8 +351,8 @@ static void Main_Task(void* arg)
|
|
|
if(!slpManDeepSlpTimerIsRunning(deepslpTimerID))
|
|
|
{
|
|
|
slpManDeepSlpTimerDel(deepslpTimerID);
|
|
|
- slpManDeepSlpTimerStart(deepslpTimerID, Sleep_Time);
|
|
|
}
|
|
|
+ slpManDeepSlpTimerStart(deepslpTimerID, Sleep_Time);
|
|
|
osDelay(60000/portTICK_PERIOD_MS);
|
|
|
}
|
|
|
break;
|
|
@@ -1140,11 +1140,12 @@ void Tcp_Gps_Data_Assemble(void)
|
|
|
static void Tcp_Task(void* arg)
|
|
|
{
|
|
|
|
|
|
- CHAR SN[] = "GYTEST00000000001";//SN应写到osfile里面
|
|
|
+ CHAR SN[] = "GYTEST00000000002";//SN应写到osfile里面
|
|
|
CHAR serverip[] = "47.97.127.222";
|
|
|
CHAR serverport[] = "8712";
|
|
|
struct addrinfo hints, *server_res;
|
|
|
int TcpsendID = -1;
|
|
|
+ int TcprecvID = -1;
|
|
|
memset( &hints, 0, sizeof( hints ) );
|
|
|
hints.ai_socktype = SOCK_STREAM;
|
|
|
hints.ai_protocol = IPPROTO_TCP;
|
|
@@ -1154,6 +1155,7 @@ static void Tcp_Task(void* arg)
|
|
|
PROC_TCP_STATE_SWITCH(PROCESS_TCP_STATE_IDLE);
|
|
|
uint8_t Tcp_Index = 0;
|
|
|
uint8_t* TcpSendBuffer=NULL;
|
|
|
+ uint8_t* TcpRecvBuffer=NULL;
|
|
|
volatile bool Tcp_Flag=false;
|
|
|
eventCallbackMessage_t *queueItem = NULL;
|
|
|
uint8_t pmode;
|
|
@@ -1289,6 +1291,7 @@ static void Tcp_Task(void* arg)
|
|
|
{
|
|
|
NB_send_len=59+Batt_Cell_Num_2+Batt_Temp_Num;//电池数据长度
|
|
|
TcpSendBuffer = (uint8_t *)malloc(NB_send_len);
|
|
|
+ TcpRecvBuffer = (uint8_t *)malloc(NB_send_len);
|
|
|
data_index = 0;
|
|
|
memset(TcpSendBuffer,0x00,NB_send_len);
|
|
|
*(TcpSendBuffer+0) = 0x23;
|
|
@@ -1311,6 +1314,7 @@ static void Tcp_Task(void* arg)
|
|
|
printf("\n");
|
|
|
#endif
|
|
|
TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
+ TcprecvID = recv(sockfd, TcpRecvBuffer, NB_send_len, 0);
|
|
|
//发送失败
|
|
|
#ifdef USING_PRINTF
|
|
|
printf("ConnectID:%d,TcpSend:%d,data length:%d,Data: ",sockfd,TcpsendID,NB_send_len);
|
|
@@ -1319,8 +1323,15 @@ static void Tcp_Task(void* arg)
|
|
|
printf("%x ",*(TcpSendBuffer+i));
|
|
|
}
|
|
|
printf("\n");
|
|
|
+ printf("ConnectID:%d,TcpRecv:%d,data length:%d,Data: ",sockfd,TcprecvID,NB_send_len);
|
|
|
+ for (int i = 0; i < NB_send_len; i++)
|
|
|
+ {
|
|
|
+ printf("%x ",*(TcpRecvBuffer+i));
|
|
|
+ }
|
|
|
+ printf("\n");
|
|
|
#endif
|
|
|
free(TcpSendBuffer);
|
|
|
+ free(TcpRecvBuffer);
|
|
|
if (TcpsendID<0)
|
|
|
{
|
|
|
closesocket(sockfd);
|