Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_sim_server.h File Reference
#include "legato.h"
#include "taf_sim_common.h"

Go to the source code of this file.

Functions

le_msg_ServiceRef_t taf_sim_GetServiceRef (void)
 
le_msg_SessionRef_t taf_sim_GetClientSessionRef (void)
 
void taf_sim_AdvertiseService (void)
 
taf_sim_NewStateHandlerRef_t taf_sim_AddNewStateHandler (taf_sim_NewStateHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_sim_RemoveNewStateHandler (taf_sim_NewStateHandlerRef_t handlerRef)
 
taf_sim_AuthenticationResponseHandlerRef_t taf_sim_AddAuthenticationResponseHandler (taf_sim_AuthenticationResponseHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_sim_RemoveAuthenticationResponseHandler (taf_sim_AuthenticationResponseHandlerRef_t handlerRef)
 
bool taf_sim_IsPresent (taf_sim_Id_t slotId)
 
taf_sim_States_t taf_sim_GetState (taf_sim_Id_t slotId)
 
bool taf_sim_IsReady (taf_sim_Id_t slotId)
 
le_result_t taf_sim_GetICCID (taf_sim_Id_t slotId, char *iccid, size_t iccidSize)
 
le_result_t taf_sim_GetIMSI (taf_sim_Id_t slotId, char *imsi, size_t imsiSize)
 
le_result_t taf_sim_GetHomeNetworkOperator (taf_sim_Id_t slotId, char *nameStr, size_t nameStrSize)
 
le_result_t taf_sim_GetSubscriberPhoneNumber (taf_sim_Id_t slotId, char *phoneNumberStr, size_t phoneNumberStrSize)
 
le_result_t taf_sim_GetHomeNetworkMccMnc (taf_sim_Id_t slotId, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)
 
taf_sim_Id_t taf_sim_GetSelectedCard (void)
 
le_result_t taf_sim_SelectCard (taf_sim_Id_t slotId)
 
le_result_t taf_sim_EnterPIN (taf_sim_Id_t slotId, taf_sim_LockType_t lockType, const char *LE_NONNULL pin)
 
le_result_t taf_sim_ChangePIN (taf_sim_Id_t slotId, taf_sim_LockType_t lockType, const char *LE_NONNULL oldpin, const char *LE_NONNULL newpin)
 
int32_t taf_sim_GetRemainingPINTries (taf_sim_Id_t slotId)
 
le_result_t taf_sim_GetRemainingPUKTries (taf_sim_Id_t slotId, uint32_t *remainingPukTriesPtrPtr)
 
le_result_t taf_sim_Unlock (taf_sim_Id_t slotId, taf_sim_LockType_t lockType, const char *LE_NONNULL pin)
 
le_result_t taf_sim_Lock (taf_sim_Id_t slotId, taf_sim_LockType_t lockType, const char *LE_NONNULL pin)
 
le_result_t taf_sim_Unblock (taf_sim_Id_t slotId, taf_sim_LockType_t lockType, const char *LE_NONNULL puk, const char *LE_NONNULL newpin)
 
le_result_t taf_sim_GetEID (taf_sim_Id_t slotId, char *eid, size_t eidSize)
 
le_result_t taf_sim_SetAutomaticSelection (bool enable)
 
le_result_t taf_sim_GetAutomaticSelection (bool *enablePtr)
 
le_result_t taf_sim_OpenLogicalChannel (taf_sim_Id_t slotId, taf_sim_AppType_t apptype, uint8_t *channelPtrPtr)
 
le_result_t taf_sim_CloseLogicalChannel (taf_sim_Id_t slotId, uint8_t channel)
 
le_result_t taf_sim_SendApduOnChannel (taf_sim_Id_t simId, uint8_t channel, const uint8_t *commandApduPtr, size_t commandApduSize, uint8_t *responseApduPtr, size_t *responseApduSizePtr)
 
le_result_t taf_sim_SendApdu (taf_sim_Id_t simId, const uint8_t *commandApduPtr, size_t commandApduSize, uint8_t *responseApduPtr, size_t *responseApduSizePtr)
 
le_result_t taf_sim_SendCommand (taf_sim_Id_t simId, taf_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 taf_sim_LocalSwapToEmergencyCallSubscription (taf_sim_Id_t simId, taf_sim_Manufacturer_t manufacturer)
 
le_result_t taf_sim_LocalSwapToCommercialSubscription (taf_sim_Id_t simId, taf_sim_Manufacturer_t manufacturer)
 
le_result_t taf_sim_SetPower (taf_sim_Id_t simId, le_onoff_t power)
 
le_result_t taf_sim_Reset (taf_sim_Id_t simId)
 
le_result_t taf_sim_IsEmergencyCallSubscriptionSelected (taf_sim_Id_t simId, bool *isEcsPtr)
 
taf_sim_IccidChangeHandlerRef_t taf_sim_AddIccidChangeHandler (taf_sim_IccidChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_sim_RemoveIccidChangeHandler (taf_sim_IccidChangeHandlerRef_t handlerRef)
 
taf_sim_FPLMNListRef_t taf_sim_CreateFPLMNList (void)
 
le_result_t taf_sim_AddFPLMNOperator (taf_sim_FPLMNListRef_t fplmnListRef, const char *LE_NONNULL mcc, const char *LE_NONNULL mnc)
 
le_result_t taf_sim_GetFirstFPLMNOperator (taf_sim_FPLMNListRef_t fplmnListRef, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)
 
le_result_t taf_sim_GetNextFPLMNOperator (taf_sim_FPLMNListRef_t fplmnListRef, char *mccPtr, size_t mccPtrSize, char *mncPtr, size_t mncPtrSize)
 
taf_sim_FPLMNListRef_t taf_sim_ReadFPLMNList (taf_sim_Id_t simId)
 
void taf_sim_DeleteFPLMNList (taf_sim_FPLMNListRef_t fplmnListRef)
 
le_result_t taf_sim_WriteFPLMNList (taf_sim_Id_t simId, taf_sim_FPLMNListRef_t fplmnListRef)
 
le_result_t taf_sim_GetSlotCount (int32_t *countPtr)
 

Function Documentation

◆ taf_sim_GetServiceRef()

le_msg_ServiceRef_t taf_sim_GetServiceRef ( void  )

Get the server service reference

◆ taf_sim_GetClientSessionRef()

le_msg_SessionRef_t taf_sim_GetClientSessionRef ( void  )

Get the client session reference for the current message

◆ taf_sim_AdvertiseService()

void taf_sim_AdvertiseService ( void  )

Initialize the server and advertise the service.

◆ taf_sim_AddNewStateHandler()

taf_sim_NewStateHandlerRef_t taf_sim_AddNewStateHandler ( taf_sim_NewStateHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Defines SIM card states. Defines slot ID of the SIM card. Defines all types of card locks using in PIN management APIs. Defines all types of UICC applications, such as SIM, RUIM, USIM, CSIM and ISIM. Card manufacturer. SIM commands. Refer to TS 11.11 9.1. Handler for SIM card state changes. Reference type used by Add/Remove functions for EVENT 'taf_sim_NewState' Handler for PIN PUK changes. Reference type used by Add/Remove functions for EVENT 'taf_sim_AuthenticationResponse' Handler for ICCID change events. Reference type used by Add/Remove functions for EVENT 'taf_sim_IccidChange' Add handler function for EVENT 'taf_sim_NewState'

SIM card state change event.

Add handler function for EVENT 'taf_sim_NewState'

SIM card state change event.

Parameters
[in]handlerPtrState change handler.
[in]contextPtr

◆ taf_sim_RemoveNewStateHandler()

void taf_sim_RemoveNewStateHandler ( taf_sim_NewStateHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_sim_NewState'

Parameters
[in]handlerRef

◆ taf_sim_AddAuthenticationResponseHandler()

taf_sim_AuthenticationResponseHandlerRef_t taf_sim_AddAuthenticationResponseHandler ( taf_sim_AuthenticationResponseHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_sim_AuthenticationResponse'

Authentication response.

Parameters
[in]handlerPtrAuthentication response handler.
[in]contextPtr

◆ taf_sim_RemoveAuthenticationResponseHandler()

void taf_sim_RemoveAuthenticationResponseHandler ( taf_sim_AuthenticationResponseHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_sim_AuthenticationResponse'

Parameters
[in]handlerRef

◆ taf_sim_IsPresent()

bool taf_sim_IsPresent ( taf_sim_Id_t  slotId)

Checks whether SIM card is present or absent.

Returns
  • True – SIM card present.
  • False – SIM card absent.
Parameters
[in]slotIdSlot ID.

◆ taf_sim_GetState()

taf_sim_States_t taf_sim_GetState ( taf_sim_Id_t  slotId)

Gets the state of the SIM card for the given slotId.

Returns
Current of SIM card state.
Parameters
[in]slotIdSlot ID.

◆ taf_sim_IsReady()

bool taf_sim_IsReady ( taf_sim_Id_t  slotId)

Checks whether the SIM card is ready or not

Returns
  • True – SIM card is present and ready to use, i.e., unlocked.
  • False – SIM card is absent or restricted to use, i.e., locked.
Parameters
[in]slotIdSlot ID.

◆ taf_sim_GetICCID()

le_result_t taf_sim_GetICCID ( taf_sim_Id_t  slotId,
char *  iccid,
size_t  iccidSize 
)

Retrieves the SIM's ICCID.

Returns
  • LE_OK ICCID was read successfully.
  • LE_OVERFLOW Buffer size is too small.
  • LE_BAD_PARAMETER Invalid parameters.
  • LE_FAULT Failed to retrieve the ICCID.
Parameters
[in]slotIdSlot ID.
[out]iccidICC ID as output.
[in]iccidSize

◆ taf_sim_GetIMSI()

le_result_t taf_sim_GetIMSI ( taf_sim_Id_t  slotId,
char *  imsi,
size_t  imsiSize 
)

Retrieves the IMSI for the SIM.

Returns
  • LE_OVERFLOW Buffer size is too small.
  • LE_BAD_PARAMETER Invalid parameters.
  • LE_FAULT Failed to retrieve the IMSI.
  • LE_OK IMSI retrieved successfully.
Parameters
[in]slotIdSlot ID.
[out]imsiIMSI as output.
[in]imsiSize

◆ taf_sim_GetHomeNetworkOperator()

le_result_t taf_sim_GetHomeNetworkOperator ( taf_sim_Id_t  slotId,
char *  nameStr,
size_t  nameStrSize 
)

Retrieves the name of the carrier on which this subscription is made.

Returns
  • LE_OVERFLOW Buffer size is too small.
  • LE_BAD_PARAMETER Invalid parameters.
  • LE_FAULT Failed to retrieve the carrier name.
  • LE_OK Carrier name retrieved successfully.
Parameters
[in]slotIdSlot ID.
[out]nameStrNetwork name as output.
[in]nameStrSize

◆ taf_sim_GetSubscriberPhoneNumber()

le_result_t taf_sim_GetSubscriberPhoneNumber ( taf_sim_Id_t  slotId,
char *  phoneNumberStr,
size_t  phoneNumberStrSize 
)

Retrieves the phone number for the SIM subscription.

Returns
  • LE_OVERFLOW Buffer size is too small.
  • LE_BAD_PARAMETER Invalid parameters.
  • LE_FAULT Failed to retrieve the phone number.
  • LE_OK Phone number retrieved successfully.
Parameters
[in]slotIdSlot ID.
[out]phoneNumberStrPhone number as output.
[in]phoneNumberStrSize

◆ taf_sim_GetHomeNetworkMccMnc()

le_result_t taf_sim_GetHomeNetworkMccMnc ( taf_sim_Id_t  slotId,
char *  mccPtr,
size_t  mccPtrSize,
char *  mncPtr,
size_t  mncPtrSize 
)

Retrieves the MNC and MCC of the carrier to which the phone is connected.

Returns
  • LE_OVERFLOW Buffer size is too small.
  • LE_BAD_PARAMETER Invalid parameters.
  • LE_FAULT Failed to retrieve the phone number.
  • LE_OK Phone number retrieved successfully.
Parameters
[in]slotIdSlot ID.
[out]mccPtrMCC string as output.
[in]mccPtrSize
[out]mncPtrMNC string as output.
[in]mncPtrSize

◆ taf_sim_GetSelectedCard()

taf_sim_Id_t taf_sim_GetSelectedCard ( void  )

Gets the slotId of currently selected SIM card.

Returns
slotId of currently selected card.

◆ taf_sim_SelectCard()

le_result_t taf_sim_SelectCard ( taf_sim_Id_t  slotId)

Selects a SIM.

Returns
  • LE_FAULT Failed to select SIM card.
  • LE_OK SIM card selected successfully.
Parameters
[in]slotIdSlot ID.

◆ taf_sim_EnterPIN()

le_result_t taf_sim_EnterPIN ( taf_sim_Id_t  slotId,
taf_sim_LockType_t  lockType,
const char *LE_NONNULL  pin 
)

Unlocks the Sim card for an app by entering PIN.

Returns
  • LE_BAD_PARAMETER Invalid SIM slot ID.
  • LE_UNDERFLOW PIN code length is too short (minimum 4 digits).
  • LE_FAULT Failed to send unlock SIM card by PIN request.
  • LE_OK Successfully sent unlock SIM by password request.
Parameters
[in]slotIdSlot ID of SIM.
[in]lockTypeApplicable lock types are PIN1 and PIN2.
[in]pinPIN1/PIN2.

◆ taf_sim_ChangePIN()

le_result_t taf_sim_ChangePIN ( taf_sim_Id_t  slotId,
taf_sim_LockType_t  lockType,
const char *LE_NONNULL  oldpin,
const char *LE_NONNULL  newpin 
)

Changes the password used in PIN1/PIN2 lock.

Returns
LE_BAD_PARAMETER Invalid SIM slot ID.
LE_UNDERFLOW PIN code length is too short (minimum 4 digits).
LE_FAULT Failed to send change password for lock SIM card request.
LE_OK Successfully sent change SIM lock password request.
Parameters
[in]slotIdSlot ID of SIM.
[in]lockTypeApplicable lock types are PIN1 and PIN2.
[in]oldpinOld PIN1/PIN2.
[in]newpinNew PIN1/PIN2.

◆ taf_sim_GetRemainingPINTries()

int32_t taf_sim_GetRemainingPINTries ( taf_sim_Id_t  slotId)

Gets the available retry count of PIN tries.

Returns
  • LE_BAD_PARAMETER Invalid SIM slot ID.
  • LE_FAULT Failed to get the number of remaining PIN insertion tries.
  • A positive value Retry count value.
Parameters
[in]slotIdSlot ID.

◆ taf_sim_GetRemainingPUKTries()

le_result_t taf_sim_GetRemainingPUKTries ( taf_sim_Id_t  slotId,
uint32_t *  remainingPukTriesPtrPtr 
)

Gets the remaining PUK try count.

Returns
  • LE_BAD_PARAMETER Invalid SIM slot ID.
  • LE_FAULT Failed to get the number of remaining PUK insertion tries.
  • A positive value Retry count value.
Parameters
[in]slotIdSlot ID.
[out]remainingPukTriesPtrPtrNumber of PUK retries remaining.

◆ taf_sim_Unlock()

le_result_t taf_sim_Unlock ( taf_sim_Id_t  slotId,
taf_sim_LockType_t  lockType,
const char *LE_NONNULL  pin 
)

Disables PIN1 or FDN lock.

Returns
LE_BAD_PARAMETER Invalid SIM slot ID.
LE_UNDERFLOW PIN code length is too short (minimum 4 digits).
LE_FAULT Failed to send disable lock SIM card request.
LE_OK Successfully sent disable SIM lock request.
Parameters
[in]slotIdSlot ID of SIM.
[in]lockTypeApplicable lock types are PIN1 and FDN.
[in]pinPIN1/PIN2.

◆ taf_sim_Lock()

le_result_t taf_sim_Lock ( taf_sim_Id_t  slotId,
taf_sim_LockType_t  lockType,
const char *LE_NONNULL  pin 
)

Enables PIN1 or FDN lock.

Returns
  • LE_BAD_PARAMETER Invalid SIM slot ID.
  • LE_UNDERFLOW PIN code length is too short (minimum 4 digits).
  • LE_FAULT Failed to send enable lock SIM card request.
  • LE_OK Successfully sent the enable SIM lock request.
Parameters
[in]slotIdSlot ID of SIM.
[in]lockTypeApplicable lock types are PIN1 and FDN.
[in]pinPIN1/PIN2.

◆ taf_sim_Unblock()

le_result_t taf_sim_Unblock ( taf_sim_Id_t  slotId,
taf_sim_LockType_t  lockType,
const char *LE_NONNULL  puk,
const char *LE_NONNULL  newpin 
)

Unlocks the SIM card for an app by entering PUK and new PIN.

Returns
  • LE_BAD_PARAMETER Invalid SIM slot ID.
  • LE_OUT_OF_RANGE PUK length is not correct (8 digits).
  • LE_UNDERFLOW PIN code length is too short (minimum 4 digits).
  • LE_FAULT Failed to send unlock SIM card request.
  • LE_OK Successfully sent the unlock SIM request.
Parameters
[in]slotIdSlot ID of SIM.
[in]lockTypeApplicable lock types are PUK1 and PUK2.
[in]pukPUK1/PUK2.
[in]newpinNew PIN1/PIN2.

◆ taf_sim_GetEID()

le_result_t taf_sim_GetEID ( taf_sim_Id_t  slotId,
char *  eid,
size_t  eidSize 
)

Requests eUICC identifier(EID) for the slot.

Returns
  • LE_OK Succeeded.
  • LE_FAULT Failed.
Parameters
[in]slotIdSlot ID.
[out]eideID
[in]eidSize

◆ taf_sim_SetAutomaticSelection()

le_result_t taf_sim_SetAutomaticSelection ( bool  enable)

Enables or disables the automatic SIM selection.

Returns
  • LE_OK Succeeded.
  • LE_FAULT Failed.
Parameters
[in]enableEnable flag

◆ taf_sim_GetAutomaticSelection()

le_result_t taf_sim_GetAutomaticSelection ( bool *  enablePtr)

Gets the automatic SIM selection.

Returns
  • LE_OK Succeeded.
  • LE_FAULT Failed.
Parameters
[out]enablePtrEnable flag as output.

◆ taf_sim_OpenLogicalChannel()

le_result_t taf_sim_OpenLogicalChannel ( taf_sim_Id_t  slotId,
taf_sim_AppType_t  apptype,
uint8_t *  channelPtrPtr 
)

Opens a logical channel to the SIM.

Returns
  • LE_OK Successfully opened logical channel request.
  • LE_BAD_PARAMETER Invalid parameter.
  • LE_FAULT Failed to open logical channel.
Parameters
[in]slotIdSlot ID.
[in]apptypeApp type.
[out]channelPtrPtrChannel as output.

◆ taf_sim_CloseLogicalChannel()

le_result_t taf_sim_CloseLogicalChannel ( taf_sim_Id_t  slotId,
uint8_t  channel 
)

Closes a previously opened logical channel to the SIM.

Returns
  • LE_OK Successfully closed the logical channel.
  • LE_FAULT Failed to send the request.
Parameters
[in]slotIdSlot ID.
[in]channelThe channel ID to be closed.

◆ taf_sim_SendApduOnChannel()

le_result_t taf_sim_SendApduOnChannel ( taf_sim_Id_t  simId,
uint8_t  channel,
const uint8_t *  commandApduPtr,
size_t  commandApduSize,
uint8_t *  responseApduPtr,
size_t *  responseApduSizePtr 
)

Transmits an APDU to the ICC card over a logical channel.

Returns
  • LE_OK Succeeded.
  • LE_BAD_PARAMETER Invalid parameter.
  • LE_NOT_FOUND Failed to select the SIM card.
  • LE_FAULT Failed to transmit APDU.
Parameters
[in]simIdSlot ID.
[in]channelChannel.
[in]commandApduPtrAPDU.
[in]commandApduSize
[out]responseApduPtrResponse of APDU as output.
[in,out]responseApduSizePtr

◆ taf_sim_SendApdu()

le_result_t taf_sim_SendApdu ( taf_sim_Id_t  simId,
const uint8_t *  commandApduPtr,
size_t  commandApduSize,
uint8_t *  responseApduPtr,
size_t *  responseApduSizePtr 
)

Exchanges APDUs with the SIM on a basic channel.

Returns
  • LE_OK Succeeded.
  • LE_FAULT Failed to transmit APDU.
  • LE_BAD_PARAMETER Invalid parameter.
  • LE_NOT_FOUND Failed to select the SIM card.
Parameters
[in]simIdSlot ID.
[in]commandApduPtrAPDU command.
[in]commandApduSize
[out]responseApduPtrResponse of APDU as output.
[in,out]responseApduSizePtr

◆ taf_sim_SendCommand()

le_result_t taf_sim_SendCommand ( taf_sim_Id_t  simId,
taf_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 
)

Sends a command to the SIM.

Returns
  • LE_OK Succeeded.
  • LE_FAULT Failed.
  • LE_BAD_PARAMETER A parameter is invalid.
  • LE_NOT_FOUND - The function failed to select the SIM card for this operation
    • The requested SIM file is not found
  • LE_OVERFLOW Response buffer is too small to copy the SIM answer.
  • LE_UNSUPPORTED The platform does not support this operation.
Parameters
[in]simIdThe SIM identifier.
[in]commandThe SIM command.
[in]fileIdentifierThe file identifier.
[in]p1Parameter P1 passed to the SIM.
[in]p2Parameter P2 passed to the SIM.
[in]p3Parameter P3 passed to the SIM.
[in]dataPtrThe command data.
[in]dataSize
[in]pathThe path to the elementary file.
[out]sw1PtrStatus word 1 received from the SIM.
[out]sw2PtrStatus word 2 received from the SIM.
[out]responsePtrSIM response.
[in,out]responseSizePtr

◆ taf_sim_LocalSwapToEmergencyCallSubscription()

le_result_t taf_sim_LocalSwapToEmergencyCallSubscription ( taf_sim_Id_t  simId,
taf_sim_Manufacturer_t  manufacturer 
)

Switches the given SIM to the emergency call subscription. The eUICC reboots after switching the profile and the client app must wait for it.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid SIM identifier.
  • LE_FAULT – Unexpected error.
Note
The eUICC should be in the Ready state.
Ensure the emergency profile is available on the eUICC or an error will be thrown.
Parameters
[in]simIdThe SIM identifier.
[in]manufacturerThe card manufacturer.

◆ taf_sim_LocalSwapToCommercialSubscription()

le_result_t taf_sim_LocalSwapToCommercialSubscription ( taf_sim_Id_t  simId,
taf_sim_Manufacturer_t  manufacturer 
)

Switches the given SIM to the commercial subscription. The eUICC reboots after switching the profile and the client app must wait for it.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid SIM identifier.
  • LE_FAULT – Unexpected error.
Note
The eUICC should be in the Ready state.
Ensure the commercial profile is available on the eUICC or an error will be thrown.
Parameters
[in]simIdThe SIM identifier.
[in]manufacturerThe card manufacturer.

◆ taf_sim_SetPower()

le_result_t taf_sim_SetPower ( taf_sim_Id_t  simId,
le_onoff_t  power 
)

Powers up or down the current SIM.

Returns
  • LE_OK – Succeeded.
  • LE_FAULT – Failed.
  • LE_NOT_FOUND – Failed to select the SIM card.
  • LE_BAD_PARAMETER – Incorrect parameter(s).
Note
For SIM power cycle operation, it must wait until the SIM state is LE_OFF before powering on the SIM, otherwise power up SIM will fail.
Parameters
[in]simIdThe SIM identifier.
[in]powerThe power state.

◆ taf_sim_Reset()

le_result_t taf_sim_Reset ( taf_sim_Id_t  simId)

Reset the SIM.

Returns
  • LE_FAULT – Failed.
  • LE_OK – Succeeded.
Parameters
[in]simIdThe SIM identifier.

◆ taf_sim_IsEmergencyCallSubscriptionSelected()

le_result_t taf_sim_IsEmergencyCallSubscriptionSelected ( taf_sim_Id_t  simId,
bool *  isEcsPtr 
)

Checks if the emergency profile is activated for the SIM slot.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid SIM identifier or null ECS pointer.
  • LE_NOT_FOUND – Cannot determine the current selected subscription.
  • LE_FAULT – Unexpected error.
Parameters
[in]simIdThe SIM identifier.
[out]isEcsPtr- True – Emergency call subscription (ECS) is selected.

◆ taf_sim_AddIccidChangeHandler()

taf_sim_IccidChangeHandlerRef_t taf_sim_AddIccidChangeHandler ( taf_sim_IccidChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_sim_IccidChange'

ICCID information.

Parameters
[in]handlerPtr
[in]contextPtr

◆ taf_sim_RemoveIccidChangeHandler()

void taf_sim_RemoveIccidChangeHandler ( taf_sim_IccidChangeHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_sim_IccidChange'

Parameters
[in]handlerRef

◆ taf_sim_CreateFPLMNList()

taf_sim_FPLMNListRef_t taf_sim_CreateFPLMNList ( void  )

Creates an empty FPLMN list to insert the FPLMN operators.

Returns
  • Reference to the list object.
  • Null pointer if not able to create list reference.

◆ taf_sim_AddFPLMNOperator()

le_result_t taf_sim_AddFPLMNOperator ( taf_sim_FPLMNListRef_t  fplmnListRef,
const char *LE_NONNULL  mcc,
const char *LE_NONNULL  mnc 
)

Adds the FPLMN network into the newly created FPLMN list. If fplmnListRef, mcc, or mnc is not valid then this function will kill the calling client.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
  • LE_OVERFLOW The FPLMN operator cannot be inserted into the FPLMN list.
Parameters
[in]fplmnListRefFPLMN list reference.
[in]mccMobile Country Code.
[in]mncMobile Network Code.

◆ taf_sim_GetFirstFPLMNOperator()

le_result_t taf_sim_GetFirstFPLMNOperator ( taf_sim_FPLMNListRef_t  fplmnListRef,
char *  mccPtr,
size_t  mccPtrSize,
char *  mncPtr,
size_t  mncPtrSize 
)

Reads the first FPLMN network from the list of FPLMN objects retrieved with taf_sim_ReadFPLMNList(). If fplmnListRef, mccPtr, or mncPtr is not valid then this function will kill the calling client.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
  • LE_OVERFLOW MCC/MNC string size is greater than the string length parameter that has been given to this function.
Parameters
[in]fplmnListRefFPLMN list reference.
[out]mccPtrMobile Country Code.
[in]mccPtrSize
[out]mncPtrMobile Network Code.
[in]mncPtrSize

◆ taf_sim_GetNextFPLMNOperator()

le_result_t taf_sim_GetNextFPLMNOperator ( taf_sim_FPLMNListRef_t  fplmnListRef,
char *  mccPtr,
size_t  mccPtrSize,
char *  mncPtr,
size_t  mncPtrSize 
)

Reads the next FPLMN network from the list of FPLMN objects retrieved with le_sim_ReadFPLMNList(). If fplmnListRef, mccPtr, or mncPtr is not valid then this function will kill the calling client.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
  • LE_OVERFLOW MCC/MNC string size is greater than string length parameter that has been given to this function.
Parameters
[in]fplmnListRefFPLMN list reference.
[out]mccPtrMobile Country Code.
[in]mccPtrSize
[out]mncPtrMobile Network Code.
[in]mncPtrSize

◆ taf_sim_ReadFPLMNList()

taf_sim_FPLMNListRef_t taf_sim_ReadFPLMNList ( taf_sim_Id_t  simId)

Reads the FPLMN list from the SIM.

Returns
  • Reference to the list object.
  • Null pointer if the FPLMN list is not able to read from the SIM.
Parameters
[in]simIdSIM identifier.

◆ taf_sim_DeleteFPLMNList()

void taf_sim_DeleteFPLMNList ( taf_sim_FPLMNListRef_t  fplmnListRef)

Deletes the FPLMN list created by le_sim_ReadFPLMNList() or le_sim_CreateFPLMNList(). If fplmnListRef is not valid then this function will kill the calling client.

Note
On failure, the process exits so that users do not have to worry about checking the returned reference for validity.
Parameters
[in]fplmnListRefFPLMN list reference.

◆ taf_sim_WriteFPLMNList()

le_result_t taf_sim_WriteFPLMNList ( taf_sim_Id_t  simId,
taf_sim_FPLMNListRef_t  fplmnListRef 
)

Writes the FPLMN list into the SIM. If fplmnListRef is not valid then this function will kill the calling client.

Returns
  • LE_FAULT Function failed.
  • LE_OK Function succeeded.
Parameters
[in]simIdSIM identifier.
[in]fplmnListRefFPLMN list reference.

◆ taf_sim_GetSlotCount()

le_result_t taf_sim_GetSlotCount ( int32_t *  countPtr)

Retrieves the total number of SIM slots in the device.

Returns
LE_FAULT Failed to retrieve the slot count.
LE_OK The slot count was retrieved successfully.
Parameters
[out]countPtrSlot count.