Sample code for SIM Select

//--------------------------------------------------------------------------------------------------
/**
* Test: SIM selection.
*
*/
//--------------------------------------------------------------------------------------------------
void simTest_SimSelect
(
)
{
// Select the embedded SIM
LE_ASSERT_OK(le_sim_SelectCard(LE_SIM_EMBEDDED));
 
// Get the selected card
le_sim_Id_t simId = le_sim_GetSelectedCard();
LE_ASSERT(LE_SIM_EMBEDDED == simId);
 
// Select the LE_SIM_EXTERNAL_SLOT_1 SIM
LE_ASSERT_OK(le_sim_SelectCard(LE_SIM_EXTERNAL_SLOT_1));
 
// Get the selected card
LE_ASSERT(LE_SIM_EXTERNAL_SLOT_1 == simId);
 
// Check if SIM present
if (!le_sim_IsPresent(LE_SIM_EMBEDDED))
{
LE_INFO("SIM not present");
}
 
// Get the selected card by le_sim_GetSelectedCard()
// Notice that the selected card received is the one used by the
// last Legato API and not the one set by le_sim_SelectCard().
LE_ASSERT(LE_SIM_EMBEDDED == simId);
 
// Check SIM ready
if (!le_sim_IsReady(LE_SIM_EXTERNAL_SLOT_1))
{
LE_INFO("SIM not ready");
}
 
// Get the selected card by le_sim_GetSelectedCard()
// Notice that the selected card received is the one used by the
// last Legato API and not the one set by le_sim_SelectCard().
LE_ASSERT(LE_SIM_EXTERNAL_SLOT_1 == simId);
 
 
}