Feature #4332
closed
call external script from remsim-client to execute specific actions
Added by laforge over 4 years ago.
Updated over 2 years ago.
Description
There are some situations where remsim-client would want to make its environemnt aware of, e.g. to take specific action.
This is particularly important on platforms where the simtrace2 firmware doesn't have direct control over modem reset/poweron or the like.
I'm working with a patch that calls an external binary with a single argument and the following environment:
REMSIM_SIM_RST=0
REMSIM_CLIENT_VERSION=0.2.2.30-283e
REMSIM_SERVER_STATE=CONNECTED
REMSIM_EVENT=event-modem-status
REMSIM_CLIENT_SLOT=1:0
REMSIM_USB_PATH=1-2.1
REMSIM_SIM_VCC=1
REMSIM_BANKD_ADDR=127.0.0.1:9999
REMSIM_BANKD_STATE=CONNECTED
REMSIM_SERVER_ADDR=127.0.0.1:9998
REMSIM_BANKD_SLOT=1:0
The following arguments can occur:
- event-server-connect
remsim-client informs the system a logical RSPRO connection from client to server has been established
- event-bankd-connect
remsim-client informs the system a logical RSPRO connection from client to bankd has been established
- event-config-bankd
remsim-server has configured a (new) bankd/slot to connect to
- event-modem-status
themsim-client informs the system that the modem has swiched on/off either VCC or RST of the SIM interface
- request-card-insert / request-card-remove
remsim-client requests the system to simulate card-insert / card-removal to the modem
- request-sim-remote / request-sim-local
remsim-client requests the system to witch between remote and local SIM
- request-modem-reset
remsim-client requests the system to perform a modem reset
In terms of the environment, the following variables have been specified so far
Variable |
Description |
REMSIM_CLIENT_VERSION |
compile-time version of the remsim-client software |
REMSIM_SERVER_ADDR |
remsim-server host:port |
REMSIM_SERVER_STATE |
state of the rspro_client_fsm connecting to remsim-server |
REMSIM_BANKD_ADDR |
remsim-bankd host:port |
REMSIM_BANKD_STATE |
state of the rspro_client_fsm connecting to remsim-bankd |
REMSIM_CLIENT_SLOT |
ClientId:SlotNr |
REMSIM_BANKD_SLOT |
BankId:SlotNr |
REMSIM_USB_PATH |
physical USB path of the SIMtrace2 USB device |
REMSIM_USB_INTERFACE |
interface number within the SIMtrace2 USB device |
REMSIM_SIM_VCC |
whether or not the SIM card VCC is turned on by modem (1=on, 0=off) |
REMSIM_SIM_RST |
whether or not the SIM card RST is active (1) or inactive (0) |
REMSIM_EVENT |
the name of the event/request (same as first argument passed to script) |
- % Done changed from 30 to 80
- % Done changed from 80 to 90
the related patch has meanwhile been merged master. However, FSM state change events are still missing.
- Priority changed from High to Low
- % Done changed from 90 to 80
- Status changed from In Progress to Resolved
script execution on FSM state changes are not really needed so far, so let's skip that for now until somebody actually comes up with a use case. All other events are implemented.
Looking at the sources no request-sim-local or request-card-remove can ever occur:
$ git grep call_script
src/client/main_fsm.c:static int call_script(struct bankd_client *bc, const char *cause)
src/client/main_fsm.c: call_script(bc, "event-server-connect");
src/client/main_fsm.c: call_script(bc, "event-bankd-connect");
src/client/main_fsm.c: call_script(bc, "request-card-insert");
src/client/main_fsm.c: call_script(bc, "request-sim-remote");
src/client/main_fsm.c: call_script(bc, "request-modem-reset");
src/client/main_fsm.c: call_script(bc, "event-config-bankd");
src/client/main_fsm.c: call_script(bc, "event-modem-status");
This should at least be pointed out in the docs
Also available in: Atom
PDF