Sample code for SIM Identification
//--------------------------------------------------------------------------------------------------/*** Print function.**///--------------------------------------------------------------------------------------------------void Print(char* string){bool sandboxed = (getuid() != 0);if(sandboxed){}else{fprintf(stderr, "%s\n", string);}}
//--------------------------------------------------------------------------------------------------/*** Test: Creation & information retrieving.**///--------------------------------------------------------------------------------------------------void simTest_Create(le_sim_Id_t simId,const char* pinPtr){bool presence = false;char iccid[LE_SIM_ICCID_BYTES] = {0};char imsi[LE_SIM_IMSI_BYTES] = {0};le_result_t res;// Enter PIN coderes = le_sim_EnterPIN(simId, pinPtr);LE_ASSERT(res==LE_OK);// Get ICCIDres = le_sim_GetICCID(simId, iccid, sizeof(iccid));LE_ASSERT(res==LE_OK);Print( iccid );// Get IMSIres = le_sim_GetIMSI(simId, imsi, sizeof(imsi));LE_ASSERT(res==LE_OK);Print( imsi );// Check if SIM presentpresence = le_sim_IsPresent(simId);LE_ASSERT(presence);}