diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-14 22:44:42 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-20 10:44:53 +0200 |
commit | f3d8e92731dbdc05ed4214ab9ff2bbb9189f42ad (patch) | |
tree | ad97765a9f61d7c5e3c1b01d04323784aebc91e0 /openbsc/src/bsc_vty.c | |
parent | a39b0f2bb7a7c8b97dc654a1ecdf3f58072a7fbb (diff) |
[BSC] introduce the concept of 'BTS features'
We can then check if a bts supports a certain feature or not.
Diffstat (limited to 'openbsc/src/bsc_vty.c')
-rw-r--r-- | openbsc/src/bsc_vty.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c index 5eacb22af..46a13d36a 100644 --- a/openbsc/src/bsc_vty.c +++ b/openbsc/src/bsc_vty.c @@ -1817,8 +1817,22 @@ 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]); - bts->gprs.mode = bts_gprs_mode_parse(argv[0]); + 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)) { + vty_out(vty, "This BTS type does not support %s%s", argv[0], + VTY_NEWLINE); + return CMD_WARNING; + } + + bts->gprs.mode = mode; return CMD_SUCCESS; } |