mirror of https://github.com/ARMmbed/mbed-os.git
Lora: Add clear method to LoRaWANTimer.
This function must be called by the callback registered in init. It clears the timer_id to prevent abusive use of the stop methods on expired timer.pull/14422/head
parent
eec320c991
commit
4885739c4e
|
@ -64,3 +64,8 @@ void LoRaWANTimeHandler::stop(timer_event_t &obj)
|
|||
_queue->cancel(obj.timer_id);
|
||||
obj.timer_id = 0;
|
||||
}
|
||||
|
||||
void LoRaWANTimeHandler::clear(timer_event_t &obj)
|
||||
{
|
||||
obj.timer_id = 0;
|
||||
}
|
|
@ -76,6 +76,13 @@ public:
|
|||
*/
|
||||
void stop(timer_event_t &obj);
|
||||
|
||||
/** Clear timer state so it is not inadvertently canceled. This function
|
||||
* must be called by the callback registered in init.
|
||||
*
|
||||
* @param [in] obj The structure containing the timer object parameters.
|
||||
*/
|
||||
void clear(timer_event_t &obj);
|
||||
|
||||
private:
|
||||
events::EventQueue *_queue;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue