Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_MeshModelPacketHelper.h
Go to the documentation of this file.
1
8#pragma once
9
14
15namespace MeshUtil {
16
18bool isValidMeshMessage(uint8_t* meshMsg, size16_t msgSize);
19bool isValidMeshPayload(cs_mesh_model_msg_type_t type, uint8_t* payload, size16_t payloadSize);
21bool ackIsValid(const uint8_t* packet, size16_t size);
23bool noopIsValid(const uint8_t* packet, size16_t size);
24bool multiSwitchIsValid(const uint8_t* packet, size16_t size);
29
30cs_mesh_model_msg_type_t getType(const uint8_t* meshMsg);
31
41void getPayload(uint8_t* meshMsg, size16_t meshMsgSize, uint8_t*& payload, size16_t& payloadSize);
42
50cs_data_t getPayload(uint8_t* meshMsg, size16_t meshMsgSize);
51
53
68 const uint8_t* payload,
69 size16_t payloadSize,
70 uint8_t* meshMsg,
71 size16_t meshMsgSize);
72
84bool setMeshPayload(uint8_t* meshMsg, size16_t meshMsgSize, const uint8_t* payload, size16_t payloadSize);
85
86bool canShortenStateType(uint16_t type);
87bool canShortenStateId(uint16_t id);
92
95
98
101
102} // namespace MeshUtil
cs_mesh_model_msg_type_t
Definition: cs_MeshModelPackets.h:61
EncryptionAccessLevel
Packets (structs) that are used over the air, over uart, or stored in flash.
Definition: cs_Packets.h:36
uint16_t size16_t
Definition: cs_Typedefs.h:25
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
Mesh utils without dependencies on mesh SDK.
Definition: cs_MeshCommon.h:17
bool state0IsValid(const cs_mesh_model_msg_state_0_t *packet, size16_t size)
uint8_t getShortenedAccessLevel(EncryptionAccessLevel accessLevel)
uint8_t getShortenedSource(const cmd_source_with_counter_t &source)
cmd_source_with_counter_t getInflatedSource(uint8_t sourceId)
bool multiSwitchIsValid(const uint8_t *packet, size16_t size)
cs_mesh_model_msg_type_t getType(const uint8_t *meshMsg)
bool setMeshPayload(uint8_t *meshMsg, size16_t meshMsgSize, const uint8_t *payload, size16_t payloadSize)
Set payload of a mesh message.
bool state1IsValid(const cs_mesh_model_msg_state_1_t *packet, size16_t size)
bool isValidMeshPayload(cs_mesh_model_msg_type_t type, uint8_t *payload, size16_t payloadSize)
bool canShortenSource(const cmd_source_with_counter_t &source)
bool isValidMeshMessage(cs_mesh_msg_t *meshMsg)
bool canShortenPersistenceMode(uint8_t id)
uint8_t getShortenedRetCode(cs_ret_code_t retCode)
bool setBehaviourSettingsIsValid(const behaviour_settings_t *packet, size16_t size)
bool testIsValid(const cs_mesh_model_msg_test_t *packet, size16_t size)
bool profileLocationIsValid(const cs_mesh_model_msg_profile_location_t *packet, size16_t size)
void getPayload(uint8_t *meshMsg, size16_t meshMsgSize, uint8_t *&payload, size16_t &payloadSize)
Get payload of a mesh message.
bool ackIsValid(const uint8_t *packet, size16_t size)
bool setMeshMessage(cs_mesh_model_msg_type_t type, const uint8_t *payload, size16_t payloadSize, uint8_t *meshMsg, size16_t meshMsgSize)
Create a mesh message.
bool canShortenStateId(uint16_t id)
bool canShortenStateType(uint16_t type)
bool timeIsValid(const cs_mesh_model_msg_time_t *packet, size16_t size)
bool canShortenAccessLevel(EncryptionAccessLevel accessLevel)
EncryptionAccessLevel getInflatedAccessLevel(uint8_t accessLevel)
size16_t getMeshMessageSize(size16_t payloadSize)
bool noopIsValid(const uint8_t *packet, size16_t size)
cs_ret_code_t getInflatedRetCode(uint8_t retCode)
bool canShortenRetCode(cs_ret_code_t retCode)
Struct that tells where a command originated from.
Definition: cs_CmdSource.h:54
Packets (structs) that are used internally in the firmware, and can be changed freely.
Definition: cs_PacketsInternal.h:27
Definition: cs_MeshModelPackets.h:114
Definition: cs_MeshModelPackets.h:119
Definition: cs_MeshModelPackets.h:127
Definition: cs_MeshModelPackets.h:99
Definition: cs_MeshModelPackets.h:110
Struct to communicate a mesh message.
Definition: cs_PacketsInternal.h:194
Behaviour settings.
Definition: cs_Packets.h:207