diff --git a/tools/reader/obreader.c b/tools/reader/obreader.c index 3c27997..9c46630 100644 --- a/tools/reader/obreader.c +++ b/tools/reader/obreader.c @@ -23,7 +23,7 @@ #define BUFSIZE 100 #define PORT 2342 -#define SRV_IP "127.0.0.1" +char *SRV_IP="127.0.0.1"; #define TYPE_UDP #undef TYPE_TCP @@ -253,7 +253,7 @@ int main(int argc, char ** argv){ time(&ot); /* The big getopt loop */ - while ((c = getopt(argc, argv, "d:")) != EOF) + while ((c = getopt(argc, argv, "s:d:")) != EOF) switch (c) { case 'd': @@ -261,6 +261,11 @@ int main(int argc, char ** argv){ strcpy(device,optarg); break; + case 's': + SRV_IP=(char *)malloc(strlen(optarg)+2); + strcpy(SRV_IP,optarg); + break; + default: fprintf(stderr, "Usage: %s [options] \n\n\ This program reads packets from an USB-Serial R0ket\n\