Use variable UDP port for map.
This commit is contained in:
parent
a70a50961f
commit
a6809b81fb
@ -119,7 +119,7 @@ Options:
|
|||||||
-i Disable ionospheric delay for spacecraft scenario
|
-i Disable ionospheric delay for spacecraft scenario
|
||||||
-v Show details about simulated channels
|
-v Show details about simulated channels
|
||||||
-n <port> Use TCP connection to Gnuradio TCP-Source for realtime simulation.
|
-n <port> Use TCP connection to Gnuradio TCP-Source for realtime simulation.
|
||||||
-w Connect with map server(/mapserver/mapper.py) by udp on port 5678.
|
-w <port> Connect with map server(/mapserver/mapper.py) by UDP (default port 5678).
|
||||||
```
|
```
|
||||||
|
|
||||||
The user motion can be specified in either dynamic or static mode:
|
The user motion can be specified in either dynamic or static mode:
|
||||||
|
6
gpssim.c
6
gpssim.c
@ -1667,7 +1667,7 @@ void usage(void)
|
|||||||
" -i Disable ionospheric delay for spacecraft scenario\n"
|
" -i Disable ionospheric delay for spacecraft scenario\n"
|
||||||
" -v Show details about simulated channels\n"
|
" -v Show details about simulated channels\n"
|
||||||
" -n <port> Use TCP connect to Gnuradio TCP-Source for\n realtime simulation.\n"
|
" -n <port> 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",
|
" -w <port> Connect with map server(/mapserver/mapper.py) by UDP (default port 5678).\n",
|
||||||
(double)((USER_MOTION_SIZE)/10.0),(int)STATIC_MAX_DURATION);
|
(double)((USER_MOTION_SIZE)/10.0),(int)STATIC_MAX_DURATION);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1740,6 +1740,7 @@ int main(int argc, char *argv[])
|
|||||||
int webflag=0;
|
int webflag=0;
|
||||||
int sockc=0;
|
int sockc=0;
|
||||||
short port=1234;
|
short port=1234;
|
||||||
|
short mapport=5678;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Read options
|
// Read options
|
||||||
@ -1862,6 +1863,7 @@ int main(int argc, char *argv[])
|
|||||||
usesocket=true;
|
usesocket=true;
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
|
sscanf(optarg,"%hd",&mapport);
|
||||||
staticLocationMode = TRUE;
|
staticLocationMode = TRUE;
|
||||||
webflag=1;
|
webflag=1;
|
||||||
break;
|
break;
|
||||||
@ -1872,7 +1874,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if(webflag==1){
|
if(webflag==1){
|
||||||
pthread_t th;
|
pthread_t th;
|
||||||
pthread_create(&th,NULL,(void *)threadrecv,NULL);
|
pthread_create(&th,NULL,(void *)threadrecv,(void *)&mapport);
|
||||||
}
|
}
|
||||||
if(usesocket==1)
|
if(usesocket==1)
|
||||||
sockc=sockinit(port);
|
sockc=sockinit(port);
|
||||||
|
6
socket.c
6
socket.c
@ -62,10 +62,10 @@ int udprecv(int s,void *dataa,int siz){
|
|||||||
|
|
||||||
double llhr[3]={39.68,139,76};
|
double llhr[3]={39.68,139,76};
|
||||||
|
|
||||||
void threadrecv(){
|
void threadrecv(void *p){
|
||||||
printf("listing\n");
|
printf("listing\n");
|
||||||
short p=5678;
|
short port=*(short*)p;
|
||||||
int s=udpinit(p);
|
int s=udpinit(port);
|
||||||
while(1){
|
while(1){
|
||||||
udprecv(s,llhr,3*sizeof(double));
|
udprecv(s,llhr,3*sizeof(double));
|
||||||
//printf("%lf%lf%lf\n",llhr[0],llhr[1],llhr[2]);
|
//printf("%lf%lf%lf\n",llhr[0],llhr[1],llhr[2]);
|
||||||
|
Loading…
Reference in New Issue
Block a user