Snapdragon® Telematics Application Framework (TelAF) Interface Specification
|
The TelAF Subscriber Identity Module (SIM) service defines APIs related to SIM configuration.
SIM is an integrated circuit (IC) intended to securely store the international mobile subscriber identity (IMSI) number and some credentials to identify subscribers. SIM cards can also store a number of SMS messages and phone contacts.
The functions of this service are provided by the tafSimCard service.
The following example illustrates how to bind to the SIM card service.
bindings: { clientExe.clientComponent.taf_sim -> tafSimCardSvc.taf_sim }
taf_sim_SelectCard() is used to select the SIM card available on the user device. By default, the SIM card in slot1 is used for network camping. Additionally, if the SIM card identifier is passed in any TAF SIM API as a parameter, it will select that SIM and after this taf_sim_GetSelectedCard() will return the newly selected card, not necessarily the one previously set by taf_sim_SelectCard().
ICCID: The SIM card is internationally identified by integrated circuit card identifier (ICCID). ICCID is stored in the SIM card and engraved or printed on the body of the SIM card. The ICCID is defined by the ITU-T standard E.118 as the primary account number. According to section E.118, the ICCID is up to 19 digits. It includes a single check digit computed by applying the Luhn algorithm. However, GSM Phase 1 (ETSI Standard GSM 11.11) defined the ICCID length in 10 octets (i.e. 20 digits) with a network-specific structure.
IMSI: The International Mobile Subscriber Identity (IMSI) is a unique identity associated with the cellular networks. It is used in any mobile network that connects with other networks. The IMSI is provisioned inside the SIM card in case of GSM, UMTS and LTE networks.
The IMSI is generally a 15 digits long number, but it can be shorter also. The first 3 digits represent mobile country code (MCC) followed by the mobile network code (MNC), either 2 digits (European standard) or 3 digits (North American standard) long. The length of MNC depends on the value of MCC. The remaining digits are the mobile subscription identification number (MSIN) within the operator's customer base.
EID: The EID (also called as eUICCID) is unique identifier for the embedded Universal Integrated Circuit Card (eUICC). The eUICC is a SIM card having remote provisioning function, and is designed to not be removed or replaced. It enables storing multiple communication profiles but only one is active (recognized by equipment and used for communication with network). With conventional SIM card, the ICCID is a unique key to distinguish the SIM card, but in case of eUICC, the ICCID is useful to identify a profile, and a new identifier is introduced, called eUICCID (EID), which is used as the primary key of the embedded SIM (eSIM) to identify.
taf_sim_GetEID() retrieves the EID.
Home Network Name
Phone Number
taf_sim_GetSubscriberPhoneNumber() – Reads the phone number of the SIM. If the phone number has not been assigned, it returns the empty string.
Using this API gets the subscriber phone number of the SIM.
Home Network Information
A handler function should be registered to receive SIM state notifications. taf_sim_AddNewStateHandler() allows users to register a state change handler.
The handler must follow the below prototype: typedef void(*taf_sim_NewStateHandlerFunc_t)(taf_sim_Id_t simId, taf_sim_States_t simState);
When the SIM's state change is notified, the handler function is invoked.
Call taf_sim_GetState() to retrieve the new state of the SIM.
An application may uninstall a state change handler by calling taf_sim_RemoveNewStateHandler().
Logical channel is specified by standard ETSI TS 102 221 in the section 8.7. If they are supported by the SIM card, the logical channels allow sending autonomous APDUs on the different channels. In this case the major points are:
Use taf_sim_OpenLogicalChannel() to open a logical channel in the SIM card. APDUs then can be sent to SIM card with taf_sim_SendApduOnChannel(). When the logical channel is no longer needed, it can be closed using taf_sim_CloseLogicalChannel().
Use taf_sim_IsEmergencyCallSubscriptionSelected() to know if the EMERGENCY profile is activated for the specified sim slot.
Before the SIM sends a message, an application registers a callback handler using taf_sim_AddNewStateHandler(). Once the message is sent, the handler will be called indicating the sending status of the message. If the message sending failed, then the handler will be called with the error code.
static void NewSimStateHandler(taf_sim_Id_t simId, taf_sim_States_t simState, void* contextPtr){ LE_INFO("New SIM event for SIM card: %d SIM state: %d", simId, simState); exit(EXIT_SUCCESS); } taf_sim_NewStateHandlerRef_t msgHandlerRef = taf_sim_AddNewStateHandler(NewSimStateHandler, NULL);
Applications must use taf_sim_RemoveNewStateHandler() to release taf_sim_NewStateHandlerRef_t message handler reference object when it is no longer used.
If there are several subscriptions/profiles in the eUICC (multi-profile), and one of them is dedicated to emergency calls (e.g., eCall, ERA-Glonass), local swap is needed to swap as quickly as possible to the emergency profile.
"Local swap" means that the user's application must be able to directly request the eUICC to swap to emergency call subscription (ECS).
Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced by an emergency subscription for a limited time, event triggering the swap back to commercial subscription being controlled by the user's application.
The taf_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to swap to ECS and reboot. The user's application must wait for eUICC reboot to finish and a network connection to be available.
The taf_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap back to a commercial subscription and reboot. The user's application must wait for eUICC reboot to finish and a network connection to be available.