Go to the source code of this file.
Legato SIM Services include file.
Copyright (C) Sierra Wireless, Inc. 2013. All rights reserved. Use of this work is subject to license.
#define LE_SIM_ICCID_LEN (20+1) |
ICCID length According to GSM Phase 1
#define LE_SIM_IMSI_LEN (15+1) |
IMSI length
#define LE_SIM_PIN_MAX_LEN 8 |
Maximum PIN length (8 digits)
#define LE_SIM_PIN_MIN_LEN 4 |
Minimum PIN length (4 digits)
#define LE_SIM_PUK_LEN 8 |
PUK length (8 digits)
typedef void(* le_sim_NewStateHandlerFunc_t)(le_sim_Ref_t simRef, void *contextPtr) |
Prototype for handler functions used to report SIM state notifications.
simRef | SIM reference. |
contextPtr | Context information the event handler may require. |
typedef struct le_sim_NewStateHandler* le_sim_NewStateHandlerRef_t |
Reference to a "New State" event handler that was registered using le_sim_AddNewStateHandler().
typedef struct le_Sim* le_sim_Ref_t |
Declare a reference type for referring to SIM objects.
le_sim_NewStateHandlerRef_t le_sim_AddNewStateHandler | ( | le_sim_NewStateHandlerFunc_t | handlerFuncPtr, |
void * | contextPtr | ||
) |
Register a handler function for New State notification.
[in] | handlerFuncPtr | Handler function for New State notification. |
[in] | contextPtr | Handler's context. |
le_result_t le_sim_ChangePIN | ( | le_sim_Ref_t | simRef, |
const char * | oldpinPtr, | ||
const char * | newpinPtr | ||
) |
Change the PIN code.
[in] | simRef | SIM object. |
[in] | oldpinPtr | old PIN code. |
[in] | newpinPtr | new PIN code. |
uint32_t le_sim_CountSlots | ( | void | ) |
Count the number of SIM card slots.
le_sim_Ref_t le_sim_Create | ( | uint32_t | cardNum | ) |
Create a SIM object.
[in] | cardNum | The SIM card number (1 or 2, it depends on the platform). |
void le_sim_Delete | ( | le_sim_Ref_t | simRef | ) |
Delete a SIM object.
This frees all the resources allocated for the SIM object. If several users own the SIM object (e.g., several handler functions registered for new state notifications), the SIM object will only be actually deleted after the last user deletes the SIM object.
[in] | simRef | SIM object. |
le_result_t le_sim_EnterPIN | ( | le_sim_Ref_t | simRef, |
const char * | pinPtr | ||
) |
This function must be called to enter the PIN code.
[in] | simRef | SIM object. |
[in] | pinPtr | PIN code. |
le_result_t le_sim_GetICCID | ( | le_sim_Ref_t | simRef, |
char * | iccidPtr, | ||
size_t | iccidLen | ||
) |
Retrieves the integrated circuit card identifier (ICCID) of the SIM card (20 digits)
[in] | simRef | SIM object. |
[out] | iccidPtr | Buffer to hold the ICCID. |
[in] | iccidLen | Buffer length |
le_result_t le_sim_GetIMSI | ( | le_sim_Ref_t | simRef, |
char * | imsiPtr, | ||
size_t | imsiLen | ||
) |
Retrieves the identification number (IMSI) of the SIM card. (max 15 digits)
[in] | simRef | SIM object. |
[out] | imsiPtr | Buffer to hold the IMSI. |
[in] | imsiLen | Buffer length |
int32_t le_sim_GetRemainingPINTries | ( | le_sim_Ref_t | simRef | ) |
Get the number of remaining PIN insertion tries.
[in] | simRef | SIM object. |
uint32_t le_sim_GetSelectedCard | ( | void | ) |
Get the current selected card.
uint32_t le_sim_GetSlotNumber | ( | le_sim_Ref_t | simRef | ) |
Retrieve the slot number of the SIM card.
[in] | simRef | SIM object. |
le_sim_States_t le_sim_GetState | ( | le_sim_Ref_t | simRef | ) |
Get the SIM state.
[in] | simRef | SIM object. |
le_result_t le_sim_GetSubscriberPhoneNumber | ( | le_sim_Ref_t | simRef, |
char * | phoneNumberStr, | ||
size_t | phoneNumberStrSize | ||
) |
Get the SIM Phone Number.
[in] | simRef | SIM object. |
[out] | phoneNumberStr | The phone Number |
[in] | phoneNumberStrSize | Size of phoneNumberStr |
bool le_sim_IsPresent | ( | le_sim_Ref_t | simRef | ) |
Verify if the SIM card is present or not.
[in] | simRef | SIM object. |
bool le_sim_IsReady | ( | le_sim_Ref_t | simRef | ) |
Verify if the SIM is ready (PIN code correctly inserted or not required).
true PIN is correctly inserted or not required.
[in] | simRef | SIM object. |
le_result_t le_sim_Lock | ( | le_sim_Ref_t | simRef, |
const char * | pinPtr | ||
) |
Lock the SIM card: it enables the request of the PIN code.
[in] | simRef | SIM object. |
[in] | pinPtr | PIN code. |
void le_sim_RemoveNewStateHandler | ( | le_sim_NewStateHandlerRef_t | handlerRef | ) |
Unregister a handler function
[in] | handlerRef | Handler reference. |
le_result_t le_sim_Unblock | ( | le_sim_Ref_t | simRef, |
const char * | pukPtr, | ||
const char * | newpinPtr | ||
) |
Unblock the SIM card.
[in] | simRef | SIM object. |
[in] | pukPtr | PUK code. |
[in] | newpinPtr | New PIN code. |
le_result_t le_sim_Unlock | ( | le_sim_Ref_t | simRef, |
const char * | pinPtr | ||
) |
Unlock the SIM card: it disables the request of the PIN code.
[in] | simRef | SIM object. |
[in] | pinPtr | PIN code. |