#include <TaskScheduler.h>
|
| | SchedulerTask (IExecutor &executor) |
| | Constructor that wraps an IExecutor implementation.
|
| |
| | SchedulerTask (SchedulerTaskCallback callback) |
| | Constructor with custom callback function.
|
| |
| void | attach (uint32_t ms, short times=0) |
| | Attach the task to run on a specified interval.
|
| |
| void | once (uint32_t ms) |
| | Schedule the task to run once after the specified delay.
|
| |
| void | loop () |
| | Main execution loop for the task.
|
| |
| uint64_t | getTotalElapsedMs () const |
| | Get the total execution time of this task in milliseconds.
|
| |
| | ESP8266Task () |
| | Constructor.
|
| |
| virtual | ~ESP8266Task () |
| | Destructor that ensures the timer is detached.
|
| |
| void | attach (uint32_t ms, bool repeat, TaskCallback callback) |
| | Attach a simple callback to run periodically.
|
| |
| template<typename T> |
| void | attach (uint32_t ms, bool repeat, TaskTypeCallback< volatile T > callback, volatile T arg) |
| | Attach a typed callback with argument to run periodically.
|
| |
| void | detach () |
| | Stop and detach the timer.
|
| |
| bool | isAttached () |
| | Check if the timer is attached.
|
| |
◆ SchedulerTaskCallback
Callback function signature for scheduled tasks.
- Parameters
-
| task | Reference to the executing task |
| times | Number of repetitions left (-1 for infinite) |
◆ spSchedulerTaskCallback
Shared pointer type for task callbacks.
◆ SchedulerTask() [1/2]
| uniot::SchedulerTask::SchedulerTask |
( |
IExecutor & | executor | ) |
|
|
inline |
Constructor that wraps an IExecutor implementation.
- Parameters
-
| executor | The executor to be called when the task runs |
◆ SchedulerTask() [2/2]
Constructor with custom callback function.
- Parameters
-
| callback | Function to execute when the task runs |
◆ attach()
| void uniot::SchedulerTask::attach |
( |
uint32_t | ms, |
|
|
short | times = 0 ) |
|
inline |
Attach the task to run on a specified interval.
- Parameters
-
| ms | Millisecond interval between executions |
| times | Number of times to execute (0 or negative for infinite) |
◆ getTotalElapsedMs()
| uint64_t uniot::SchedulerTask::getTotalElapsedMs |
( |
| ) |
const |
|
inline |
Get the total execution time of this task in milliseconds.
- Return values
-
| time | Total elapsed time in milliseconds |
◆ loop()
| void uniot::SchedulerTask::loop |
( |
| ) |
|
|
inline |
Main execution loop for the task.
Checks if the task is ready to execute and runs the callback if so. Tracks execution time and manages repeat counts.
◆ once()
| void uniot::SchedulerTask::once |
( |
uint32_t | ms | ) |
|
|
inline |
Schedule the task to run once after the specified delay.
- Parameters
-
| ms | Millisecond delay before execution |
The documentation for this class was generated from the following file: