Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
#include <cs_MeshMsgEvent.h>
Public Member Functions | |
template<cs_mesh_model_msg_type_t MeshModelType> | |
auto & | getPacket () |
Returns the message data of this event as the original mesh model type, by reference. More... | |
Public Attributes | |
cs_mesh_model_msg_type_t | type |
Message type. More... | |
cs_data_t | msg |
Message payload. More... | |
stone_id_t | srcStoneId |
Stone ID of the original sender. More... | |
bool | macAddressValid |
True when the following MAC address is valid. More... | |
uint8_t | macAddress [MAC_ADDRESS_LEN] |
MAC address of the node from which this message was received, which is the source if not relayed. More... | |
int8_t | rssi |
RSSI of the last hop, thus the RSSI to the source if not relayed. More... | |
uint8_t | channel |
Channel of the last hop. More... | |
bool | isMaybeRelayed |
Whether this message may have been relayed. More... | |
bool | isReply |
Whether this message is a reply. More... | |
cs_control_cmd_t | controlCommand = CTRL_CMD_UNKNOWN |
When not CTRL_CMD_UNKNOWN and this message is a reply, this is the control command that caused the message to be sent that this message is a reply to. More... | |
mesh_reply_t * | reply = nullptr |
If set, a reply is expected. More... | |
cs_mesh_model_opcode_t | opCode |
Mesh model opcode: internal usage only (debug). More... | |
uint8_t | ttl |
Current TTL: internal usage only (debug). More... | |
|
inline |
Returns the message data of this event as the original mesh model type, by reference.
E.g.
MeshMessageEvent e (.. constructor args ..);
.. send over event bus ..
auto sync_packet = e.getPacket<CS_MESH_MODEL_TYPE_TIME_SYNC>(); printf("%d", sync_packet.sender);
uint8_t MeshMsgEvent::channel |
Channel of the last hop.
cs_control_cmd_t MeshMsgEvent::controlCommand = CTRL_CMD_UNKNOWN |
When not CTRL_CMD_UNKNOWN and this message is a reply, this is the control command that caused the message to be sent that this message is a reply to.
bool MeshMsgEvent::isMaybeRelayed |
Whether this message may have been relayed.
bool MeshMsgEvent::isReply |
Whether this message is a reply.
uint8_t MeshMsgEvent::macAddress[MAC_ADDRESS_LEN] |
MAC address of the node from which this message was received, which is the source if not relayed.
bool MeshMsgEvent::macAddressValid |
True when the following MAC address is valid.
cs_data_t MeshMsgEvent::msg |
Message payload.
cs_mesh_model_opcode_t MeshMsgEvent::opCode |
Mesh model opcode: internal usage only (debug).
mesh_reply_t* MeshMsgEvent::reply = nullptr |
If set, a reply is expected.
Set the message type, write your payload to the buffer, and set the data size to the size of the payload.
int8_t MeshMsgEvent::rssi |
RSSI of the last hop, thus the RSSI to the source if not relayed.
stone_id_t MeshMsgEvent::srcStoneId |
Stone ID of the original sender.
uint8_t MeshMsgEvent::ttl |
Current TTL: internal usage only (debug).
Message type.