From 1fcd35fc0d3a06d3df052581b19a1e2dda15256e Mon Sep 17 00:00:00 2001 From: QingBiJuShi Date: Tue, 9 Apr 2019 12:30:38 +0800 Subject: [PATCH 1/3] Update gpssim.c Support realtime with user command input file/point. --- gpssim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gpssim.c b/gpssim.c index dde6f09..e35efb8 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1850,9 +1850,11 @@ int main(int argc, char *argv[]) sscanf(optarg,"%hd",&port); usesocket=true; + break; case 'w': staticLocationMode = TRUE; webflag=1; + break; default: break; From 56616721b371a714d215cebf8e9b0a2ccd1acc77 Mon Sep 17 00:00:00 2001 From: gym487 Date: Tue, 25 Jun 2019 20:43:27 +0800 Subject: [PATCH 2/3] fix --- gpssim.c | 6 +++--- socket.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gpssim.c b/gpssim.c index e35efb8..988d5ff 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1661,10 +1661,10 @@ void usage(void) " -s Sampling frequency [Hz] (default: 2600000)\n" " -b I/Q data format [1/8/16] (default: 16)\n" " -i Disable ionospheric delay for spacecraft scenario\n" - " -v Show details about simulated channels\n", - " -n Use TCP connect to Gnuradio TCP-Source for\n realtime simulation.\n", + " -v Show details about simulated channels\n" + " -n Use TCP connect to Gnuradio TCP-Source for\n realtime simulation.\n" "-w Connect with map server(/mapserver/mapper.py) by udp on port 5678.\n", - (USER_MOTION_SIZE)/10.0,STATIC_MAX_DURATION); + (double)((USER_MOTION_SIZE)/10.0),(int)STATIC_MAX_DURATION); return; } diff --git a/socket.c b/socket.c index 1e23858..3076989 100644 --- a/socket.c +++ b/socket.c @@ -8,7 +8,7 @@ #include #include #include - +#include @@ -57,10 +57,10 @@ int udpinit(short port){ } int udprecv(int s,void *dataa,int siz){ struct sockaddr from; - return recvfrom(s, dataa, siz, 0,&from,sizeof(from)); + return recvfrom(s, dataa, siz, 0,&from,0); } -double llhr[3]={39.68,139,76,10}; +double llhr[3]={39.68,139,76}; void threadrecv(){ printf("listing\n"); From 54e14ad331bcd24d1709e6c0e808ffcf2ec0b506 Mon Sep 17 00:00:00 2001 From: gym487 Date: Tue, 25 Jun 2019 20:48:33 +0800 Subject: [PATCH 3/3] fix README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea51344..ba536b3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ to RF using software-defined radio (SDR) platforms, such as ### Building with GCC ``` -$ gcc gpssim.c -lm -O3 -o gps-sdr-sim +$ gcc gpssim.c -lm -lpthread -O3 -o gps-sdr-sim ``` ### Realtime by Gnuradio