コード例 #1
0
// -------------------------------------------------------------------------------------------------
static void CellNetStateHandler
(
    le_cellnet_State_t state,
    void*              contextPtr
)
{
    static le_cellnet_State_t oldState = LE_CELLNET_REG_UNKNOWN;
    LE_INFO("Cellular Network state is %d", state);

    if (state == LE_CELLNET_REG_HOME)
    {
        oldState = LE_CELLNET_REG_HOME;
        SwitchOffCellNet();
        LE_INFO("Verify that Cellular Network is OFF by checking CellNet events.");
    }

    if ((oldState == LE_CELLNET_REG_HOME) && (state == LE_CELLNET_REG_EMERGENCY))
    {
        LE_INFO("Cellular Network is OFF has been checked.");
        le_cellnet_RemoveStateEventHandler(StateHandlerRef);
        LE_INFO("StateHandlerRef (%p) removed", StateHandlerRef);
        LE_INFO("========  cellNetServiceTest TEST PASSED ======== ");
        exit(EXIT_SUCCESS);
    }
}
コード例 #2
0
// -------------------------------------------------------------------------------------------------
static void CellNetStateHandler
(
    le_cellnet_State_t state,
    void*              contextPtr
)
{
    LE_INFO("Cellular Network state is %d", state);

    if (state == LE_CELLNET_REG_HOME)
    {
        SwitchOffCellNet();

        LE_INFO("Verify that Cellular Network is OFF by checking CellNet events.");
    }
}