aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-04-16 19:10:44 +0200
committerHarald Welte <laforge@gnumonks.org>2012-04-19 09:38:30 +0200
commitf1052b812deb55f9645ae2b7cdf1fa7313599c28 (patch)
tree165ba963d4a90ba91eaa83c0cf79b470e5754ef9 /src/osmo-bts-sysmo/main.c
parent0be33e3add129843ae1c519477e5904b0330f315 (diff)
sysmobts: Add an option to query the hardware version.
Diffstat (limited to 'src/osmo-bts-sysmo/main.c')
-rw-r--r--src/osmo-bts-sysmo/main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index cf600481..45588449 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -103,9 +103,19 @@ static void print_help()
" -V --version Print version information and exit\n"
" -e --log-level Set a global log-level\n"
" -p --dsp-trace Set DSP trace flags\n"
+ " -w --hw-version Print the targeted HW Version\n"
);
}
+static void print_hwversion()
+{
+#ifdef HW_FEMTOBTS
+ printf("sysmobts was compiled for hw version 1.\n");
+#else
+ printf("sysmobts was compiled for hw version 2.\n");
+#endif
+}
+
/* FIXME: finally get some option parsing code into libosmocore */
static void handle_options(int argc, char **argv)
{
@@ -122,10 +132,11 @@ static void handle_options(int argc, char **argv)
{ "version", 0, 0, 'V' },
{ "log-level", 1, 0, 'e' },
{ "dsp-trace", 1, 0, 'p' },
+ { "hw-version", 0, 0, 'w' },
{ 0, 0, 0, 0 }
};
- c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:",
+ c = getopt_long(argc, argv, "hc:d:Dc:sTVe:p:w",
long_options, &option_idx);
if (c == -1)
break;
@@ -160,6 +171,10 @@ static void handle_options(int argc, char **argv)
case 'p':
dsp_trace = strtoul(optarg, NULL, 16);
break;
+ case 'w':
+ print_hwversion();
+ exit(0);
+ break;
default:
break;
}