Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_MeshCommon.h
Go to the documentation of this file.
1/*
2 * Author: Crownstone Team
3 * Copyright: Crownstone (https://crownstone.rocks)
4 * Date: Mar 10, 2020
5 * License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
6 */
7
8#pragma once
9
10#include <common/cs_Types.h>
11#include <mesh/cs_MeshDefines.h>
13
17namespace MeshUtil {
18
22struct __attribute__((__packed__)) cs_mesh_queue_item_meta_data_t {
24 uint16_t id = 0;
25
28
34
36 bool priority : 1;
37
39 bool doNotRelay : 1;
40
41 cs_mesh_queue_item_meta_data_t() : transmissionsOrTimeout(0), priority(false), doNotRelay(false) {}
42};
43
51
53 bool acked = false;
54
56 bool broadcast = true;
57
59 bool doNotRelay = false;
60
67
69 uint8_t numStoneIds = 0;
70
73
76};
77
78#define printMeshQueueItem(modelName, meshQueueItemMetaData) \
79 LOGMeshModelDebug( \
80 modelName " id=%u type=%u priority=%u transmissionsOrTimeout=%u", \
81 meshQueueItemMetaData.id, \
82 meshQueueItemMetaData.type, \
83 meshQueueItemMetaData.priority, \
84 meshQueueItemMetaData.transmissionsOrTimeout);
85
86} // namespace MeshUtil
@ CTRL_CMD_UNKNOWN
Definition: cs_CommandTypes.h:88
@ CS_MESH_MODEL_TYPE_UNKNOWN
Definition: cs_MeshModelPackets.h:96
uint16_t cs_control_cmd_t
Definition: cs_Typedefs.h:22
uint8_t stone_id_t
Definition: cs_Typedefs.h:23
Mesh utils without dependencies on mesh SDK.
Definition: cs_MeshCommon.h:17
Data needed in each model queue.
Definition: cs_MeshCommon.h:22
bool priority
Whether this item has priority.
Definition: cs_MeshCommon.h:36
uint8_t transmissionsOrTimeout
Timeout in seconds when reliable, else number of transmissions.
Definition: cs_MeshCommon.h:33
bool doNotRelay
Whether this message should be sent to direct neighbours only.
Definition: cs_MeshCommon.h:39
cs_mesh_queue_item_meta_data_t()
Definition: cs_MeshCommon.h:41
Struct to queue an item.
Definition: cs_MeshCommon.h:48
bool doNotRelay
Whether this message should be sent to direct neighbours only.
Definition: cs_MeshCommon.h:59
stone_id_t * stoneIdsPtr
Pointer to the list of target stone IDs.
Definition: cs_MeshCommon.h:72
cs_data_t msgPayload
The message payload.
Definition: cs_MeshCommon.h:75
cs_control_cmd_t controlCommand
If this mesh message is sent because of a Mesh command, then set this field to the control command pa...
Definition: cs_MeshCommon.h:66
bool acked
Whether the message should be acked.
Definition: cs_MeshCommon.h:53
bool broadcast
Whether the message should be broadcasted.
Definition: cs_MeshCommon.h:56
uint8_t numStoneIds
Number of target stone IDs.
Definition: cs_MeshCommon.h:69
cs_mesh_queue_item_meta_data_t metaData
Metadata.
Definition: cs_MeshCommon.h:50
Packets (structs) that are used internally in the firmware, and can be changed freely.
Definition: cs_PacketsInternal.h:27