summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2011-07-14 13:48:55 +0200
committerNico Golde <nico@ngolde.de>2011-07-14 13:48:55 +0200
commit5446930c461990f9491ac88c02c84a18020c890e (patch)
treea91bb884f8c814840ba03a6cba28e28cfa5b65af
parent45a3b4be1e63618b25aef24e6ad0102cb9e9a2e2 (diff)
* move inital SAP connect to sim sap-socket command as otherwise all sim actions would have to wait for the connect to complete
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c22
1 files 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;
}