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(); }
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(); } }
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; }
/* Interrupt handler for timer1. Polls keys and pushes events onto message queue. */ ISR (TIMER1_CAPT_vect, ISR_NOBLOCK) { handle_keys(); handle_timers(); }