Zephyr API Documentation
3.4.0
A Scalable Open Source RTOS
|
|
3.4.0 |
Type used to represent an observer. More...
#include <zbus.h>
Data Fields | |
const char *const | name |
bool | enabled |
struct k_msgq *const | queue |
void(*const | callback )(const struct zbus_channel *chan) |
Type used to represent an observer.
Every observer has an representation structure containing the relevant information. An observer is a code portion interested in some channel. The observer can be notified synchronously or asynchronously and it is called listener and subscriber respectively. The observer can be enabled or disabled during runtime by change the enabled boolean field of the structure. The listeners have a callback function that is executed by the bus with the index of the changed channel as argument when the notification is sent. The subscribers have a message queue where the bus enqueues the index of the changed channel when a notification is sent.
void(*const zbus_observer::callback) (const struct zbus_channel *chan) |
Observer callback function. It turns the observer into a listener.
bool zbus_observer::enabled |
Enabled flag. Indicates if observer is receiving notification.
const char* const zbus_observer::name |
Observer name.
struct k_msgq* const zbus_observer::queue |
Observer message queue. It turns the observer into a subscriber.