Exemplo n.º 1
0
// -------------------------------------------------------------------------------------------------
static void MrcNetRegHandler
(
    le_mrc_NetRegState_t state,
    void*  contextPtr
)
{
    le_cellnet_State_t cellNetState = TranslateToCellNetState(state);

    LE_PRINT_VALUE("Cellular Network Registration state.%d", cellNetState);

    // Send the state event to applications
    le_event_Report(CellNetStateEvent, &cellNetState, sizeof(cellNetState));
}
Exemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
static void SendCellNetStateEvent
(
    void
)
{
    le_mrc_NetRegState_t  state;
    le_mrc_GetNetRegState(&state);
    le_cellnet_State_t cellNetState = TranslateToCellNetState(state);
    LE_PRINT_VALUE("%i", cellNetState);

    // Send the event to interested applications
    le_event_Report(CellNetStateEvent, &cellNetState, sizeof(cellNetState));
}
// -------------------------------------------------------------------------------------------------
static void MrcNetRegHandler
(
    le_mrc_NetRegState_t state,
    void*  contextPtr
)
{
    le_cellnet_State_t cellNetState = TranslateToCellNetState(state);

    LE_DEBUG("MRC network state %d translated to Cellular network state %d (%s)",
             state, cellNetState, cellNetStateStr[cellNetState]);

    // Send the state event to applications
    ReportCellNetStateEvent(cellNetState);
}
//--------------------------------------------------------------------------------------------------
static void GetAndSendCellNetStateEvent
(
    void
)
{
    le_mrc_NetRegState_t state        = LE_MRC_REG_UNKNOWN;
    le_cellnet_State_t   cellNetState = LE_CELLNET_REG_UNKNOWN;

    // Retrieve network registration state
    if (LE_OK == le_mrc_GetNetRegState(&state))
    {
        cellNetState = TranslateToCellNetState(state);
    }
    else
    {
        LE_ERROR("Impossible to retrieve network registration state!");
    }

    LE_DEBUG("MRC network state %d translated to Cellular network state %d (%s)",
             state, cellNetState, cellNetStateStr[cellNetState]);

    // Send the state event to applications
    ReportCellNetStateEvent(cellNetState);
}