diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-07-27 12:25:34 +0600 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-07-27 12:25:34 +0600 |
commit | a52abd5d4f415760c6aa50da6b1e3ad333f4b1bb (patch) | |
tree | c592423c031293529a5861381d8075ddcc0b07e0 /src/host/layer23/src/mobile/vty_interface.c | |
parent | 5e0fa863cb6a66c2073bb218489e6291755c2283 (diff) |
vty_interface.c: use RPLMN from settings if preset
Previously, when testcard was attached via VTY interface, the
initial values were used for MCC / MNC, LAC and TMSI, even if
correct RPLMN settings were set.
Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
Diffstat (limited to 'src/host/layer23/src/mobile/vty_interface.c')
-rw-r--r-- | src/host/layer23/src/mobile/vty_interface.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index d909153b..b26d471d 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -472,6 +472,9 @@ static int _sim_test_cmd(struct vty *vty, int argc, const char *argv[], int attached) { struct osmocom_ms *ms; + struct gsm_settings *set; + + /* Initial testcard settings */ uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000; uint32_t tmsi = 0xffffffff; @@ -485,6 +488,18 @@ static int _sim_test_cmd(struct vty *vty, int argc, const char *argv[], return CMD_WARNING; } + set = &ms->settings; + if (set->test_rplmn_valid) { + mcc = set->test_rplmn_mcc; + mnc = set->test_rplmn_mnc; + + if (set->test_lac > 0x0000 && set->test_lac < 0xfffe) + lac = set->test_lac; + + if (set->test_tmsi != 0xffffffff) + tmsi = set->test_tmsi; + } + if (argc == 2) { vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE); return CMD_WARNING; |