Telematics SDK - User Guide
v1.63.7
|
TelSDK simulation enables development of applications using the SDK's APIs on any Linux based hardware. The simulation is intended to enable software development, even before the actual Telematics hardware is available. Users can run the simulation on a Linux desktop if they choose.
The Simulation framework provides libraries which are compile time equivalent to the actual concrete libraries. The simulation libraries provide the behavior of APIs similar to the behavior seen on an actual Telematics device with the concrete libraries.
This allows applications to be developed, compiled, and executed using this framework. An application can link to the simulation libraries to use the functionality of the SDK APIs in this framework. The same application can then be recompiled for the target Telematics device without requiring any redevelopment or code changes.
The Simulation framework is designed to be configurable to tweak the behavior and the responses of the APIs. This provides flexibility to exercise the client code in multiple ways and scenarios. Users can run the Simulation framework within a docker as well if desired.
|
This section provides an overview of the components involved in the TelSDK simulation framework.
The telematics simulation library runs in the user space of the Linux system. It interacts with the simulation server and other subsystems to provide various services like phone calls, SMS, etc. These services are exposed by the SDK through the same fixed public APIs that are available on all Telematics platforms that support SDK.
This is the main daemon that interacts with all the clients using the Simulation framework and provides the functionality for all the public APIs.
Event injector allows the users to inject unsolicited events. It is a Linux based command-line utility that injects events into the simulation framework.
For example: telsdk_event_injector -f tel_card -e cardInfoChanged <slotId> <cardPower> could be triggered to change the card power state.
This tool can also be used to dynamically update JSON files for API behaviors.
Syntax for injecting events: telsdk_event_injector -f <filter/subsystem/manager> -e <event> <arguments>
To build various components of the Simulation framework:
To run applications within the docker container:
Note:
To run applications without the docker container:
Note:
TelSDK initializes various subsystems during startup. It marks each subsystem as ready once the initialization procedures are completed for that subsystem. The application must wait until the corresponding subsystem on which it needs to make API requests is ready. TelSDK provides APIs to check whether a subsystem is ready or not.
The Simulation framework simulates subsystem readiness. The behavior and timing of this can be configured via the API specific JSON file. These user configurable JSON files are located under the path /data/telux/json/api/ and the name of the JSON file corresponds to the subsystem name specified in the public headers.
For example: IDataConnectionManager.json present in /data/telux/json/api/
JSON Attribute | Description |
---|---|
IsSubsystemReady | Specifies the subsystem readiness. |
IsSubsystemReadyDelay | Specifies time the simulation framework should take to indicate subsystem readiness. |
TelSDK simulation framework allows simulating each API response via updating the API specific JSON file. The table shows the JSON attributes to modify the behavior of the API in simulation
JSON Attribute | Description |
---|---|
DefaultCallbackDelay | For all the public APIs this delay would be the default delay and would only be considered if callbackDelay is not specified. |
status | It specifies the immediate synchronous response that application would receive when the TelSDK API is invoked. It is usually the return status of the API invoked. |
callbackDelay | specifies the time that simulation libraries shall take before invoking the callback function and -1 could be configured to avoid callback invocation. This would be given preference over DefaultCallbackDelay. |
error | Specifies ErrorCode that will be sent along with the user provided callback function. |
The JSON for API behavior could be updated dynamically by injecting the json_update event. Use the telsdk_event_injector help option to get more details.
Syntax to update the json file: telsdk_event_injector -f json_update -e modify <path> <subsystem> <api> <attribute> <val>
For example: Considering the below API entry in JSON
"getDefaultProfile": { "callbackDelay": 400, "error": "SUCCESS", "status": "SUCCESS" },
The command telsdk_event_injector -f json_update -e modify /api/data/IDataConnectionManager.json IDataConnectionManager getDefaultProfile callbackDelay 300. would update callbackDelay to 300
There will be cases where additional fields in response management would be needed. For example: SMS management.
TelSDK simulation framework lets users simulate certain system level behaviors by injecting unsolicited event using event injector. Use the event injector helper option to get detailed information about the events supported by each subsystem.
The data stored and used by the simulation can be classified into three categories as mentioned below:
TelSDK simulation framework supports logging. User configurable logger settings available in /etc/telux/tel.conf are listed below.
LOGGER_LEVEL | Supported log levels are: NONE - No logging PERF - Prints messages with nanoseconds precision timestamp. ERROR - Very minimal logging. Prints error messages only. WARNING - Prints perf, error and warning messages. INFO - Prints errors, warning, and information messages. DEBUG - Full logging including debug messages.It is intended for debugging purposes only. |
LOGGER_TYPE | Supported log types are: CONSOLE_LOG - enables console logging FILE_LOG - enables file-based logging. Once file logging is enabled, LOG_FILE_NAME and LOG_FILE_PATH could further be configured by users. SYSLOG_LOG - enables syslog logging. |
MULTISIM_CONFIG in etc/telux/tel.conf specifies type of multi-SIM configuration supported. By default, multi-SIM configuration is not enabled.
The details on how simulation of individual areas can be used and controlled are available below.