le_sim_interface.h
Go to the documentation of this file.
22 * A subscriber identity module or subscriber identification module (SIM) is an integrated circuit45 * @note The SIM selection is not reset persistent; this function has to be called at each start-up.47 * @note: It is recommended to wait for a SIM handler notification after a new SIM selection before55 * Each SIM is internationally identified by its integrated circuit card identifier (ICCID). ICCIDs68 * The International Mobile Subscriber Identity or IMSI is a unique identification associated with74 * digits (European standard) or 3 digits (North American standard). The length of the MNC depends75 * on the value of the MCC. The remaining digits are the mobile subscription identification number158 * typedef void(*le_sim_NewStateHandlerFunc_t)(@ref le_sim_Id_t simId, @c le_sim_States_t simState);164 * @note If two (or more) applications have registered a handler function for notifications, they167 * The application can uninstall the handler function by calling le_sim_RemoveNewStateHandler() API.179 * them is dedicated to emergency calls (ex: eCall, ERA-Glonass), local swap is needed to swap as185 * Local swap puts the eUICC in a temporary state, meaning the commercial subscription is replaced189 * The le_sim_LocalSwapToEmergencyCallSubscription() function requests the multi-profile eUICC to190 * swap to ECS and to refresh. The User's application must wait for eUICC reboot to be finished and193 * The le_sim_LocalSwapToCommercialSubscription() function requests the multi-profile eUICC to swap194 * back to commercial subscription and to refresh. The User's application must wait for eUICC reboot197 * The User's application can install an handler with le_sim_AddNewStateHandler() to receive eUICC's201 * - If you use a Morpho or Oberthur card, the SIM_REFRESH PRO-ACTIVE command must be accepted with204 * security restrictions for channel management APDU commands, otherwise local SIM profile switch219 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the224 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely237 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.239 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.260 * Some parameters are platform dependent, see @subpage platformConstraintsSim "SIM constraints" for292 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication298 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification327 //--------------------------------------------------------------------------------------------------331 //--------------------------------------------------------------------------------------------------334 //--------------------------------------------------------------------------------------------------337 * Connect the current client thread to the service providing this API. Block until the service is340 * For each thread that wants to use this API, either ConnectService or TryConnectService must be341 * called before any other functions in this API. Normally, ConnectService is automatically called346 //--------------------------------------------------------------------------------------------------352 //--------------------------------------------------------------------------------------------------355 * Try to connect the current client thread to the service providing this API. Return with an error358 * For each thread that wants to use this API, either ConnectService or TryConnectService must be359 * called before any other functions in this API. Normally, ConnectService is automatically called368 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).371 //--------------------------------------------------------------------------------------------------377 //--------------------------------------------------------------------------------------------------381 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants384 //--------------------------------------------------------------------------------------------------391 //--------------------------------------------------------------------------------------------------397 * longer a connection to the service, and the functions in this API can't be used. For details, see402 //--------------------------------------------------------------------------------------------------409 //--------------------------------------------------------------------------------------------------413 //--------------------------------------------------------------------------------------------------416 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------423 //--------------------------------------------------------------------------------------------------428 //--------------------------------------------------------------------------------------------------431 //--------------------------------------------------------------------------------------------------435 //--------------------------------------------------------------------------------------------------438 //--------------------------------------------------------------------------------------------------443 //--------------------------------------------------------------------------------------------------446 //--------------------------------------------------------------------------------------------------451 //--------------------------------------------------------------------------------------------------454 //--------------------------------------------------------------------------------------------------459 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------466 //--------------------------------------------------------------------------------------------------469 //--------------------------------------------------------------------------------------------------474 //--------------------------------------------------------------------------------------------------477 //--------------------------------------------------------------------------------------------------481 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------488 //--------------------------------------------------------------------------------------------------491 //--------------------------------------------------------------------------------------------------495 //--------------------------------------------------------------------------------------------------498 //--------------------------------------------------------------------------------------------------503 //--------------------------------------------------------------------------------------------------506 //--------------------------------------------------------------------------------------------------511 //--------------------------------------------------------------------------------------------------514 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------521 //--------------------------------------------------------------------------------------------------526 //--------------------------------------------------------------------------------------------------529 //--------------------------------------------------------------------------------------------------534 //--------------------------------------------------------------------------------------------------553 //--------------------------------------------------------------------------------------------------558 //--------------------------------------------------------------------------------------------------575 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------599 //--------------------------------------------------------------------------------------------------603 //--------------------------------------------------------------------------------------------------620 //--------------------------------------------------------------------------------------------------624 //--------------------------------------------------------------------------------------------------637 //--------------------------------------------------------------------------------------------------641 //--------------------------------------------------------------------------------------------------645 //--------------------------------------------------------------------------------------------------649 //--------------------------------------------------------------------------------------------------653 //--------------------------------------------------------------------------------------------------658 //--------------------------------------------------------------------------------------------------660 (669 //--------------------------------------------------------------------------------------------------674 //--------------------------------------------------------------------------------------------------676 (685 //--------------------------------------------------------------------------------------------------692 //--------------------------------------------------------------------------------------------------701 //--------------------------------------------------------------------------------------------------705 //--------------------------------------------------------------------------------------------------712 //--------------------------------------------------------------------------------------------------719 //--------------------------------------------------------------------------------------------------728 //--------------------------------------------------------------------------------------------------732 //--------------------------------------------------------------------------------------------------739 //--------------------------------------------------------------------------------------------------745 //--------------------------------------------------------------------------------------------------751 //--------------------------------------------------------------------------------------------------759 //--------------------------------------------------------------------------------------------------766 //--------------------------------------------------------------------------------------------------778 //--------------------------------------------------------------------------------------------------789 //--------------------------------------------------------------------------------------------------802 //--------------------------------------------------------------------------------------------------813 //--------------------------------------------------------------------------------------------------823 //--------------------------------------------------------------------------------------------------830 //--------------------------------------------------------------------------------------------------841 //--------------------------------------------------------------------------------------------------848 //--------------------------------------------------------------------------------------------------864 //--------------------------------------------------------------------------------------------------874 //--------------------------------------------------------------------------------------------------889 //--------------------------------------------------------------------------------------------------901 //--------------------------------------------------------------------------------------------------911 //--------------------------------------------------------------------------------------------------918 //--------------------------------------------------------------------------------------------------931 //--------------------------------------------------------------------------------------------------940 //--------------------------------------------------------------------------------------------------955 //--------------------------------------------------------------------------------------------------965 //--------------------------------------------------------------------------------------------------980 //--------------------------------------------------------------------------------------------------990 //--------------------------------------------------------------------------------------------------1007 //--------------------------------------------------------------------------------------------------1019 //--------------------------------------------------------------------------------------------------1028 //--------------------------------------------------------------------------------------------------1035 //--------------------------------------------------------------------------------------------------1048 //--------------------------------------------------------------------------------------------------1059 //--------------------------------------------------------------------------------------------------1073 //--------------------------------------------------------------------------------------------------1084 //--------------------------------------------------------------------------------------------------1096 //--------------------------------------------------------------------------------------------------1111 //--------------------------------------------------------------------------------------------------1113 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1127 //--------------------------------------------------------------------------------------------------1136 //--------------------------------------------------------------------------------------------------1153 //--------------------------------------------------------------------------------------------------1162 //--------------------------------------------------------------------------------------------------1176 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1193 //--------------------------------------------------------------------------------------------------1200 //--------------------------------------------------------------------------------------------------1207 //--------------------------------------------------------------------------------------------------1214 //--------------------------------------------------------------------------------------------------1224 //--------------------------------------------------------------------------------------------------1239 //--------------------------------------------------------------------------------------------------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_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:676le_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_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_Unblock(le_sim_Id_t simId, const char *puk, const char *newpin)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 dataSize, const char *path, uint8_t *sw1Ptr, uint8_t *sw2Ptr, uint8_t *responsePtr, size_t *responseSizePtr)struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:650le_result_t le_sim_Unlock(le_sim_Id_t simId, const char *pin)void(* le_sim_NewStateHandlerFunc_t)(le_sim_Id_t simId, le_sim_States_t simState, void *contextPtr)Definition: le_sim_interface.h:660le_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_AcceptSimToolkitCommand(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:642le_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)void(* le_sim_DisconnectHandler_t)(void *)Definition: le_sim_interface.h:332int32_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)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)le_result_t le_sim_GetSubscriberPhoneNumber(le_sim_Id_t simId, char *phoneNumberStr, size_t phoneNumberStrSize)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_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)