예제 #1
0
void M2MReportHandler::report_object_notification()
{
    tr_debug("M2MReportHandler::report_object_notification()");
    if(_under_observation) {
        _pmin_exceeded = false;
        _pmax_exceeded = false;        
        _observer.observation_to_be_sent();
    }
    handle_timers();
}
예제 #2
0
void M2MReportHandler::set_under_observation(bool observed)
{
    tr_debug("M2MReportHandler::set_under_observation(observed %d)", (int)observed);
    _under_observation = observed;
    _report_scheduled = false;    
    stop_timers();
    if(observed) {
        handle_timers();
    }
    else {        
        set_default_values();
    }
}
예제 #3
0
void M2MReportHandler::report(float /*value*/)
{
    tr_debug("M2MReportHandler::report()");
    if(_under_observation && _current_value != _last_value && _notify) {
        tr_debug("M2MReportHandler::report()- send with PMIN");
        _pmin_exceeded = false;
        _pmax_exceeded = false;
        _notify = false;
        _observer.observation_to_be_sent();
    }
    else {
        if (_pmax_exceeded) {
            tr_debug("M2MReportHandler::report()- send with PMAX");
            _observer.observation_to_be_sent();
        }
        else {
            tr_debug("M2MReportHandler::report()- no need to send");
        }
    }
    handle_timers();
    _last_value = _current_value;
}
예제 #4
0
/* Interrupt handler for timer1. Polls keys and pushes events onto message queue. */
ISR (TIMER1_CAPT_vect, ISR_NOBLOCK)
{
    handle_keys();
    handle_timers();
}