osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset

2017-08-09 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3357
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[MERGED] osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset

2017-08-09 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: vty_interface.c: use RPLMN from settings if preset
..


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
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index d909153..b26d471 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -472,6 +472,9 @@
int attached)
 {
struct osmocom_ms *ms;
+   struct gsm_settings *set;
+
+   /* Initial testcard settings */
uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x;
uint32_t tmsi = 0x;
 
@@ -485,6 +488,18 @@
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 > 0x && set->test_lac < 0xfffe)
+   lac = set->test_lac;
+
+   if (set->test_tmsi != 0x)
+   tmsi = set->test_tmsi;
+   }
+
if (argc == 2) {
vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE);
return CMD_WARNING;

-- 
To view, visit https://gerrit.osmocom.org/3357
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[PATCH] osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset

2017-07-26 Thread Vadim Yanitskiy

Review at  https://gerrit.osmocom.org/3357

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
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/3357/1

diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index d909153..b26d471 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -472,6 +472,9 @@
int attached)
 {
struct osmocom_ms *ms;
+   struct gsm_settings *set;
+
+   /* Initial testcard settings */
uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x;
uint32_t tmsi = 0x;
 
@@ -485,6 +488,18 @@
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 > 0x && set->test_lac < 0xfffe)
+   lac = set->test_lac;
+
+   if (set->test_tmsi != 0x)
+   tmsi = set->test_tmsi;
+   }
+
if (argc == 2) {
vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE);
return CMD_WARNING;

-- 
To view, visit https://gerrit.osmocom.org/3357
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy