aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-16 11:17:41 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-16 15:09:22 +0100
commit69897d7eed6dc2f992db3499bf9bfe0950f0b34a (patch)
tree3f405b3db4f7bbe557385d2a5cfeee5a1b674049
parent0d09e75f9ca09ddbfe10117f2f4caa8993eb9144 (diff)
sysmobts: Don't list non integer parameters in the help
The command can only read integer parameters. Don't offer buffers as this will lead to error 22.
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_par.c18
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_par.h2
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_util.c5
3 files changed, 23 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_par.c b/src/osmo-bts-sysmo/misc/sysmobts_par.c
index c431330..d3d9e26 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_par.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_par.c
@@ -99,6 +99,24 @@ static int set_eeprom(struct sysmobts_eeprom *ee)
return 0;
}
+int sysmobts_par_is_int(enum sysmobts_par par)
+{
+ switch (par) {
+ case SYSMOBTS_PAR_CLK_FACTORY:
+ case SYSMOBTS_PAR_TEMP_DIG_MAX:
+ case SYSMOBTS_PAR_TEMP_RF_MAX:
+ case SYSMOBTS_PAR_SERNR:
+ case SYSMOBTS_PAR_HOURS:
+ case SYSMOBTS_PAR_BOOTS:
+ case SYSMOBTS_PAR_MODEL_NR:
+ case SYSMOBTS_PAR_MODEL_FLAGS:
+ case SYSMOBTS_PAR_TRX_NR:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
int sysmobts_par_get_int(enum sysmobts_par par, int *ret)
{
struct sysmobts_eeprom *ee = get_eeprom(0);
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_par.h b/src/osmo-bts-sysmo/misc/sysmobts_par.h
index d5914e9..6480322 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_par.h
+++ b/src/osmo-bts-sysmo/misc/sysmobts_par.h
@@ -27,4 +27,6 @@ int sysmobts_par_get_buf(enum sysmobts_par par, uint8_t *buf,
int sysmobts_par_set_buf(enum sysmobts_par par, const uint8_t *buf,
unsigned int size);
+int sysmobts_par_is_int(enum sysmobts_par par);
+
#endif
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_util.c b/src/osmo-bts-sysmo/misc/sysmobts_util.c
index 9fdbb76..611e96f 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_util.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_util.c
@@ -43,9 +43,10 @@ static void print_help()
printf("sysmobts-util [-r | -w value] param_name\n");
printf("Possible param names:\n");
- while (par->str != NULL) {
+ for (; par->str != NULL; par += 1) {
+ if (!sysmobts_par_is_int(par->value))
+ continue;
printf(" %s\n", par->str);
- par += 1;
}
}