Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
MeshMsgEvent Class Reference

#include <cs_MeshMsgEvent.h>

Collaboration diagram for MeshMsgEvent:

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_treply = 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...
 

Member Function Documentation

◆ getPacket()

template<cs_mesh_model_msg_type_t MeshModelType>
auto & MeshMsgEvent::getPacket ( )
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);

Member Data Documentation

◆ channel

uint8_t MeshMsgEvent::channel

Channel of the last hop.

◆ controlCommand

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.

◆ isMaybeRelayed

bool MeshMsgEvent::isMaybeRelayed

Whether this message may have been relayed.

◆ isReply

bool MeshMsgEvent::isReply

Whether this message is a reply.

◆ macAddress

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.

◆ macAddressValid

bool MeshMsgEvent::macAddressValid

True when the following MAC address is valid.

◆ msg

cs_data_t MeshMsgEvent::msg

Message payload.

◆ opCode

cs_mesh_model_opcode_t MeshMsgEvent::opCode

Mesh model opcode: internal usage only (debug).

◆ reply

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.

◆ rssi

int8_t MeshMsgEvent::rssi

RSSI of the last hop, thus the RSSI to the source if not relayed.

◆ srcStoneId

stone_id_t MeshMsgEvent::srcStoneId

Stone ID of the original sender.

◆ ttl

uint8_t MeshMsgEvent::ttl

Current TTL: internal usage only (debug).

◆ type


The documentation for this class was generated from the following file: