Represents a framework event, optionally carrying payload data.
More...
#include <Event.h>
|
| Event ()=default |
| Default constructor (creates a SystemNotification::None event).
|
|
| Event (SystemNotification type, const void *data=nullptr, size_t size=0, void *source=nullptr, FrameworkTask *target=nullptr) |
| Construct an event with a system notification.
|
|
| Event (SystemNotification type, const GpioEvent &gpioEvent, size_t size=sizeof(GpioEvent), void *source=nullptr, FrameworkTask *target=nullptr) |
| Construct an event with a GpioEvent payload.
|
|
| Event (uint8_t userCode, const void *data=nullptr, size_t size=0, void *source=nullptr, FrameworkTask *target=nullptr) |
| Construct an event with a user-defined notification.
|
|
bool | isUser () const |
| Returns true if this is a user-defined event.
|
|
bool | isSystem () const |
| Returns true if this is a system-defined event.
|
|
uint8_t | userCode () const |
| Returns the raw user-defined code (safe to cast in app code)
|
|
SystemNotification | systemCode () const |
| Returns the system-defined enum value.
|
|
Definition at line 23 of file Event.h.
◆ Event() [1/4]
◆ Event() [2/4]
- Parameters
-
type | System notification type |
data | Optional pointer to payload |
size | Payload size |
source | Optional source pointer |
target | Optional target task |
Definition at line 48 of file Event.h.
Notification notification
Notification identifier (system or user)
FrameworkTask * target
Optional specific target (for directed delivery)
size_t size
Size of payload data
void * source
Optional source (e.g. controller that generated the event)
const void * data
For user use.
◆ Event() [3/4]
- Parameters
-
Definition at line 60 of file Event.h.
GpioEvent gpioEvent
Inline data if GpioChange.
◆ Event() [4/4]
Event::Event |
( |
uint8_t |
userCode, |
|
|
const void * |
data = nullptr , |
|
|
size_t |
size = 0 , |
|
|
void * |
source = nullptr , |
|
|
FrameworkTask * |
target = nullptr |
|
) |
| |
|
inline |
- Parameters
-
userCode | User-defined notification value |
data | Optional pointer to payload |
size | Payload size |
source | Optional source pointer |
target | Optional target task |
Definition at line 75 of file Event.h.
uint8_t userCode() const
Returns the raw user-defined code (safe to cast in app code)
◆ isSystem()
bool Event::isSystem |
( |
| ) |
const |
|
inline |
◆ isUser()
bool Event::isUser |
( |
| ) |
const |
|
inline |
◆ systemCode()
◆ userCode()
uint8_t Event::userCode |
( |
| ) |
const |
|
inline |
◆ [union]
◆ data
◆ gpioEvent
◆ notification
Definition at line 25 of file Event.h.
Referenced by isSystem(), isUser(), App::onEvent(), FrameworkManager::onEvent(), FrameworkManager::onStart(), EventManager::postEvent(), TimerService::scheduleDailyAt(), TimerService::scheduleDuration(), TimerService::scheduleEvery(), TimeManager::setTimeFromEpoch(), TimeManager::syncTimeWithNtp(), systemCode(), and userCode().
◆ size
◆ source
void* Event::source = nullptr |
◆ target
The documentation for this struct was generated from the following file: