From 5446930c461990f9491ac88c02c84a18020c890e Mon Sep 17 00:00:00 2001 From: Nico Golde Date: Thu, 14 Jul 2011 13:48:55 +0200 Subject: * move inital SAP connect to sim sap-socket command as otherwise all sim actions would have to wait for the connect to complete --- src/host/layer23/src/mobile/vty_interface.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 33f52961..42d716bb 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -471,28 +471,17 @@ DEFUN(sim_reader, sim_reader_cmd, "sim reader MS_NAME", "SIM actions\nSelect SIM from reader\nName of MS (see \"show ms\")") { struct osmocom_ms *ms; - struct gsm_settings *set; ms = get_ms(argv[0], vty); if (!ms) return CMD_WARNING; - set = &ms->settings; if (ms->subscr.sim_valid) { vty_out(vty, "SIM already present, remove first!%s", VTY_NEWLINE); return CMD_WARNING; } - if(access(set->sap_socket_path, F_OK) == 0){ - if(osmosap_init(ms) != 0){ - return CMD_WARNING; - } - } else { - /* this is only so we can check the first byte to be null in l1ctl_tx_sim_req */ - set->sap_socket_path[0] = 0; - } - gsm_subscr_simcard(ms); return CMD_SUCCESS; @@ -668,6 +657,7 @@ DEFUN(sim_sapsocket, sim_sapsocket_cmd, "sim sap-socket MS_NAME SOCKET_PATH", "socket path") { struct osmocom_ms *ms; + struct gsm_settings *set; ms = get_ms(argv[0], vty); if (!ms) @@ -680,6 +670,16 @@ DEFUN(sim_sapsocket, sim_sapsocket_cmd, "sim sap-socket MS_NAME SOCKET_PATH", osmosap_sapsocket(ms, (char *)argv[1]); + set = &ms->settings; + + if(access(set->sap_socket_path, F_OK) == 0){ + if(osmosap_init(ms) != 0){ + return CMD_WARNING; + } + } else { + /* this is only so we can check the first byte to be null in l1ctl_tx_sim_req */ + set->sap_socket_path[0] = 0; + } return CMD_SUCCESS; } -- cgit v1.2.3