Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::ESP8266Task Class Reference

#include <ESP8266Task.h>

Inheritance diagram for uniot::ESP8266Task:
[legend]

Public Types

using TaskCallback = void (*)(void)
 Callback function with no arguments.
 
using TaskArgCallback = void (*)(void *)
 Callback function with void pointer argument.
 
template<typename T>
using TaskTypeCallback = void (*)(volatile T)
 Templated callback function with typed argument.
 

Public Member Functions

 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.
 

Member Typedef Documentation

◆ TaskArgCallback

using uniot::ESP8266Task::TaskArgCallback = void (*)(void *)

Callback function with void pointer argument.

◆ TaskCallback

using uniot::ESP8266Task::TaskCallback = void (*)(void)

Callback function with no arguments.

◆ TaskTypeCallback

template<typename T>
using uniot::ESP8266Task::TaskTypeCallback = void (*)(volatile T)

Templated callback function with typed argument.

Constructor & Destructor Documentation

◆ ESP8266Task()

uniot::ESP8266Task::ESP8266Task ( )
inline

Constructor.

◆ ~ESP8266Task()

virtual uniot::ESP8266Task::~ESP8266Task ( )
inlinevirtual

Destructor that ensures the timer is detached.

Member Function Documentation

◆ attach() [1/2]

void uniot::ESP8266Task::attach ( uint32_t ms,
bool repeat,
TaskCallback callback )
inline

Attach a simple callback to run periodically.

Parameters
msMillisecond interval between executions
repeatTrue to run repeatedly, false to run once
callbackFunction to execute

◆ attach() [2/2]

template<typename T>
void uniot::ESP8266Task::attach ( uint32_t ms,
bool repeat,
TaskTypeCallback< volatile T > callback,
volatile T arg )
inline

Attach a typed callback with argument to run periodically.

Parameters
msMillisecond interval between executions
repeatTrue to run repeatedly, false to run once
callbackFunction to execute
argArgument to pass to the callback (must fit in 4 bytes)

◆ detach()

void uniot::ESP8266Task::detach ( )
inline

Stop and detach the timer.

◆ isAttached()

bool uniot::ESP8266Task::isAttached ( )
inline

Check if the timer is attached.

Return values
trueThe timer is attached and running
falseThe timer is not attached

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