Exemplo n.º 1
0
//--------------------------------------------------------------------------------------------------
le_result_t lwm2m_Init
(
    void
)
{
    // Register handlers for Operation and UpdateRequired indications
    pa_avc_SetLWM2MOperationHandler(OperationHandler);
    pa_avc_SetLWM2MUpdateRequiredHandler(assetData_RegistrationUpdate);

    return LE_OK;
}
Exemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
le_result_t lwm2m_Init
(
    void
)
{
    // Register handlers for Operation and UpdateRequired indications
    pa_avc_SetLWM2MOperationHandler(OperationHandler);
    pa_avc_SetLWM2MUpdateRequiredHandler(lwm2m_RegistrationUpdate);

    // Get instance creation or deletion events for any asset
    assetData_server_SetAllAssetActionHandler(AssetActionHandler, NULL);

    // Use a timer to delay reporting instance creation events to the modem for 15 seconds after
    // the last creation event.  The timer will only be started when the creation event happens.
    le_clk_Time_t timerInterval = { .sec=15, .usec=0 };

    RegUpdateTimerRef = le_timer_Create("RegUpdate timer");
    le_timer_SetInterval(RegUpdateTimerRef, timerInterval);
    le_timer_SetHandler(RegUpdateTimerRef, RegUpdateTimerHandler);

    return LE_OK;
}