Go to the documentation of this file.
73 #define MSB_BUS_PID_FLAG (1U << ((8 * sizeof(kernel_pid_t)) - 1))
103 return msg->
type & 0x1F;
142 if (bus != NULL && (bus->
id != (msg->
type >> 5))) {
255 .
type = type | ((bus->
id) << 5),
256 .content.ptr = (
void *)arg,
int16_t kernel_pid_t
Unique process identifier.
list_node_t next
next subscriber
static void msg_bus_subscribe(msg_bus_entry_t *entry, uint8_t type)
Subscribe to an event on the message bus.
#define assert(cond)
abort the program if assertion is false
msg_bus_entry_t * msg_bus_get_entry(msg_bus_t *bus)
Get the message bus entry for the current thread.
Message bus subscriber entry.
void msg_bus_attach(msg_bus_t *bus, msg_bus_entry_t *entry)
Attach a thread to a message bus.
POSIX.1-2008 compliant version of the assert macro.
static int msg_bus_post(msg_bus_t *bus, uint8_t type, const void *arg)
Post a message to a bus.
uint32_t event_mask
Bitmask of event classes.
Messaging API for inter process communication.
uint16_t id
Message Bus ID.
static uint16_t msg_bus_get_type(const msg_t *msg)
Get the message type of a message bus message.
int msg_send_bus(msg_t *m, msg_bus_t *bus)
Post a pre-assembled message to a bus.
static kernel_pid_t msg_bus_get_sender_pid(const msg_t *msg)
Get the sender PID of a message bus message.
static void msg_bus_unsubscribe(msg_bus_entry_t *entry, uint8_t type)
Unsubscribe from an event on the message bus.
void msg_bus_init(msg_bus_t *bus)
Initialize a message bus.
void msg_bus_detach(msg_bus_t *bus, msg_bus_entry_t *entry)
Remove a thread from a message bus.
static bool msg_is_from_bus(const msg_bus_t *bus, const msg_t *msg)
Check if a message originates from a bus.
A message bus is just a list of subscribers.
#define MSB_BUS_PID_FLAG
Flag set on sender_pid of msg_t that indicates that the message was sent over a bus.
kernel_pid_t pid
Subscriber PID.
list_node_t subs
List of subscribers to the bus.
kernel_pid_t sender_pid
PID of sending thread.
Describes a message object which can be sent between threads.