Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
TimerJob Struct Reference

Represents a job scheduled by the TimerService. More...

#include <TimerService.h>

+ Collaboration diagram for TimerJob:

Public Attributes

TimeOfDay startTime
 When the event should start.
 
DaysOfWeek repeatDays
 Days the job runs (bitmask)
 
uint32_t durationMs = 0
 Optional run duration in ms.
 
Event startEvent
 Event to post at start.
 
Event stopEvent
 Optional stop event.
 
bool recurring = true
 If true, job repeats.
 

Detailed Description

Note
Memory & Timer Lifetime (v0.1):
  • One-shot timers (scheduleAt, scheduleDailyAt, scheduleDuration) dynamically allocate an Event using new and clean it up automatically after posting (inside the timer callback).
  • Repeating timers (scheduleEvery) also allocate an Event, which is reused on each invocation. It is not deleted automatically and is assumed to remain valid for the lifetime of the timer.

    It is now possible to cancel scheduled jobs using a job ID which will delete the timer and free the associated event.

    Todo:
    Possibles for v0.2+:

Definition at line 56 of file TimerService.h.

Member Data Documentation

◆ durationMs

uint32_t TimerJob::durationMs = 0

Definition at line 60 of file TimerService.h.

◆ recurring

bool TimerJob::recurring = true

Definition at line 63 of file TimerService.h.

◆ repeatDays

DaysOfWeek TimerJob::repeatDays

Definition at line 59 of file TimerService.h.

◆ startEvent

Event TimerJob::startEvent

Definition at line 61 of file TimerService.h.

◆ startTime

TimeOfDay TimerJob::startTime

Definition at line 58 of file TimerService.h.

◆ stopEvent

Event TimerJob::stopEvent

Definition at line 62 of file TimerService.h.


The documentation for this struct was generated from the following file: