le_sim_interface.h
Go to the documentation of this file.
19 * A subscriber identity module or subscriber identification module (SIM) is an integrated circuit42 * @note The SIM selection is not reset persistent; this function has to be called at each start-up.44 * @note: It is recommended to wait for a SIM handler notification after a new SIM selection before52 * Each SIM is internationally identified by its integrated circuit card identifier (ICCID). ICCIDs65 * The International Mobile Subscriber Identity or IMSI is a unique identification associated with71 * digits (European standard) or 3 digits (North American standard). The length of the MNC depends72 * on the value of the MCC. The remaining digits are the mobile subscription identification number150 * typedef void(*le_sim_NewStateHandlerFunc_t)(@ref le_sim_Id_t simId, @c le_sim_States_t simState);156 * @note If two (or more) applications have registered a handler function for notifications, they159 * The application can uninstall the handler function by calling le_sim_RemoveNewStateHandler() API.167 * them is dedicated to emergency calls (ex: eCall, ERA-Glonass), local swap is needed to swap as173 * Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced177 * The le_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to178 * swap to ECS and to refresh. The User's application must wait for eUICC reboot to be finished and181 * The le_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap182 * back to commercial subscription and to refresh. The User's application must wait for eUICC reboot185 * The User's application can install an handler with le_sim_AddNewStateHandler() to receive eUICC's189 * - If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be accepted with192 * security restrictions for channel management APDU commands, otherwise local SIM profile switch207 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the212 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely225 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.227 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.238 * le_sim_SendApdu() API. The user must encode the APDU as specified by in recommendation 3GPP 11.11,241 * protection. In this situation, some command types and parameters can modify SIM files incorrectly.278 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication284 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification313 //--------------------------------------------------------------------------------------------------316 * Connect the current client thread to the service providing this API. Block until the service is319 * For each thread that wants to use this API, either ConnectService or TryConnectService must be320 * called before any other functions in this API. Normally, ConnectService is automatically called325 //--------------------------------------------------------------------------------------------------331 //--------------------------------------------------------------------------------------------------334 * Try to connect the current client thread to the service providing this API. Return with an error337 * For each thread that wants to use this API, either ConnectService or TryConnectService must be338 * called before any other functions in this API. Normally, ConnectService is automatically called345 * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.346 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).349 //--------------------------------------------------------------------------------------------------355 //--------------------------------------------------------------------------------------------------361 * longer a connection to the service, and the functions in this API can't be used. For details, see366 //--------------------------------------------------------------------------------------------------373 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------381 //--------------------------------------------------------------------------------------------------385 //--------------------------------------------------------------------------------------------------389 //--------------------------------------------------------------------------------------------------394 //--------------------------------------------------------------------------------------------------398 //--------------------------------------------------------------------------------------------------402 //--------------------------------------------------------------------------------------------------406 //--------------------------------------------------------------------------------------------------411 //--------------------------------------------------------------------------------------------------415 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------424 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------433 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------441 //--------------------------------------------------------------------------------------------------446 //--------------------------------------------------------------------------------------------------450 //--------------------------------------------------------------------------------------------------454 //--------------------------------------------------------------------------------------------------458 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------466 //--------------------------------------------------------------------------------------------------470 //--------------------------------------------------------------------------------------------------474 //--------------------------------------------------------------------------------------------------479 //--------------------------------------------------------------------------------------------------483 //--------------------------------------------------------------------------------------------------488 //--------------------------------------------------------------------------------------------------492 //--------------------------------------------------------------------------------------------------496 //--------------------------------------------------------------------------------------------------500 //--------------------------------------------------------------------------------------------------505 //--------------------------------------------------------------------------------------------------509 //--------------------------------------------------------------------------------------------------514 //--------------------------------------------------------------------------------------------------538 //--------------------------------------------------------------------------------------------------543 //--------------------------------------------------------------------------------------------------563 //--------------------------------------------------------------------------------------------------568 //--------------------------------------------------------------------------------------------------588 //--------------------------------------------------------------------------------------------------592 //--------------------------------------------------------------------------------------------------613 //--------------------------------------------------------------------------------------------------617 //--------------------------------------------------------------------------------------------------632 //--------------------------------------------------------------------------------------------------636 //--------------------------------------------------------------------------------------------------640 //--------------------------------------------------------------------------------------------------644 //--------------------------------------------------------------------------------------------------648 //--------------------------------------------------------------------------------------------------659 //--------------------------------------------------------------------------------------------------661 (668 //--------------------------------------------------------------------------------------------------679 //--------------------------------------------------------------------------------------------------681 (687 //--------------------------------------------------------------------------------------------------693 //--------------------------------------------------------------------------------------------------703 //--------------------------------------------------------------------------------------------------707 //--------------------------------------------------------------------------------------------------714 //--------------------------------------------------------------------------------------------------720 //--------------------------------------------------------------------------------------------------730 //--------------------------------------------------------------------------------------------------734 //--------------------------------------------------------------------------------------------------741 //--------------------------------------------------------------------------------------------------747 //--------------------------------------------------------------------------------------------------753 //--------------------------------------------------------------------------------------------------761 //--------------------------------------------------------------------------------------------------768 //--------------------------------------------------------------------------------------------------780 //--------------------------------------------------------------------------------------------------793 //--------------------------------------------------------------------------------------------------806 //--------------------------------------------------------------------------------------------------819 //--------------------------------------------------------------------------------------------------829 //--------------------------------------------------------------------------------------------------836 //--------------------------------------------------------------------------------------------------847 //--------------------------------------------------------------------------------------------------854 //--------------------------------------------------------------------------------------------------870 //--------------------------------------------------------------------------------------------------880 //--------------------------------------------------------------------------------------------------895 //--------------------------------------------------------------------------------------------------908 //--------------------------------------------------------------------------------------------------919 //--------------------------------------------------------------------------------------------------926 //--------------------------------------------------------------------------------------------------941 //--------------------------------------------------------------------------------------------------951 //--------------------------------------------------------------------------------------------------966 //--------------------------------------------------------------------------------------------------976 //--------------------------------------------------------------------------------------------------992 //--------------------------------------------------------------------------------------------------1005 //--------------------------------------------------------------------------------------------------1014 //--------------------------------------------------------------------------------------------------1021 //--------------------------------------------------------------------------------------------------1034 //--------------------------------------------------------------------------------------------------1047 //--------------------------------------------------------------------------------------------------1061 //--------------------------------------------------------------------------------------------------1074 //--------------------------------------------------------------------------------------------------1086 //--------------------------------------------------------------------------------------------------1105 //--------------------------------------------------------------------------------------------------1107 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1121 //--------------------------------------------------------------------------------------------------1131 //--------------------------------------------------------------------------------------------------1148 //--------------------------------------------------------------------------------------------------1158 //--------------------------------------------------------------------------------------------------1172 //--------------------------------------------------------------------------------------------------1183 //--------------------------------------------------------------------------------------------------1190 //--------------------------------------------------------------------------------------------------1197 //--------------------------------------------------------------------------------------------------1204 //--------------------------------------------------------------------------------------------------1211 //--------------------------------------------------------------------------------------------------1221 //--------------------------------------------------------------------------------------------------1240 //--------------------------------------------------------------------------------------------------1252 //--------------------------------------------------------------------------------------------------le_sim_NewStateHandlerRef_t le_sim_AddNewStateHandler(le_sim_NewStateHandlerFunc_t handlerPtr, void *contextPtr)bool le_sim_IsPresent(le_sim_Id_t simId)le_result_t le_sim_SendCommand(le_sim_Id_t simId, le_sim_Command_t command, const char *fileIdentifier, uint8_t p1, uint8_t p2, uint8_t p3, const uint8_t *dataPtr, size_t dataNumElements, const char *path, uint8_t *sw1Ptr, uint8_t *sw2Ptr, uint8_t *responsePtr, size_t *responseNumElementsPtr)le_result_t le_sim_Lock(le_sim_Id_t simId, const char *pin)le_result_t le_sim_LocalSwapToEmergencyCallSubscription(le_sim_Id_t simId, le_sim_Manufacturer_t manufacturer)le_result_t le_sim_GetSubscriberPhoneNumber(le_sim_Id_t simId, char *phoneNumberStr, size_t phoneNumberStrNumElements)void(* le_sim_SimToolkitEventHandlerFunc_t)(le_sim_Id_t simId, le_sim_StkEvent_t stkEvent, void *contextPtr)Definition: le_sim_interface.h:681le_result_t le_sim_GetHomeNetworkOperator(le_sim_Id_t simId, char *nameStr, size_t nameStrNumElements)le_result_t le_sim_Unblock(le_sim_Id_t simId, const char *puk, const char *newpin)void(* le_sim_NewStateHandlerFunc_t)(le_sim_Id_t simId, le_sim_States_t simState, void *contextPtr)Definition: le_sim_interface.h:661struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:645le_result_t le_sim_Unlock(le_sim_Id_t simId, const char *pin)void le_sim_RemoveSimToolkitEventHandler(le_sim_SimToolkitEventHandlerRef_t addHandlerRef)le_result_t le_sim_AcceptSimToolkitCommand(le_sim_Id_t simId)le_result_t le_sim_GetHomeNetworkMccMnc(le_sim_Id_t simId, char *mccPtr, size_t mccPtrNumElements, char *mncPtr, size_t mncPtrNumElements)void le_sim_ConnectService(void)void le_sim_DisconnectService(void)struct le_sim_NewStateHandler * le_sim_NewStateHandlerRef_tDefinition: le_sim_interface.h:637le_result_t le_sim_SendApdu(le_sim_Id_t simId, const uint8_t *commandApduPtr, size_t commandApduNumElements, uint8_t *responseApduPtr, size_t *responseApduNumElementsPtr)le_result_t le_sim_ChangePIN(le_sim_Id_t simId, const char *oldpin, const char *newpin)le_result_t le_sim_SelectCard(le_sim_Id_t simId)int32_t le_sim_GetRemainingPINTries(le_sim_Id_t simId)bool le_sim_IsReady(le_sim_Id_t simId)le_sim_SimToolkitEventHandlerRef_t le_sim_AddSimToolkitEventHandler(le_sim_SimToolkitEventHandlerFunc_t handlerPtr, void *contextPtr)le_result_t le_sim_RejectSimToolkitCommand(le_sim_Id_t simId)void le_sim_RemoveNewStateHandler(le_sim_NewStateHandlerRef_t addHandlerRef)le_result_t le_sim_EnterPIN(le_sim_Id_t simId, const char *pin)le_result_t le_sim_IsEmergencyCallSubscriptionSelected(le_sim_Id_t simId, bool *isEcsPtr)le_result_t le_sim_GetIMSI(le_sim_Id_t simId, char *imsi, size_t imsiNumElements)le_sim_Id_t le_sim_GetSelectedCard(void)le_sim_States_t le_sim_GetState(le_sim_Id_t simId)le_result_t le_sim_LocalSwapToCommercialSubscription(le_sim_Id_t simId, le_sim_Manufacturer_t manufacturer)le_result_t le_sim_TryConnectService(void)le_result_t le_sim_GetICCID(le_sim_Id_t simId, char *iccid, size_t iccidNumElements)