Inter-thread communication support.
More...
|
typedef void(* | msg_print_t) (const void *data) |
| Print function of a message.
|
|
typedef const char *(* | msg_csv_header_t) () |
| Function to get the CSV header of a message.
|
|
typedef int(* | msg_csv_write_t) (char *buf, size_t len, const void *data) |
| Function to write a message to a CSV format.
|
|
Inter-thread communication support.
◆ MSG_AGG_TO_MSG_DEFINE
#define MSG_AGG_TO_MSG_DEFINE |
( |
| name, |
|
|
| msg, |
|
|
| init_val, |
|
|
| period, |
|
|
| min_separation, |
|
|
| watermark, |
|
|
| flag, |
|
|
| ... ) |
#include <nturt/msg/msg.h>
Value:
__VA_ARGS__);
#define AGG_TYPED_DEFINE(_name, _type, _init_val, _period, _min_separation, _watermark, _flag, _publish, _user_data,...)
Define a data aggregation named _name to monitor the update of members within a data type....
Definition aggregation.h:153
void msg_agg_publish(const void *data, void *user_data)
Publishing function for MSG_AGG_DEFINE.
Define a data aggregration for aggregating into message msg
. May be specified as static
to limit the scope of the aggregation.
- Parameters
-
[in] | name | Name of the aggregation. |
[in] | msg | Message to aggregate. |
[in] | init_val | Initial value of the message, must be a specified by AGG_DATA_INIT. |
[in] | period | Period of data publishing. |
[in] | min_separation | Minimum separation time between two data publishing. |
[in] | watermark | Watermark to wait for late-arriving members. |
[in] | flag | Flag of the aggregation. The same ones and rules as flag in AGG_DEFINE. |
[in] | ... | Members of msg to be monitored, must be specified by AGG_MEMBER. |
◆ MSG_CHAN_DECLARE
#define MSG_CHAN_DECLARE |
( |
| list | ) |
|
#include <nturt/msg/msg.h>
Value: ZBUS_CHAN_DECLARE(FOR_EACH(_MSG_CHAN, (, ), list))
Declare one message channel for every message in list
.
- Parameters
-
[in] | list | List of messages to define channels. |
◆ MSG_CHAN_DEFINE
#define MSG_CHAN_DEFINE |
( |
| list | ) |
|
#include <nturt/msg/msg.h>
Value:
#define N_FOR_EACH(F, sep,...)
Same as Zephyr FOR_EACH, useful for nested FOR_EACH macros.
Definition util.h:83
Define one message channel for every message in list
.
- Parameters
-
[in] | list | List of messages to define channels. |
- Note
- This macro uses logging to print messages, so a log module must be registered or declared before using this macro.
◆ MSG_LIST
◆ MSG_VCU_LIST
◆ msg_csv_header_t
typedef const char *(* msg_csv_header_t) () |
#include <nturt/msg/msg.h>
Function to get the CSV header of a message.
- Returns
- Pointer to the CSV header string.
◆ msg_csv_write_t
typedef int(* msg_csv_write_t) (char *buf, size_t len, const void *data) |
#include <nturt/msg/msg.h>
Function to write a message to a CSV format.
- Parameters
-
[in] | buf | Buffer to write the CSV data to. |
[in] | len | Length of the buffer. |
[in] | data | Pointer to the message data. |
- Returns
- Number of bytes that would be written to the buffer if it were large enough, excluding the null terminator.
◆ msg_print_t
typedef void(* msg_print_t) (const void *data) |
#include <nturt/msg/msg.h>
Print function of a message.
- Parameters
-
[in] | data | Pointer to the message data. |
◆ msg_agg_publish()
void msg_agg_publish |
( |
const void * | data, |
|
|
void * | user_data ) |
#include <nturt/msg/msg.h>
Publishing function for MSG_AGG_DEFINE.
- Warning
- Internal use only.
◆ msg_chan_csv_header()
const char * msg_chan_csv_header |
( |
const struct zbus_channel * | chan | ) |
|
#include <nturt/msg/msg.h>
Get the CSV header of a message channel.
- Parameters
-
- Returns
- Pointer to the CSV header string.
- Warning
- Only zbus channels defined with MSG_CHAN_DEFINE can be used with this function.
◆ msg_chan_csv_write()
int msg_chan_csv_write |
( |
const struct zbus_channel * | chan, |
|
|
const void * | data, |
|
|
char * | buf, |
|
|
size_t | len ) |
#include <nturt/msg/msg.h>
Write a message in CSV format to a buffer based on the channel.
- Parameters
-
[in] | chan | Message channel. |
[in] | data | Pointer to the message data. |
[in] | buf | Buffer to write the CSV data to. |
[in] | len | Length of the buffer. |
- Returns
- Number of bytes that would be written to the buffer if it were large enough, excluding the null terminator.
- Warning
- Only zbus channels defined with MSG_CHAN_DEFINE can be used with this function.
◆ MSG_CHAN_DECLARE() [1/2]
◆ MSG_CHAN_DECLARE() [2/2]
◆ msg_chan_is_from_msg()
bool msg_chan_is_from_msg |
( |
const struct zbus_channel * | chan | ) |
|
#include <nturt/msg/msg.h>
Check if the given zbus channel is a message channel.
- Parameters
-
chan | Zbus channel to check. |
- Returns
- True if the channel is a message channel, false otherwise.
◆ msg_chan_print()
void msg_chan_print |
( |
const struct zbus_channel * | chan, |
|
|
const void * | data ) |
#include <nturt/msg/msg.h>
Print a message based on the channel.
- Parameters
-
[in] | chan | Message channel. |
[in] | data | Pointer to the message data. |
- Warning
- Only zbus channels defined with MSG_CHAN_DEFINE can be used with this function.
◆ msg_sensor_wheel_agg