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 switch225 * The SIM application Toolkit allows the SIM card to initiates commands or asking input from the230 * The embedded UICC (eUICC) format supports multiple subscription profiles, which can be remotely243 * The le_sim_AcceptSimToolkitCommand() allows the device to accept the last SIM Toolkit command.245 * The le_sim_RejectSimToolkitCommand() forbids the device to accept the last SIM Toolkit command.266 * Some parameters are platform dependent, see @subpage platformConstraintsSim "SIM constraints" for298 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Authentication304 * @snippet "apps/test/modemServices/sim/simIntegrationTest/simTestComp/simTest.c" Identification333 //--------------------------------------------------------------------------------------------------337 //--------------------------------------------------------------------------------------------------340 //--------------------------------------------------------------------------------------------------343 * Connect the current client thread to the service providing this API. Block until the service is346 * For each thread that wants to use this API, either ConnectService or TryConnectService must be347 * called before any other functions in this API. Normally, ConnectService is automatically called352 //--------------------------------------------------------------------------------------------------358 //--------------------------------------------------------------------------------------------------361 * Try to connect the current client thread to the service providing this API. Return with an error364 * For each thread that wants to use this API, either ConnectService or TryConnectService must be365 * called before any other functions in this API. Normally, ConnectService is automatically called374 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).377 //--------------------------------------------------------------------------------------------------383 //--------------------------------------------------------------------------------------------------387 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants390 //--------------------------------------------------------------------------------------------------397 //--------------------------------------------------------------------------------------------------403 * longer a connection to the service, and the functions in this API can't be used. For details, see408 //--------------------------------------------------------------------------------------------------415 //--------------------------------------------------------------------------------------------------419 //--------------------------------------------------------------------------------------------------422 //--------------------------------------------------------------------------------------------------426 //--------------------------------------------------------------------------------------------------429 //--------------------------------------------------------------------------------------------------434 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------441 //--------------------------------------------------------------------------------------------------444 //--------------------------------------------------------------------------------------------------449 //--------------------------------------------------------------------------------------------------452 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------460 //--------------------------------------------------------------------------------------------------465 //--------------------------------------------------------------------------------------------------468 //--------------------------------------------------------------------------------------------------472 //--------------------------------------------------------------------------------------------------475 //--------------------------------------------------------------------------------------------------480 //--------------------------------------------------------------------------------------------------483 //--------------------------------------------------------------------------------------------------487 //--------------------------------------------------------------------------------------------------490 //--------------------------------------------------------------------------------------------------494 //--------------------------------------------------------------------------------------------------497 //--------------------------------------------------------------------------------------------------501 //--------------------------------------------------------------------------------------------------504 //--------------------------------------------------------------------------------------------------509 //--------------------------------------------------------------------------------------------------512 //--------------------------------------------------------------------------------------------------517 //--------------------------------------------------------------------------------------------------520 //--------------------------------------------------------------------------------------------------524 //--------------------------------------------------------------------------------------------------527 //--------------------------------------------------------------------------------------------------532 //--------------------------------------------------------------------------------------------------535 //--------------------------------------------------------------------------------------------------540 //--------------------------------------------------------------------------------------------------559 //--------------------------------------------------------------------------------------------------564 //--------------------------------------------------------------------------------------------------581 //--------------------------------------------------------------------------------------------------586 //--------------------------------------------------------------------------------------------------605 //--------------------------------------------------------------------------------------------------609 //--------------------------------------------------------------------------------------------------626 //--------------------------------------------------------------------------------------------------630 //--------------------------------------------------------------------------------------------------643 //--------------------------------------------------------------------------------------------------647 //--------------------------------------------------------------------------------------------------651 //--------------------------------------------------------------------------------------------------655 //--------------------------------------------------------------------------------------------------659 //--------------------------------------------------------------------------------------------------664 //--------------------------------------------------------------------------------------------------666 (675 //--------------------------------------------------------------------------------------------------680 //--------------------------------------------------------------------------------------------------682 (691 //--------------------------------------------------------------------------------------------------698 //--------------------------------------------------------------------------------------------------707 //--------------------------------------------------------------------------------------------------711 //--------------------------------------------------------------------------------------------------718 //--------------------------------------------------------------------------------------------------725 //--------------------------------------------------------------------------------------------------734 //--------------------------------------------------------------------------------------------------738 //--------------------------------------------------------------------------------------------------745 //--------------------------------------------------------------------------------------------------751 //--------------------------------------------------------------------------------------------------757 //--------------------------------------------------------------------------------------------------765 //--------------------------------------------------------------------------------------------------772 //--------------------------------------------------------------------------------------------------784 //--------------------------------------------------------------------------------------------------795 //--------------------------------------------------------------------------------------------------808 //--------------------------------------------------------------------------------------------------819 //--------------------------------------------------------------------------------------------------829 //--------------------------------------------------------------------------------------------------836 //--------------------------------------------------------------------------------------------------847 //--------------------------------------------------------------------------------------------------854 //--------------------------------------------------------------------------------------------------870 //--------------------------------------------------------------------------------------------------879 //--------------------------------------------------------------------------------------------------894 //--------------------------------------------------------------------------------------------------905 //--------------------------------------------------------------------------------------------------915 //--------------------------------------------------------------------------------------------------922 //--------------------------------------------------------------------------------------------------935 //--------------------------------------------------------------------------------------------------944 //--------------------------------------------------------------------------------------------------959 //--------------------------------------------------------------------------------------------------968 //--------------------------------------------------------------------------------------------------983 //--------------------------------------------------------------------------------------------------992 //--------------------------------------------------------------------------------------------------1009 //--------------------------------------------------------------------------------------------------1020 //--------------------------------------------------------------------------------------------------1029 //--------------------------------------------------------------------------------------------------1036 //--------------------------------------------------------------------------------------------------1049 //--------------------------------------------------------------------------------------------------1060 //--------------------------------------------------------------------------------------------------1074 //--------------------------------------------------------------------------------------------------1085 //--------------------------------------------------------------------------------------------------1097 //--------------------------------------------------------------------------------------------------1112 //--------------------------------------------------------------------------------------------------1114 * This function must be called to request the multi-profile eUICC to swap to ECS and to refresh.1128 //--------------------------------------------------------------------------------------------------1137 //--------------------------------------------------------------------------------------------------1154 //--------------------------------------------------------------------------------------------------1163 //--------------------------------------------------------------------------------------------------1177 //--------------------------------------------------------------------------------------------------1187 //--------------------------------------------------------------------------------------------------1194 //--------------------------------------------------------------------------------------------------1201 //--------------------------------------------------------------------------------------------------1208 //--------------------------------------------------------------------------------------------------1215 //--------------------------------------------------------------------------------------------------1225 //--------------------------------------------------------------------------------------------------1240 //--------------------------------------------------------------------------------------------------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_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:682le_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)struct le_sim_SimToolkitEventHandler * le_sim_SimToolkitEventHandlerRef_tDefinition: le_sim_interface.h:656void(* le_sim_NewStateHandlerFunc_t)(le_sim_Id_t simId, le_sim_States_t simState, void *contextPtr)Definition: le_sim_interface.h:666le_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:648le_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_SelectCard(le_sim_Id_t simId)void(* le_sim_DisconnectHandler_t)(void *)Definition: le_sim_interface.h:338int32_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_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)