Zephyr API Documentation  3.4.0
A Scalable Open Source RTOS
3.4.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
zbus_channel Struct Reference

Type used to represent a channel. More...

#include <zbus.h>

Data Fields

const char *const name
 
const uint16_t message_size
 
void *const user_data
 
void *const message
 
bool(*const validator )(const void *msg, size_t msg_size)
 
struct k_mutexmutex
 
sys_slist_truntime_observers
 
const struct zbus_observer *const * observers
 

Detailed Description

Type used to represent a channel.

Every channel has a zbus_channel structure associated used to control the channel access and usage.

Field Documentation

◆ message

void* const zbus_channel::message

Message reference. Represents the message's reference that points to the actual shared memory region.

◆ message_size

const uint16_t zbus_channel::message_size

Message size. Represents the channel's message size.

◆ mutex

struct k_mutex* zbus_channel::mutex

Access control mutex. Points to the mutex used to avoid race conditions for accessing the channel.

◆ name

const char* const zbus_channel::name

Channel name.

◆ observers

const struct zbus_observer* const* zbus_channel::observers

Channel observer list. Represents the channel's observers list, it can be empty or have listeners and subscribers mixed in any sequence.

◆ runtime_observers

sys_slist_t* zbus_channel::runtime_observers

Dynamic channel observer list. Represents the channel's observers list, it can be empty or have listeners and subscribers mixed in any sequence. It can be changed in runtime.

◆ user_data

void* const zbus_channel::user_data

User data available to extend zbus features. The channel must be claimed before using this field.

◆ validator

bool(*const zbus_channel::validator) (const void *msg, size_t msg_size)

Message validator. Stores the reference to the function to check the message validity before actually performing the publishing. No invalid messages can be published. Every message is valid when this field is empty.


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