Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Mesh.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <cfg/cs_Boards.h>
11#include <common/cs_Types.h>
14#include <mesh/cs_MeshCore.h>
22#include <mesh/cs_MeshScanner.h>
23
36class Mesh : public EventListener {
37public:
41 static Mesh& getInstance();
42
50
60
66 void start();
67
77
82
87
92
96 void startSync();
97
99 void handleEvent(event_t& event);
100
101private:
104
106 Mesh(Mesh const&) = delete;
107
109 Mesh& operator=(Mesh const&) = delete;
110
121
123
124 // Sync request
125 bool _synced = false;
126 uint32_t _syncCountdown = -1;
128
143 bool requestSync(bool propagateSyncMessageOverMesh = true);
144
146
147 void configureModels(dsm_handle_t appkeyHandle);
148
149 void onTick(uint32_t tickCount);
150};
Event listener.
Definition: cs_EventListener.h:17
Definition: cs_MeshAdvertiser.h:26
Class that:
Definition: cs_MeshCore.h:28
Class that:
Definition: cs_MeshModelMulticastAcked.h:24
Class that:
Definition: cs_MeshModelMulticastNeighbours.h:23
Class that:
Definition: cs_MeshModelMulticast.h:23
Class that selects which model to use to send a message.
Definition: cs_MeshModelSelector.h:20
Class that:
Definition: cs_MeshModelUnicast.h:26
Class that:
Definition: cs_MeshMsgHandler.h:17
Class that:
Definition: cs_MeshMsgSender.h:19
Class that handles scans from the mesh.
Definition: cs_MeshScanner.h:19
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 12 Apr....
Definition: cs_Mesh.h:36
MeshMsgHandler _msgHandler
Definition: cs_Mesh.h:117
void onTick(uint32_t tickCount)
cs_ret_code_t stop()
Stop the mesh.
static Mesh & getInstance()
Get a reference to the Mesh object.
Mesh()
Constructor, singleton, thus made private.
void stopAdvertising()
Stop advertising.
void start()
Start the mesh.
MeshModelUnicast _modelUnicast
Definition: cs_Mesh.h:115
void configureModels(dsm_handle_t appkeyHandle)
Mesh(Mesh const &)=delete
Copy constructor, singleton, thus made private.
void initModels()
MeshMsgSender _msgSender
Definition: cs_Mesh.h:118
void handleEvent(event_t &event)
Internal usage.
MeshScanner _scanner
Definition: cs_Mesh.h:120
bool requestSync(bool propagateSyncMessageOverMesh=true)
Dispatches an internal event to request what data this crownstone needs to receive from the mesh.
cs_ret_code_t init(const boards_config_t &board)
Init the mesh.
bool _synced
Definition: cs_Mesh.h:125
bool checkFlashValid()
Checks if flash pages have valid data.
void advertiseIbeacon()
Start advertising as iBeacon.
uint32_t _syncCountdown
Definition: cs_Mesh.h:126
MeshModelMulticastNeighbours _modelMulticastNeighbours
Definition: cs_Mesh.h:113
uint32_t _syncFailedCountdown
Definition: cs_Mesh.h:127
Mesh & operator=(Mesh const &)=delete
Assignment operator, singleton, thus made private.
MeshModelMulticast _modelMulticast
Definition: cs_Mesh.h:112
void startSync()
Start synchronization of data with other nodes in mesh.
BOOL _enabled
Definition: cs_Mesh.h:122
MeshCore * _core
Definition: cs_Mesh.h:111
MeshModelSelector _modelSelector
Definition: cs_Mesh.h:116
MeshModelMulticastAcked _modelMulticastAcked
Definition: cs_Mesh.h:114
MeshAdvertiser _advertiser
Definition: cs_Mesh.h:119
void initAdvertiser()
Init the advertiser.
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
uint8_t BOOL
Boolean with fixed size.
Definition: cs_Typedefs.h:27
Board configuration.
Definition: cs_Boards.h:169