|
@@ -755,9 +755,6 @@ static void Can_Task(void* arg)
|
|
#ifdef USING_PRINTF
|
|
#ifdef USING_PRINTF
|
|
printf("Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
|
|
printf("Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
|
|
#endif
|
|
#endif
|
|
- #ifdef BL_FILE_LOG
|
|
|
|
- bluejoy_printf(BL_LEVEL3,"Gpsmsg: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
|
|
|
|
- #endif
|
|
|
|
//can采用先接收后发送的策略
|
|
//can采用先接收后发送的策略
|
|
HAL_Can_Receive(Can_Rece_buffer);
|
|
HAL_Can_Receive(Can_Rece_buffer);
|
|
if (Can_Rece_buffer[0]!=0xff)//满足can发送使能
|
|
if (Can_Rece_buffer[0]!=0xff)//满足can发送使能
|
|
@@ -1240,7 +1237,7 @@ static void Tcp_Task(void* arg)
|
|
printf("TCP connect unresolved dns\n");
|
|
printf("TCP connect unresolved dns\n");
|
|
#endif
|
|
#endif
|
|
#ifdef BL_FILE_LOG
|
|
#ifdef BL_FILE_LOG
|
|
- //bluejoy_printf(BL_LEVEL3,"TCP connect unresolved dns\n");
|
|
|
|
|
|
+ bluejoy_printf(BL_LEVEL3,"TCP connect unresolved dns\n");
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
Tcp_statuts=2;
|
|
Tcp_statuts=2;
|
|
@@ -1258,7 +1255,7 @@ static void Tcp_Task(void* arg)
|
|
printf("socket create error\n");
|
|
printf("socket create error\n");
|
|
#endif
|
|
#endif
|
|
#ifdef BL_FILE_LOG
|
|
#ifdef BL_FILE_LOG
|
|
- //bluejoy_printf(BL_LEVEL3,"socket create error\n");
|
|
|
|
|
|
+ bluejoy_printf(BL_LEVEL3,"socket create error\n");
|
|
#endif
|
|
#endif
|
|
Tcp_statuts=1;
|
|
Tcp_statuts=1;
|
|
}
|
|
}
|
|
@@ -1285,7 +1282,7 @@ static void Tcp_Task(void* arg)
|
|
if(Reconnect_Num>=20)
|
|
if(Reconnect_Num>=20)
|
|
{
|
|
{
|
|
#ifdef BL_FILE_LOG
|
|
#ifdef BL_FILE_LOG
|
|
- //bluejoy_printf(BL_LEVEL3,"20 Connect failed!%d,Reconnect:%d\n",TcpconnectID,Reconnect_Num);
|
|
|
|
|
|
+ bluejoy_printf(BL_LEVEL3,"20 Connect failed!%d,Reconnect:%d\n",TcpconnectID,Reconnect_Num);
|
|
#endif
|
|
#endif
|
|
appSetCFUN(0);
|
|
appSetCFUN(0);
|
|
osDelay(10);
|
|
osDelay(10);
|
|
@@ -1369,7 +1366,7 @@ static void Tcp_Task(void* arg)
|
|
if (TcpsendID<0)
|
|
if (TcpsendID<0)
|
|
{
|
|
{
|
|
#ifdef BL_FILE_LOG
|
|
#ifdef BL_FILE_LOG
|
|
- //bluejoy_printf(BL_LEVEL3,"send failed,ConnectID:%d,TcpSend:%d,data length:%d\n",sockfd,TcpsendID,NB_send_len);
|
|
|
|
|
|
+ bluejoy_printf(BL_LEVEL3,"send failed,ConnectID:%d,TcpSend:%d,data length:%d\n",sockfd,TcpsendID,NB_send_len);
|
|
#endif
|
|
#endif
|
|
closesocket(sockfd);
|
|
closesocket(sockfd);
|
|
TcpconnectID = -1;
|
|
TcpconnectID = -1;
|
|
@@ -1407,7 +1404,10 @@ static void Tcp_Task(void* arg)
|
|
// }
|
|
// }
|
|
// printf("\n");
|
|
// printf("\n");
|
|
// #endif
|
|
// #endif
|
|
- TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
|
|
|
+ if(gpsbuffer[13]==0x01)
|
|
|
|
+ {
|
|
|
|
+ TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
|
+ }
|
|
free(TcpSendBuffer);
|
|
free(TcpSendBuffer);
|
|
if (TcpsendID<0)
|
|
if (TcpsendID<0)
|
|
{
|
|
{
|