chen
2025-02-26 acce179c49a6a9c625e9402e6f9046d1325ffcea
keil/include/src/TCPClient.c
@@ -74,7 +74,7 @@
uint16_t receive_id;
uint16_t g_com_position;
uint16_t g_com_num;
int16_t beepontime;
HIDO_UINT8 *_u8Data_temp1=NULL;
HIDO_UINT32 _u32Len_temp;
extern int32_t distance;
@@ -83,6 +83,7 @@
extern uint32_t u32GGaLenth;
extern char GGA_Final_message[1024];
extern uint32_t gga_num;
uint8_t beep_start_flag;
static HIDO_INT32 TCPClient_DataProc(HIDO_UINT8 *_u8Data, HIDO_UINT32 _u32Len)
{
    HIDO_CHAR *apcSplitStr[12];
@@ -202,7 +203,22 @@
            }
               Socket_Send(l_i32TCPClientID, (HIDO_UINT8 *)acReadponse, u32ReadResponseLen);
        }
    }
    }else if(STRCMP(_u8Data, "$control,") == 0)
      {
          u32SplitCnt = HIDO_UtilStrSplit((HIDO_CHAR *)_u8Data, ',', apcSplitStr, HIDO_ARRARY_COUNT(apcSplitStr));
        receive_id = HIDO_UtilHexStrToInt(apcSplitStr[1]);
       /* 设备ID开启震动 */
        if(receive_id == g_com_map[DEV_ID])
        {
            if(strcmp(apcSplitStr[2],"beeper")==0)
            {
                   beepontime = HIDO_UtilStrToInt(apcSplitStr[3]);
                    if(beepontime>0)
                              beep_start_flag=1;
            }
            }
      }
    return HIDO_OK;
}
@@ -297,13 +313,15 @@
//                               g_com_map[DEV_ID],GetUWBBindState(),g_com_map[BIND_DEV_ID],alarm_type,bat_percent,g_com_map[ALARM_DISTANCE1],g_com_map[ALARM_DISTANCE2],jd,wd,applyid,result,distance);
//    }
   
   u32HeartLen = snprintf(acHeart, sizeof(acHeart), "%s,%04x,%02u%%,%d,%d,0,0\r\n", \
   u32HeartLen = snprintf(acHeart, sizeof(acHeart), "%s,%04x,%x,%d,%d,0,0\r\n", \
                               GPS_GGAmessage,g_com_map[DEV_ID],bat_percent,userkey_state,gps_timeout_flag);
   
      
   if(gps_open_flag||userkey_state){
   if(gps_open_flag&&userkey_state!=1){
      Socket_Send(l_i32TCPClientID, (HIDO_UINT8 *)acHeart, u32HeartLen);
   }else{
   }
   if (userkey_state){
      TCPHeartBeatUpload();//立即上传心跳包
//     Socket_Send(l_i32TCPClientID, (HIDO_UINT8 *)GGA_Final_message, u32GGaLenth);
//      memset(GGA_Final_message, 0, sizeof(GGA_Final_message));//清空接收到的用完的数组
//      u32GGaLenth=0;