aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-31 22:16:00 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-31 22:38:48 +0100
commit4e13a8f9f9d40e5d62c9cee7d76348ef8b558981 (patch)
tree71a31d8620d449137fda631a4dc6719eea6d82ec /openbsc/src/libbsc/bsc_vty.c
parentb8c204cb929a8455bfa6006a95a958d57274ab08 (diff)
bsc/nitb: Allow to set the GPRS mode through the ctrl command
Create a control command to read and modify the gprs mode. Use the get_string_value to indicate if the value was found or not. This is useful for the ctrl interface where I didn't want to replicate "none", "gprs" and "egprs". Share code to verify that a BTS supports the mode. Related: SYS#591
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 2857494eb..588be267f 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -2500,16 +2500,9 @@ DEFUN(cfg_bts_gprs_mode, cfg_bts_gprs_mode_cmd,
"EGPRS (EDGE) Enabled on this BTS\n")
{
struct gsm_bts *bts = vty->index;
- enum bts_gprs_mode mode = bts_gprs_mode_parse(argv[0]);
+ enum bts_gprs_mode mode = bts_gprs_mode_parse(argv[0], NULL);
- if (mode != BTS_GPRS_NONE &&
- !gsm_bts_has_feature(bts, BTS_FEAT_GPRS)) {
- vty_out(vty, "This BTS type does not support %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- if (mode == BTS_GPRS_EGPRS &&
- !gsm_bts_has_feature(bts, BTS_FEAT_EGPRS)) {
+ if (!bts_gprs_mode_is_compat(bts, mode)) {
vty_out(vty, "This BTS type does not support %s%s", argv[0],
VTY_NEWLINE);
return CMD_WARNING;