调整代码内容

This commit is contained in:
xu
2026-10-08 09:17:12 +08:00
parent 48fc4058d8
commit db40049993
7 changed files with 489 additions and 43 deletions
+37 -42
View File
@@ -125,9 +125,6 @@ int setup_lc6600(struct lc6600_param *pparam){
if(read_ok == NULL){
printf("can not exce AT+CFUN=1");
}
}
static long elapsed_ms(struct timeval *start, struct timeval *end)
@@ -275,8 +272,6 @@ int get_rx2_freq(char *rx2){
#endif
int main (int argc, char *argv[])
{
int n_read;
@@ -370,49 +365,49 @@ int main (int argc, char *argv[])
n_read = uart_read(ROUTE_UART, _rx_data);
printf("%s\n",_rx_data);
printf("%s\n",_rx_data);
#if 1
if(n_read > 10){
if(n_read > 10){
//ip_str=strstr(_rx_data,argv[2]);
//ip_str=strstr(_rx_data,"192.168.1.15");
//ip_len = strlen(ip_str);
//printf("ip_str %d \n ",ip_len);
ip_str=strstr(_rx_data,argv[2]);
ip_len = strlen(argv[2]);
if(ip_str){
//buffer_param[0] = 0x55;
//printf("ip_str %s \n ",ip_str);
memcpy(index,ip_str+(ip_len+2),1);
//printf("index %s \n ",index);
//ip_str=strstr(_rx_data,argv[2]);
//ip_str=strstr(_rx_data,"192.168.1.15");
//ip_len = strlen(ip_str);
//printf("ip_str %d \n ",ip_len);
ip_str=strstr(_rx_data,argv[2]);
ip_len = strlen(argv[2]);
if(ip_str){
//buffer_param[0] = 0x55;
//printf("ip_str %s \n ",ip_str);
memcpy(index,ip_str+(ip_len+2),1);
//printf("index %s \n ",index);
if(strcmp(index, "1") == 0){
memcpy(rssi1,ip_str+(ip_len+5),3);
dbm1 = atoi(rssi1);
printf("++dbm1:%d\n",dbm1);
buffer_param[1] = dbm1;
gettimeofday(&tv_rx1, NULL);
if(strcmp(index, "1") == 0){
memcpy(rssi1,ip_str+(ip_len+5),3);
dbm1 = atoi(rssi1);
printf("++dbm1:%d\n",dbm1);
buffer_param[1] = dbm1;
gettimeofday(&tv_rx1, NULL);
}
if(strcmp(index, "2") == 0){
memcpy(rssi2,ip_str+(ip_len+5),3);
dbm2 = atoi(rssi2);
printf("++dbm2:%d\n",dbm2);
buffer_param[2] = dbm2;
gettimeofday(&tv_rx2, NULL);
}
}else{
printf("no signal\n");
}
}
if(strcmp(index, "2") == 0){
memcpy(rssi2,ip_str+(ip_len+5),3);
dbm2 = atoi(rssi2);
printf("++dbm2:%d\n",dbm2);
buffer_param[2] = dbm2;
gettimeofday(&tv_rx2, NULL);
else{
printf("no \n");
uart_write(ROUTE_UART, "AT^DAPR=1\r");
// buffer_param[0] = 0xAA;
}
}else{
printf("no signal\n");
}
}
else{
printf("no \n");
uart_write(ROUTE_UART, "AT^DAPR=1\r");
// buffer_param[0] = 0xAA;
}
#endif
}