le_sim_interface.h
Go to the documentation of this file.
22 * A subscriber identity module or subscriber identification module (SIM) is an integrated circuit44 * le_sim_SelectCard() function is used to select the SIM identifier. By default, the SIM in slot 147 * SIM identifier. le_sim_GetSelectedCard() returns the current selected card, not necessarily the50 * @note The SIM selection is not reset persistent; this function has to be called at each start-up.52 * @note It is recommended to wait for a SIM handler notification after a new SIM selection before61 * Each SIM is internationally identified by its integrated circuit card identifier (ICCID). ICCIDs74 * The International Mobile Subscriber Identity or IMSI is a unique identification associated with80 * digits (European standard) or 3 digits (North American standard). The length of the MNC depends81 * on the value of the MCC. The remaining digits are the mobile subscription identification number164 * typedef void(*le_sim_NewStateHandlerFunc_t)(@ref le_sim_Id_t simId, @c le_sim_States_t simState);170 * @note If two (or more) applications have registered a handler function for notifications, they173 * The application can uninstall the handler function by calling le_sim_RemoveNewStateHandler() API.185 * them is dedicated to emergency calls (ex: eCall, ERA-Glonass), local swap is needed to swap as191 * Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced195 * The le_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to196 * swap to ECS and to refresh. The User's application must wait for eUICC reboot to be finished and199 * The le_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap200 * back to commercial subscription and to refresh. The User's application must wait for eUICC reboot203 * The User's application can install an handler with le_sim_AddNewStateHandler() to receive eUICC's207 * - If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be accepted with210 * security restrictions for channel management APDU commands, otherwise local SIM profile switch246 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the251 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely264 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.266 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.287 * Some parameters are platform dependent, see @subpage platformConstraintsSim "SIM constraints" for319 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication325 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification354 //--------------------------------------------------------------------------------------------------358 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------364 * Connect the current client thread to the service providing this API. Block until the service is367 * For each thread that wants to use this API, either ConnectService or TryConnectService must be368 * called before any other functions in this API. Normally, ConnectService is automatically called373 //--------------------------------------------------------------------------------------------------379 //--------------------------------------------------------------------------------------------------382 * Try to connect the current client thread to the service providing this API. Return with an error385 * For each thread that wants to use this API, either ConnectService or TryConnectService must be386 * called before any other functions in this API. Normally, ConnectService is automatically called395 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).398 //--------------------------------------------------------------------------------------------------404 //--------------------------------------------------------------------------------------------------408 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants411 //--------------------------------------------------------------------------------------------------418 //--------------------------------------------------------------------------------------------------424 * longer a connection to the service, and the functions in this API can't be used. For details, see429 //--------------------------------------------------------------------------------------------------436 //--------------------------------------------------------------------------------------------------440 //--------------------------------------------------------------------------------------------------443 //--------------------------------------------------------------------------------------------------447 //--------------------------------------------------------------------------------------------------450 //--------------------------------------------------------------------------------------------------455 //--------------------------------------------------------------------------------------------------458 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------465 //--------------------------------------------------------------------------------------------------470 //--------------------------------------------------------------------------------------------------473 //--------------------------------------------------------------------------------------------------478 //--------------------------------------------------------------------------------------------------481 //--------------------------------------------------------------------------------------------------486 //--------------------------------------------------------------------------------------------------489 //--------------------------------------------------------------------------------------------------493 //--------------------------------------------------------------------------------------------------496 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------504 //--------------------------------------------------------------------------------------------------508 //--------------------------------------------------------------------------------------------------511 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------522 //--------------------------------------------------------------------------------------------------525 //--------------------------------------------------------------------------------------------------530 //--------------------------------------------------------------------------------------------------533 //--------------------------------------------------------------------------------------------------538 //--------------------------------------------------------------------------------------------------541 //--------------------------------------------------------------------------------------------------545 //--------------------------------------------------------------------------------------------------548 //--------------------------------------------------------------------------------------------------553 //--------------------------------------------------------------------------------------------------556 //--------------------------------------------------------------------------------------------------560 //--------------------------------------------------------------------------------------------------564 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------588 //--------------------------------------------------------------------------------------------------593 //--------------------------------------------------------------------------------------------------610 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------634 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------655 //--------------------------------------------------------------------------------------------------659 //--------------------------------------------------------------------------------------------------672 //--------------------------------------------------------------------------------------------------676 //--------------------------------------------------------------------------------------------------680 //--------------------------------------------------------------------------------------------------684 //--------------------------------------------------------------------------------------------------688 //--------------------------------------------------------------------------------------------------693 //--------------------------------------------------------------------------------------------------695 (704 //--------------------------------------------------------------------------------------------------709 //--------------------------------------------------------------------------------------------------711 (720 //--------------------------------------------------------------------------------------------------727 //--------------------------------------------------------------------------------------------------736 //--------------------------------------------------------------------------------------------------740 //--------------------------------------------------------------------------------------------------747 //--------------------------------------------------------------------------------------------------754 //--------------------------------------------------------------------------------------------------763 //--------------------------------------------------------------------------------------------------767 //--------------------------------------------------------------------------------------------------774 //--------------------------------------------------------------------------------------------------780 //--------------------------------------------------------------------------------------------------786 //--------------------------------------------------------------------------------------------------794 //--------------------------------------------------------------------------------------------------801 //--------------------------------------------------------------------------------------------------813 //--------------------------------------------------------------------------------------------------824 //--------------------------------------------------------------------------------------------------837 //--------------------------------------------------------------------------------------------------848 //--------------------------------------------------------------------------------------------------858 //--------------------------------------------------------------------------------------------------865 //--------------------------------------------------------------------------------------------------876 //--------------------------------------------------------------------------------------------------883 //--------------------------------------------------------------------------------------------------899 //--------------------------------------------------------------------------------------------------908 //--------------------------------------------------------------------------------------------------923 //--------------------------------------------------------------------------------------------------934 //--------------------------------------------------------------------------------------------------944 //--------------------------------------------------------------------------------------------------951 //--------------------------------------------------------------------------------------------------964 //--------------------------------------------------------------------------------------------------973 //--------------------------------------------------------------------------------------------------988 //--------------------------------------------------------------------------------------------------997 //--------------------------------------------------------------------------------------------------1012 //--------------------------------------------------------------------------------------------------1021 //--------------------------------------------------------------------------------------------------1038 //--------------------------------------------------------------------------------------------------1049 //--------------------------------------------------------------------------------------------------1058 //--------------------------------------------------------------------------------------------------1065 //--------------------------------------------------------------------------------------------------1078 //--------------------------------------------------------------------------------------------------1089 //--------------------------------------------------------------------------------------------------1103 //--------------------------------------------------------------------------------------------------1114 //--------------------------------------------------------------------------------------------------1126 //--------------------------------------------------------------------------------------------------1141 //--------------------------------------------------------------------------------------------------1143 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1157 //--------------------------------------------------------------------------------------------------1166 //--------------------------------------------------------------------------------------------------1183 //--------------------------------------------------------------------------------------------------1192 //--------------------------------------------------------------------------------------------------1206 //--------------------------------------------------------------------------------------------------1216 //--------------------------------------------------------------------------------------------------1223 //--------------------------------------------------------------------------------------------------1230 //--------------------------------------------------------------------------------------------------1237 //--------------------------------------------------------------------------------------------------1244 //--------------------------------------------------------------------------------------------------1254 //--------------------------------------------------------------------------------------------------1269 //--------------------------------------------------------------------------------------------------1282 //--------------------------------------------------------------------------------------------------1313 //--------------------------------------------------------------------------------------------------1321 //--------------------------------------------------------------------------------------------------1328 //--------------------------------------------------------------------------------------------------1336 //--------------------------------------------------------------------------------------------------1342 //--------------------------------------------------------------------------------------------------1350 //--------------------------------------------------------------------------------------------------1361 //--------------------------------------------------------------------------------------------------1370 //--------------------------------------------------------------------------------------------------1379 //--------------------------------------------------------------------------------------------------1387 //--------------------------------------------------------------------------------------------------1394 //--------------------------------------------------------------------------------------------------1403 //--------------------------------------------------------------------------------------------------1418 //--------------------------------------------------------------------------------------------------1427 //--------------------------------------------------------------------------------------------------1442 //--------------------------------------------------------------------------------------------------1450 //--------------------------------------------------------------------------------------------------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_GetHomeNetworkOperator(le_sim_Id_t simId, char *nameStr, size_t nameStrSize)le_result_t le_sim_GetRemainingPUKTries(le_sim_Id_t simId, uint32_t *remainingPukTriesPtrPtr)void(* le_sim_SimToolkitEventHandlerFunc_t)(le_sim_Id_t simId, le_sim_StkEvent_t stkEvent, void *contextPtr)Definition: le_sim_interface.h:711le_result_t le_sim_LocalSwapToEmergencyCallSubscription(le_sim_Id_t simId, le_sim_Manufacturer_t manufacturer)le_result_t le_sim_ChangePIN(le_sim_Id_t simId, const char *LE_NONNULL oldpin, const char *LE_NONNULL newpin)le_result_t le_sim_SendApdu(le_sim_Id_t simId, const uint8_t *commandApduPtr, size_t commandApduSize, uint8_t *responseApduPtr, size_t *responseApduSizePtr)le_result_t le_sim_GetHomeNetworkMccMnc(le_sim_Id_t simId, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)le_result_t le_sim_GetFirstFPLMNOperator(le_sim_FPLMNListRef_t FPLMNListRef, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:685void(* le_sim_NewStateHandlerFunc_t)(le_sim_Id_t simId, le_sim_States_t simState, void *contextPtr)Definition: le_sim_interface.h:695le_result_t le_sim_GetICCID(le_sim_Id_t simId, char *iccid, size_t iccidSize)void le_sim_SetServerDisconnectHandler(le_sim_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_sim_GetNextFPLMNOperator(le_sim_FPLMNListRef_t FPLMNListRef, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)le_result_t le_sim_AcceptSimToolkitCommand(le_sim_Id_t simId)le_sim_FPLMNListRef_t le_sim_ReadFPLMNList(le_sim_Id_t simId)void le_sim_ConnectService(void)le_result_t le_sim_GetIMSI(le_sim_Id_t simId, char *imsi, size_t imsiSize)void le_sim_DisconnectService(void)struct le_sim_NewStateHandler * le_sim_NewStateHandlerRef_tDefinition: le_sim_interface.h:677void le_sim_DeleteFPLMNList(le_sim_FPLMNListRef_t FPLMNListRef)le_result_t le_sim_Reset(le_sim_Id_t simId)le_result_t le_sim_SendCommand(le_sim_Id_t simId, le_sim_Command_t command, const char *LE_NONNULL fileIdentifier, uint8_t p1, uint8_t p2, uint8_t p3, const uint8_t *dataPtr, size_t dataSize, const char *LE_NONNULL path, uint8_t *sw1Ptr, uint8_t *sw2Ptr, uint8_t *responsePtr, size_t *responseSizePtr)le_result_t le_sim_WriteFPLMNList(le_sim_Id_t simId, le_sim_FPLMNListRef_t FPLMNListRef)le_result_t le_sim_AddFPLMNOperator(le_sim_FPLMNListRef_t FPLMNListRef, const char *LE_NONNULL mcc, const char *LE_NONNULL mnc)le_result_t le_sim_SelectCard(le_sim_Id_t simId)void(* le_sim_DisconnectHandler_t)(void *)Definition: le_sim_interface.h:359int32_t le_sim_GetRemainingPINTries(le_sim_Id_t simId)le_sim_FPLMNListRef_t le_sim_CreateFPLMNList(void)bool le_sim_IsReady(le_sim_Id_t simId)le_sim_SimToolkitEventHandlerRef_t le_sim_AddSimToolkitEventHandler(le_sim_SimToolkitEventHandlerFunc_t handlerPtr, void *contextPtr)void le_sim_RemoveSimToolkitEventHandler(le_sim_SimToolkitEventHandlerRef_t handlerRef)void le_sim_RemoveNewStateHandler(le_sim_NewStateHandlerRef_t handlerRef)le_result_t le_sim_RejectSimToolkitCommand(le_sim_Id_t simId)struct le_sim_FPLMNList * le_sim_FPLMNListRef_tDefinition: le_sim_interface.h:561le_result_t le_sim_GetSubscriberPhoneNumber(le_sim_Id_t simId, char *phoneNumberStr, size_t phoneNumberStrSize)le_result_t le_sim_Unblock(le_sim_Id_t simId, const char *LE_NONNULL puk, const char *LE_NONNULL newpin)le_result_t le_sim_IsEmergencyCallSubscriptionSelected(le_sim_Id_t simId, bool *isEcsPtr)le_result_t le_sim_Unlock(le_sim_Id_t simId, const char *LE_NONNULL pin)le_result_t le_sim_Lock(le_sim_Id_t simId, const char *LE_NONNULL pin)le_sim_Id_t le_sim_GetSelectedCard(void)le_result_t le_sim_EnterPIN(le_sim_Id_t simId, const char *LE_NONNULL pin)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)