Project

General

Profile

Actions

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.

Status:
Resolved
Priority:
Low
Assignee:
Category:
remsim-client
Target version:
-
Start date:
12/16/2019
Due date:
% Done:

80%

Spec Reference:

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.


Checklist

  • generic mechanism to call related script (non-blocking, in separate process)
  • command: sim local vs. remote
  • command: modem reset active/inactive
  • event: server-conn FSM state change
  • event: bankd-conn FSM state change
  • event: modem asserts/releases SIM RST
Actions #1

Updated by laforge over 4 years ago

  • Checklist item generic mechanism to call related script (non-blocking, in separate process) set to Done
  • Status changed from New to In Progress
  • % Done changed from 0 to 30

first part of the task implemented in https://gerrit.osmocom.org/c/libosmocore/+/16619

Actions #2

Updated by laforge over 4 years ago

  • Checklist item command: sim local vs. remote set to Done
  • Checklist item command: modem reset active/inactive set to Done
  • Checklist item event: modem asserts/releases SIM RST set to Done

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)
Actions #3

Updated by laforge over 4 years ago

  • % Done changed from 30 to 80
Actions #4

Updated by laforge about 4 years ago

  • % Done changed from 80 to 90

the related patch has meanwhile been merged master. However, FSM state change events are still missing.

Actions #5

Updated by laforge about 4 years ago

  • Priority changed from High to Low
  • % Done changed from 90 to 80
Actions #6

Updated by laforge about 3 years ago

  • 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.

Actions #7

Updated by daniel over 2 years ago

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

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)