[PATCH 2/2] Added cmdline message when gpsd support is not compiled.
Dario Lombardo
dario.lombardo at libero.it
Tue Mar 1 10:18:29 CET 2011
---
src/host/layer23/src/misc/app_cell_log.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/host/layer23/src/misc/app_cell_log.c b/src/host/layer23/src/misc/app_cell_log.c
index 7030abf..92fc4c0 100644
--- a/src/host/layer23/src/misc/app_cell_log.c
+++ b/src/host/layer23/src/misc/app_cell_log.c
@@ -110,10 +110,8 @@ static int l23_cfg_print_help()
printf(" -l --logfile LOGFILE Logfile for the cell log.\n");
printf(" -r --rach RACH Nr. of RACH bursts to send.\n");
printf(" -n --no-rach Send no rach bursts.\n");
-#ifdef _HAVE_GPSD
printf(" -g --gpsd-host HOST 127.0.0.1. gpsd host.\n");
printf(" -p --port PORT 2947. gpsd port\n");
-#endif
printf(" -f --gps DEVICE /dev/ttyACM0. GPS serial device.\n");
printf(" -b --baud BAUDRAT The baud rate of the GPS device\n");
@@ -132,8 +130,8 @@ static int l23_cfg_handle(int c, const char *optarg)
case 'n':
RACH_MAX = 0;
break;
-#ifdef _HAVE_GPSD
case 'g':
+#ifdef _HAVE_GPSD
snprintf(g.gpsd_host, ARRAY_SIZE(g.gpsd_host), "%s", optarg);
/* force string terminator */
g.gpsd_host[ARRAY_SIZE(g.gpsd_host) - 1] = '\0';
@@ -141,15 +139,23 @@ static int l23_cfg_handle(int c, const char *optarg)
goto cmd_line_error;
g.gps_type = GPS_TYPE_GPSD;
LOGP(DGPS, LOGL_INFO, "Using gpsd host %s\n", g.gpsd_host);
+#else
+ printf("Gpsd support not compiled.\n");
+ exit(1);
+#endif
break;
case 'p':
+#ifdef _HAVE_GPSD
snprintf(g.gpsd_port, ARRAY_SIZE(g.gpsd_port), "%s", optarg);
/* force string terminator */
g.gpsd_port[ARRAY_SIZE(g.gpsd_port) - 1] = '\0';
g.gps_type = GPS_TYPE_GPSD;
LOGP(DGPS, LOGL_INFO, "Using gpsd port %s\n", g.gpsd_port);
+#else
+ printf("Gpsd support not compiled.\n");
+ exit(1);
+#endif
break;
-#endif
case 'f':
snprintf(g.device, ARRAY_SIZE(g.device), "%s", optarg);
/* force string terminator */
@@ -174,11 +180,7 @@ cmd_line_error:
static struct l23_app_info info = {
.copyright = "Copyright (C) 2010 Andreas Eversberg\n",
- .getopt_string =
-#ifdef _HAVE_GPSD
- "g:p:"
-#endif
- "l:r:nf:b:",
+ .getopt_string = "g:p:l:r:nf:b:",
.cfg_supported = l23_cfg_supported,
.cfg_getopt_opt = l23_getopt_options,
.cfg_handle_opt = l23_cfg_handle,
--
1.7.4
--------------000704030406060303040102--
More information about the baseband-devel
mailing list