Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_MeshMsgSender.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>
14
20public:
21 // /** Callback function definition. */
22 // typedef function<void(const MeshUtil::cs_mesh_queue_item_t& item)> callback_add_t;
23 //
24 // /** Callback function definition. */
25 // typedef function<void(const MeshUtil::cs_mesh_queue_item_meta_data_t& item)> callback_rem_t;
26 //
27 // void registerAddCallback(const callback_add_t& closure);
28 // void registerRemCallback(const callback_rem_t& closure);
29 void init(MeshModelSelector* selector);
30
33 cs_ret_code_t sendNoop(uint8_t transmissions = 0);
36 const cmd_source_with_counter_t& source,
37 uint8_t transmissions = 0);
38 cs_ret_code_t sendSetTime(const cs_mesh_model_msg_time_t* item, uint8_t transmissions = 0);
39 cs_ret_code_t sendBehaviourSettings(const behaviour_settings_t* item, uint8_t transmissions = 0);
44 const cs_mesh_model_msg_device_heartbeat_t* item, uint8_t transmissions = 0);
46 const cs_mesh_model_msg_device_list_size_t* item, uint8_t transmissions = 0);
47
49 void handleEvent(event_t& event);
50
51private:
52 // callback_add_t _addCallback;
53 // callback_rem_t _remCallback;
55
56#if MESH_MODEL_TEST_MSG != 0
57 uint32_t _nextSendCounter = 1;
58#endif
59
62
65};
Event listener.
Definition: cs_EventListener.h:17
Class that selects which model to use to send a message.
Definition: cs_MeshModelSelector.h:20
Class that:
Definition: cs_MeshMsgSender.h:19
void handleEvent(event_t &event)
Internal usage.
MeshModelSelector * _selector
Definition: cs_MeshMsgSender.h:54
cs_ret_code_t sendTrackedDeviceRegister(const cs_mesh_model_msg_device_register_t *item, uint8_t transmissions=0)
cs_ret_code_t sendBehaviourSettings(const behaviour_settings_t *item, uint8_t transmissions=0)
cs_ret_code_t sendMultiSwitchItem(const internal_multi_switch_item_t *item, const cmd_source_with_counter_t &source, uint8_t transmissions=0)
cs_ret_code_t sendTrackedDeviceHeartbeat(const cs_mesh_model_msg_device_heartbeat_t *item, uint8_t transmissions=0)
cs_ret_code_t addToQueue(MeshUtil::cs_mesh_queue_item_t &item)
cs_ret_code_t sendMsg(cs_mesh_msg_t *meshMsg)
cs_ret_code_t sendProfileLocation(const cs_mesh_model_msg_profile_location_t *item, uint8_t transmissions=0)
cs_ret_code_t remFromQueue(MeshUtil::cs_mesh_queue_item_t &item)
cs_ret_code_t sendTestMsg()
cs_ret_code_t sendTrackedDeviceToken(const cs_mesh_model_msg_device_token_t *item, uint8_t transmissions=0)
cs_ret_code_t sendSetTime(const cs_mesh_model_msg_time_t *item, uint8_t transmissions=0)
cs_ret_code_t handleSendMeshCommand(mesh_control_command_packet_t *command, const cmd_source_with_counter_t &source)
void init(MeshModelSelector *selector)
cs_ret_code_t sendTrackedDeviceListSize(const cs_mesh_model_msg_device_list_size_t *item, uint8_t transmissions=0)
cs_ret_code_t sendNoop(uint8_t transmissions=0)
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 9,...
Definition: cs_Event.h:26
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
Struct to queue an item.
Definition: cs_MeshCommon.h:48
Struct that tells where a command originated from.
Definition: cs_CmdSource.h:54
Definition: cs_MeshModelPackets.h:155
Definition: cs_MeshModelPackets.h:161
Definition: cs_MeshModelPackets.h:140
Definition: cs_MeshModelPackets.h:149
Definition: cs_MeshModelPackets.h:114
Definition: cs_MeshModelPackets.h:110
Struct to communicate a mesh message.
Definition: cs_PacketsInternal.h:194
A single multi switch packet, with target id.
Definition: cs_PacketsInternal.h:131
Mesh control command packet.
Definition: cs_PacketsInternal.h:151
Behaviour settings.
Definition: cs_Packets.h:207