le_sim_interface.h
Go to the documentation of this file.
20 * A subscriber identity module or subscriber identification module (SIM) is an integrated circuit43 * @note The SIM selection is not reset persistent; this function has to be called at each start-up.45 * @note: It is recommended to wait for a SIM handler notification after a new SIM selection before53 * Each SIM is internationally identified by its integrated circuit card identifier (ICCID). ICCIDs66 * The International Mobile Subscriber Identity or IMSI is a unique identification associated with72 * digits (European standard) or 3 digits (North American standard). The length of the MNC depends73 * on the value of the MCC. The remaining digits are the mobile subscription identification number151 * typedef void(*le_sim_NewStateHandlerFunc_t)(@ref le_sim_Id_t simId, @c le_sim_States_t simState);157 * @note If two (or more) applications have registered a handler function for notifications, they160 * The application can uninstall the handler function by calling le_sim_RemoveNewStateHandler() API.168 * them is dedicated to emergency calls (ex: eCall, ERA-Glonass), local swap is needed to swap as174 * Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced178 * The le_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to179 * swap to ECS and to refresh. The User's application must wait for eUICC reboot to be finished and182 * The le_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap183 * back to commercial subscription and to refresh. The User's application must wait for eUICC reboot186 * The User's application can install an handler with le_sim_AddNewStateHandler() to receive eUICC's190 * - If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be accepted with193 * security restrictions for channel management APDU commands, otherwise local SIM profile switch208 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the213 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely226 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.228 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.239 * le_sim_SendApdu() API. The user must encode the APDU as specified by in recommendation 3GPP 11.11,242 * protection. In this situation, some command types and parameters can modify SIM files incorrectly.279 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication285 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification314 //--------------------------------------------------------------------------------------------------317 * Connect the current client thread to the service providing this API. Block until the service is320 * For each thread that wants to use this API, either ConnectService or TryConnectService must be321 * called before any other functions in this API. Normally, ConnectService is automatically called326 //--------------------------------------------------------------------------------------------------332 //--------------------------------------------------------------------------------------------------335 * Try to connect the current client thread to the service providing this API. Return with an error338 * For each thread that wants to use this API, either ConnectService or TryConnectService must be339 * called before any other functions in this API. Normally, ConnectService is automatically called346 * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.347 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).350 //--------------------------------------------------------------------------------------------------356 //--------------------------------------------------------------------------------------------------362 * longer a connection to the service, and the functions in this API can't be used. For details, see367 //--------------------------------------------------------------------------------------------------374 //--------------------------------------------------------------------------------------------------378 //--------------------------------------------------------------------------------------------------382 //--------------------------------------------------------------------------------------------------386 //--------------------------------------------------------------------------------------------------390 //--------------------------------------------------------------------------------------------------395 //--------------------------------------------------------------------------------------------------399 //--------------------------------------------------------------------------------------------------403 //--------------------------------------------------------------------------------------------------407 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------416 //--------------------------------------------------------------------------------------------------421 //--------------------------------------------------------------------------------------------------425 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------434 //--------------------------------------------------------------------------------------------------438 //--------------------------------------------------------------------------------------------------442 //--------------------------------------------------------------------------------------------------447 //--------------------------------------------------------------------------------------------------451 //--------------------------------------------------------------------------------------------------455 //--------------------------------------------------------------------------------------------------459 //--------------------------------------------------------------------------------------------------463 //--------------------------------------------------------------------------------------------------467 //--------------------------------------------------------------------------------------------------471 //--------------------------------------------------------------------------------------------------475 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------489 //--------------------------------------------------------------------------------------------------493 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------510 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------539 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------564 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------589 //--------------------------------------------------------------------------------------------------593 //--------------------------------------------------------------------------------------------------614 //--------------------------------------------------------------------------------------------------618 //--------------------------------------------------------------------------------------------------633 //--------------------------------------------------------------------------------------------------637 //--------------------------------------------------------------------------------------------------641 //--------------------------------------------------------------------------------------------------645 //--------------------------------------------------------------------------------------------------649 //--------------------------------------------------------------------------------------------------660 //--------------------------------------------------------------------------------------------------662 (669 //--------------------------------------------------------------------------------------------------680 //--------------------------------------------------------------------------------------------------682 (688 //--------------------------------------------------------------------------------------------------694 //--------------------------------------------------------------------------------------------------704 //--------------------------------------------------------------------------------------------------708 //--------------------------------------------------------------------------------------------------715 //--------------------------------------------------------------------------------------------------721 //--------------------------------------------------------------------------------------------------731 //--------------------------------------------------------------------------------------------------735 //--------------------------------------------------------------------------------------------------742 //--------------------------------------------------------------------------------------------------748 //--------------------------------------------------------------------------------------------------754 //--------------------------------------------------------------------------------------------------762 //--------------------------------------------------------------------------------------------------769 //--------------------------------------------------------------------------------------------------781 //--------------------------------------------------------------------------------------------------794 //--------------------------------------------------------------------------------------------------807 //--------------------------------------------------------------------------------------------------820 //--------------------------------------------------------------------------------------------------830 //--------------------------------------------------------------------------------------------------837 //--------------------------------------------------------------------------------------------------848 //--------------------------------------------------------------------------------------------------855 //--------------------------------------------------------------------------------------------------871 //--------------------------------------------------------------------------------------------------881 //--------------------------------------------------------------------------------------------------896 //--------------------------------------------------------------------------------------------------909 //--------------------------------------------------------------------------------------------------920 //--------------------------------------------------------------------------------------------------927 //--------------------------------------------------------------------------------------------------942 //--------------------------------------------------------------------------------------------------952 //--------------------------------------------------------------------------------------------------967 //--------------------------------------------------------------------------------------------------977 //--------------------------------------------------------------------------------------------------993 //--------------------------------------------------------------------------------------------------1006 //--------------------------------------------------------------------------------------------------1015 //--------------------------------------------------------------------------------------------------1022 //--------------------------------------------------------------------------------------------------1035 //--------------------------------------------------------------------------------------------------1048 //--------------------------------------------------------------------------------------------------1062 //--------------------------------------------------------------------------------------------------1075 //--------------------------------------------------------------------------------------------------1087 //--------------------------------------------------------------------------------------------------1106 //--------------------------------------------------------------------------------------------------1108 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1122 //--------------------------------------------------------------------------------------------------1132 //--------------------------------------------------------------------------------------------------1149 //--------------------------------------------------------------------------------------------------1159 //--------------------------------------------------------------------------------------------------1173 //--------------------------------------------------------------------------------------------------1184 //--------------------------------------------------------------------------------------------------1191 //--------------------------------------------------------------------------------------------------1198 //--------------------------------------------------------------------------------------------------1205 //--------------------------------------------------------------------------------------------------1212 //--------------------------------------------------------------------------------------------------1222 //--------------------------------------------------------------------------------------------------1241 //--------------------------------------------------------------------------------------------------1253 //--------------------------------------------------------------------------------------------------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:682le_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:662struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:646le_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:638le_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)