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.172 * them is dedicated to emergency calls (ex: eCall, ERA-Glonass), local swap is needed to swap as178 * Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced182 * The le_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to183 * swap to ECS and to refresh. The User's application must wait for eUICC reboot to be finished and186 * The le_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap187 * back to commercial subscription and to refresh. The User's application must wait for eUICC reboot190 * The User's application can install an handler with le_sim_AddNewStateHandler() to receive eUICC's194 * - If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be accepted with197 * security restrictions for channel management APDU commands, otherwise local SIM profile switch212 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the217 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely230 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.232 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.243 * le_sim_SendApdu() API. The user must encode the APDU as specified by in recommendation 3GPP 11.11,246 * protection. In this situation, some command types and parameters can modify SIM files incorrectly.252 * Some parameters are platform dependent, see @subpage platformConstraintsSim "SIM constraints" for284 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication290 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification319 //--------------------------------------------------------------------------------------------------322 * Connect the current client thread to the service providing this API. Block until the service is325 * For each thread that wants to use this API, either ConnectService or TryConnectService must be326 * called before any other functions in this API. Normally, ConnectService is automatically called331 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------340 * Try to connect the current client thread to the service providing this API. Return with an error343 * For each thread that wants to use this API, either ConnectService or TryConnectService must be344 * called before any other functions in this API. Normally, ConnectService is automatically called351 * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.352 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).355 //--------------------------------------------------------------------------------------------------361 //--------------------------------------------------------------------------------------------------367 * longer a connection to the service, and the functions in this API can't be used. For details, see372 //--------------------------------------------------------------------------------------------------379 //--------------------------------------------------------------------------------------------------383 //--------------------------------------------------------------------------------------------------387 //--------------------------------------------------------------------------------------------------391 //--------------------------------------------------------------------------------------------------395 //--------------------------------------------------------------------------------------------------400 //--------------------------------------------------------------------------------------------------404 //--------------------------------------------------------------------------------------------------408 //--------------------------------------------------------------------------------------------------412 //--------------------------------------------------------------------------------------------------417 //--------------------------------------------------------------------------------------------------421 //--------------------------------------------------------------------------------------------------426 //--------------------------------------------------------------------------------------------------430 //--------------------------------------------------------------------------------------------------435 //--------------------------------------------------------------------------------------------------439 //--------------------------------------------------------------------------------------------------443 //--------------------------------------------------------------------------------------------------447 //--------------------------------------------------------------------------------------------------452 //--------------------------------------------------------------------------------------------------456 //--------------------------------------------------------------------------------------------------460 //--------------------------------------------------------------------------------------------------464 //--------------------------------------------------------------------------------------------------468 //--------------------------------------------------------------------------------------------------472 //--------------------------------------------------------------------------------------------------476 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------485 //--------------------------------------------------------------------------------------------------489 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------502 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------511 //--------------------------------------------------------------------------------------------------515 //--------------------------------------------------------------------------------------------------520 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------549 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------574 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------598 //--------------------------------------------------------------------------------------------------619 //--------------------------------------------------------------------------------------------------623 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------642 //--------------------------------------------------------------------------------------------------646 //--------------------------------------------------------------------------------------------------650 //--------------------------------------------------------------------------------------------------654 //--------------------------------------------------------------------------------------------------665 //--------------------------------------------------------------------------------------------------667 (674 //--------------------------------------------------------------------------------------------------685 //--------------------------------------------------------------------------------------------------687 (693 //--------------------------------------------------------------------------------------------------699 //--------------------------------------------------------------------------------------------------709 //--------------------------------------------------------------------------------------------------713 //--------------------------------------------------------------------------------------------------720 //--------------------------------------------------------------------------------------------------726 //--------------------------------------------------------------------------------------------------736 //--------------------------------------------------------------------------------------------------740 //--------------------------------------------------------------------------------------------------747 //--------------------------------------------------------------------------------------------------753 //--------------------------------------------------------------------------------------------------759 //--------------------------------------------------------------------------------------------------767 //--------------------------------------------------------------------------------------------------774 //--------------------------------------------------------------------------------------------------786 //--------------------------------------------------------------------------------------------------799 //--------------------------------------------------------------------------------------------------812 //--------------------------------------------------------------------------------------------------825 //--------------------------------------------------------------------------------------------------835 //--------------------------------------------------------------------------------------------------842 //--------------------------------------------------------------------------------------------------853 //--------------------------------------------------------------------------------------------------860 //--------------------------------------------------------------------------------------------------876 //--------------------------------------------------------------------------------------------------886 //--------------------------------------------------------------------------------------------------901 //--------------------------------------------------------------------------------------------------914 //--------------------------------------------------------------------------------------------------925 //--------------------------------------------------------------------------------------------------932 //--------------------------------------------------------------------------------------------------947 //--------------------------------------------------------------------------------------------------957 //--------------------------------------------------------------------------------------------------972 //--------------------------------------------------------------------------------------------------982 //--------------------------------------------------------------------------------------------------998 //--------------------------------------------------------------------------------------------------1011 //--------------------------------------------------------------------------------------------------1020 //--------------------------------------------------------------------------------------------------1027 //--------------------------------------------------------------------------------------------------1040 //--------------------------------------------------------------------------------------------------1053 //--------------------------------------------------------------------------------------------------1067 //--------------------------------------------------------------------------------------------------1080 //--------------------------------------------------------------------------------------------------1092 //--------------------------------------------------------------------------------------------------1111 //--------------------------------------------------------------------------------------------------1113 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1127 //--------------------------------------------------------------------------------------------------1137 //--------------------------------------------------------------------------------------------------1154 //--------------------------------------------------------------------------------------------------1164 //--------------------------------------------------------------------------------------------------1178 //--------------------------------------------------------------------------------------------------1189 //--------------------------------------------------------------------------------------------------1196 //--------------------------------------------------------------------------------------------------1203 //--------------------------------------------------------------------------------------------------1210 //--------------------------------------------------------------------------------------------------1217 //--------------------------------------------------------------------------------------------------1227 //--------------------------------------------------------------------------------------------------1246 //--------------------------------------------------------------------------------------------------1258 //--------------------------------------------------------------------------------------------------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:687le_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:667struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:651le_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:643le_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)