pespin submitted this change.
mobile: Fail VTY command if attching test SIM card fails
Change-Id: Ie5a395de6c926f13ce9324b93da0e348da5438d1
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 57d02e6..e7f0454 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -434,6 +434,7 @@
{
struct osmocom_ms *ms;
struct gsm_settings *set;
+ int rc;
/* Initial testcard settings */
uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000;
@@ -484,7 +485,11 @@
if (argc >= 5)
tmsi = strtoul(argv[4], NULL, 16);
- gsm_subscr_testcard(ms, mcc, mnc, lac, tmsi, attached);
+ rc = gsm_subscr_testcard(ms, mcc, mnc, lac, tmsi, attached);
+ if (rc < 0) {
+ vty_out(vty, "Attach test SIM card failed: %d%s", rc, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
return CMD_SUCCESS;
}
To view, visit change 32422. To unsubscribe, or for help writing mail filters, visit settings.