All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
msg.h File Reference

Messaging API for inter process communication. More...

Detailed Description

Messaging API for inter process communication.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e
Kévin Roussel Kevin.nosp@m..Rou.nosp@m.ssel@.nosp@m.inri.nosp@m.a.fr

Definition in file msg.h.

#include <stdint.h>
#include <stdbool.h>
#include "sched.h"
+ Include dependency graph for msg.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  msg_t
 Describes a message object which can be sent between threads. More...
 

Macros

#define KERNEL_PID_ISR   (KERNEL_PID_LAST + 1)
 Value of msg_t::sender_pid if the sender was an interrupt service routine.
 
#define CONFIG_MSG_QUEUE_PRINT_MAX   16U
 Number of messages to be maximally printed through msg_queue_print.
 

Functions

int msg_send (msg_t *m, kernel_pid_t target_pid)
 Send a message (blocking).
 
int msg_try_send (msg_t *m, kernel_pid_t target_pid)
 Send a message (non-blocking).
 
int msg_send_to_self (msg_t *m)
 Send a message to the current thread.
 
int msg_send_int (msg_t *m, kernel_pid_t target_pid)
 Send message from interrupt.
 
static int msg_sent_by_int (const msg_t *m)
 Test if the message was sent inside an ISR.
 
int msg_receive (msg_t *m)
 Receive a message.
 
int msg_try_receive (msg_t *m)
 Try to receive a message.
 
int msg_send_receive (msg_t *m, msg_t *reply, kernel_pid_t target_pid)
 Send a message, block until reply received.
 
int msg_reply (msg_t *m, msg_t *reply)
 Replies to a message.
 
int msg_reply_int (msg_t *m, msg_t *reply)
 Replies to a message from interrupt.
 
unsigned msg_avail_thread (kernel_pid_t pid)
 Check how many messages are available (waiting) in the message queue of a specific thread.
 
unsigned msg_avail (void)
 Check how many messages are available (waiting) in the message queue.
 
unsigned msg_queue_capacity (kernel_pid_t pid)
 Get maximum capacity of a thread's queue length.
 
void msg_init_queue (msg_t *array, int num)
 Initialize the current thread's message queue.
 
void msg_queue_print (void)
 Prints the message queue of the current thread.