From 1c5dd2c9bbc26902cdad0487e090e97e983b0787 Mon Sep 17 00:00:00 2001 From: Gus Bourg Date: Fri, 2 Dec 2011 10:18:17 +0100 Subject: Add NITZ (timezone) support as part of MM INFO The UTC offset from the operating system will be used by default to calculate the NITZ in MM INFO. However, a "timezone" vty command is added at the BTS level, allowing BTS-specific overrides, e.g. in case BTSs are distributed accross multiple timezones. --- openbsc/src/libbsc/bsc_vty.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'openbsc/src/libbsc') diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 724486ff7..ed74397ec 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -448,6 +448,8 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) VTY_NEWLINE); vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE); vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE); + if (bts->tz_bts_specific != 0) + vty_out(vty, " timezone %d %d%s", bts->tzhr, bts->tzmn, VTY_NEWLINE); vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE); vty_out(vty, " cell reselection hysteresis %u%s", bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); @@ -1495,6 +1497,31 @@ DEFUN(cfg_bts_bsic, return CMD_SUCCESS; } +DEFUN(cfg_bts_timezone, + cfg_bts_timezone_cmd, + "timezone <-19-19> (0|15|30|45)", + "Set the Timezone Offset of this BTS\n") +{ + struct gsm_bts *bts = vty->index; + int tzhr = atoi(argv[0]); + int tzmn = atoi(argv[1]); + + bts->tzhr = tzhr; + bts->tzmn = tzmn; + bts->tz_bts_specific=1; + + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_no_timezone, + cfg_bts_no_timezone_cmd, + "no timezone", + "disable bts specific timezone\n") +{ + struct gsm_bts *bts = vty->index; + bts->tz_bts_specific=0; + return CMD_SUCCESS; +} DEFUN(cfg_bts_unit_id, cfg_bts_unit_id_cmd, @@ -2691,6 +2718,8 @@ int bsc_vty_init(const struct log_info *cat) install_element(BTS_NODE, &cfg_bts_tsc_cmd); install_element(BTS_NODE, &cfg_bts_bsic_cmd); install_element(BTS_NODE, &cfg_bts_unit_id_cmd); + install_element(BTS_NODE, &cfg_bts_timezone_cmd); + install_element(BTS_NODE, &cfg_bts_no_timezone_cmd); install_element(BTS_NODE, &cfg_bts_serno_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd); install_element(BTS_NODE, &cfg_bts_stream_id_cmd); -- cgit v1.2.3