|
@@ -725,7 +725,7 @@ static void Can_Task(void* arg)
|
|
|
volatile bool Can_Flag=false;
|
|
|
PROC_CAN_STATE_SWITCH(PROCESS_CAN_STATE_IDLE);
|
|
|
posGGAServiceStart(GGACallBack);
|
|
|
-
|
|
|
+ posGGAReset();
|
|
|
while(1)
|
|
|
{
|
|
|
switch(gProcess_Can_Task)
|
|
@@ -746,10 +746,11 @@ static void Can_Task(void* arg)
|
|
|
}
|
|
|
osMessageQueueGet(gpsMsgQueue, &Gps_Data, 0, 1000);
|
|
|
#ifdef USING_PRINTF
|
|
|
- printf("Gpsmsgqueue: %d,%d,%d,%d\r\n\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
|
|
|
-
|
|
|
-
|
|
|
+ #ifdef BL_FILE_LOG
|
|
|
+ bluejoy_printf(BL_LEVEL3,"Gpsmsgqueue: %d,%d,%d,%d\r\n",Gps_Data.latitude,Gps_Data.longitude,Gps_Data.speed,Gps_Data.direction);
|
|
|
+ #endif
|
|
|
//can采用先接收后发送的策略
|
|
|
HAL_Can_Receive(Can_Rece_buffer);
|
|
|
if (Can_Rece_buffer[0]!=0xff)//满足can发送使能
|
|
@@ -1232,7 +1233,7 @@ static void Tcp_Task(void* arg)
|
|
|
printf("TCP connect unresolved dns\n");
|
|
|
#endif
|
|
|
#ifdef BL_FILE_LOG
|
|
|
- bluejoy_printf(BL_LEVEL3,"TCP connect unresolved dns\n");
|
|
|
+ //bluejoy_printf(BL_LEVEL3,"TCP connect unresolved dns\n");
|
|
|
#endif
|
|
|
}
|
|
|
Tcp_statuts=2;
|
|
@@ -1250,7 +1251,7 @@ static void Tcp_Task(void* arg)
|
|
|
printf("socket create error\n");
|
|
|
#endif
|
|
|
#ifdef BL_FILE_LOG
|
|
|
- bluejoy_printf(BL_LEVEL3,"socket create error\n");
|
|
|
+ //bluejoy_printf(BL_LEVEL3,"socket create error\n");
|
|
|
#endif
|
|
|
Tcp_statuts=1;
|
|
|
}
|
|
@@ -1277,7 +1278,7 @@ static void Tcp_Task(void* arg)
|
|
|
if(Reconnect_Num>=20)
|
|
|
{
|
|
|
#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
|
|
|
appSetCFUN(0);
|
|
|
osDelay(10);
|
|
@@ -1339,29 +1340,29 @@ static void Tcp_Task(void* arg)
|
|
|
*(TcpSendBuffer+23) = data_index;//数据长度
|
|
|
memcpy(TcpSendBuffer+24,battbuffer,data_index);
|
|
|
*(TcpSendBuffer+NB_send_len-1) = bcc_chk(TcpSendBuffer,NB_send_len-1);
|
|
|
- #ifdef USING_PRINTF
|
|
|
- printf("battbuffer:");
|
|
|
- for (int i = 0; i < data_index; i++)
|
|
|
- {
|
|
|
- printf("%x ",battbuffer[i]);
|
|
|
- }
|
|
|
- printf("\n");
|
|
|
- #endif
|
|
|
+ // #ifdef USING_PRINTF
|
|
|
+ // printf("battbuffer:");
|
|
|
+ // for (int i = 0; i < data_index; i++)
|
|
|
+ // {
|
|
|
+ // printf("%x ",battbuffer[i]);
|
|
|
+ // }
|
|
|
+ // printf("\n");
|
|
|
+ //#endif
|
|
|
TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
//发送失败
|
|
|
- #ifdef USING_PRINTF
|
|
|
- printf("ConnectID:%d,TcpSend:%d,data length:%d,Data: ",sockfd,TcpsendID,NB_send_len);
|
|
|
- for (int i = 0; i < NB_send_len; i++)
|
|
|
- {
|
|
|
- printf("%x ",*(TcpSendBuffer+i));
|
|
|
- }
|
|
|
- printf("\n");
|
|
|
- #endif
|
|
|
+ // #ifdef USING_PRINTF
|
|
|
+ // printf("ConnectID:%d,TcpSend:%d,data length:%d,Data: ",sockfd,TcpsendID,NB_send_len);
|
|
|
+ // for (int i = 0; i < NB_send_len; i++)
|
|
|
+ // {
|
|
|
+ // printf("%x ",*(TcpSendBuffer+i));
|
|
|
+ // }
|
|
|
+ // printf("\n");
|
|
|
+ // #endif
|
|
|
free(TcpSendBuffer);
|
|
|
if (TcpsendID<0)
|
|
|
{
|
|
|
#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
|
|
|
closesocket(sockfd);
|
|
|
TcpconnectID = -1;
|
|
@@ -1391,14 +1392,14 @@ static void Tcp_Task(void* arg)
|
|
|
*(TcpSendBuffer+23) = data_index;//数据长度
|
|
|
memcpy(TcpSendBuffer+24,gpsbuffer,data_index);
|
|
|
*(TcpSendBuffer+NB_send_len-1) = bcc_chk(TcpSendBuffer,NB_send_len-1);
|
|
|
- #ifdef USING_PRINTF
|
|
|
- printf("ConnectID:%d,TcpSend:%d,data length:%d,Data: ",sockfd,TcpsendID,NB_send_len);
|
|
|
- for (int i = 0; i < NB_send_len; i++)
|
|
|
- {
|
|
|
- printf("%x ",*(TcpSendBuffer+i));
|
|
|
- }
|
|
|
- printf("\n");
|
|
|
- #endif
|
|
|
+ // #ifdef USING_PRINTF
|
|
|
+ // printf("ConnectID:%d,TcpSend:%d,data length:%d,Data: ",sockfd,TcpsendID,NB_send_len);
|
|
|
+ // for (int i = 0; i < NB_send_len; i++)
|
|
|
+ // {
|
|
|
+ // printf("%x ",*(TcpSendBuffer+i));
|
|
|
+ // }
|
|
|
+ // printf("\n");
|
|
|
+ // #endif
|
|
|
TcpsendID = send(sockfd, TcpSendBuffer, NB_send_len, 0 );
|
|
|
free(TcpSendBuffer);
|
|
|
if (TcpsendID<0)
|