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 diff --git a/gpssim.c b/gpssim.c index dde6f09..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; } @@ -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; 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");