1 /* 2 * Copyright (c) 2022 Rodrigo Peixoto <rodrigopex@gmail.com> 3 * SPDX-License-Identifier: Apache-2.0 4 */ 5 #include "messages.h" 6 7 #include <zephyr/zbus/zbus.h> 8 9 ZBUS_CHAN_DEFINE(version_chan, /* Name */ 10 struct version_msg, /* Message type */ 11 12 NULL, /* Validator */ 13 NULL, /* User data */ 14 ZBUS_OBSERVERS_EMPTY, /* observers */ 15 ZBUS_MSG_INIT(.major = 0, .minor = 1, 16 .build = 1023) /* Initial value major 0, minor 1, build 1023 */ 17 ); 18 19 ZBUS_CHAN_DEFINE(sensor_data_chan, /* Name */ 20 struct sensor_data_msg, /* Message type */ 21 22 NULL, /* Validator */ 23 NULL, /* User data */ 24 ZBUS_OBSERVERS(core_sub), /* observers */ 25 ZBUS_MSG_INIT(0) /* Initial value {0} */ 26 ); 27 28 ZBUS_CHAN_DEFINE(net_pkt_chan, /* Name */ 29 struct net_pkt_msg, /* Message type */ 30 31 NULL, /* Validator */ 32 NULL, /* User data */ 33 ZBUS_OBSERVERS(net_sub), /* observers */ 34 ZBUS_MSG_INIT(.total = 0) /* Initial value */ 35 ); 36 37 ZBUS_CHAN_DEFINE(net_log_chan, /* Name */ 38 struct net_log_msg, /* Message type */ 39 40 NULL, /* Validator */ 41 NULL, /* User data */ 42 ZBUS_OBSERVERS(net_log_sub), /* observers */ 43 ZBUS_MSG_INIT(0) /* Initial value */ 44 ); 45 46 ZBUS_CHAN_DEFINE(start_measurement_chan, /* Name */ 47 struct action_msg, /* Message type */ 48 49 NULL, /* Validator */ 50 NULL, /* User data */ 51 ZBUS_OBSERVERS(peripheral_sub, critical_lis), /* observers */ 52 ZBUS_MSG_INIT(.status = false) /* Initial value */ 53 ); 54 55 ZBUS_CHAN_DEFINE(busy_chan, /* Name */ 56 struct action_msg, /* Message type */ 57 58 NULL, /* Validator */ 59 NULL, /* User data */ 60 ZBUS_OBSERVERS_EMPTY, /* observers */ 61 ZBUS_MSG_INIT(.status = false) /* Initial value */ 62 ); 63