Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 12 Apr., 2019 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
More...
#include <cs_Mesh.h>
|
| Mesh () |
| Constructor, singleton, thus made private. More...
|
|
| Mesh (Mesh const &)=delete |
| Copy constructor, singleton, thus made private. More...
|
|
Mesh & | operator= (Mesh const &)=delete |
| Assignment operator, singleton, thus made private. More...
|
|
bool | requestSync (bool propagateSyncMessageOverMesh=true) |
| Dispatches an internal event to request what data this crownstone needs to receive from the mesh. More...
|
|
void | initModels () |
|
void | configureModels (dsm_handle_t appkeyHandle) |
|
void | onTick (uint32_t tickCount) |
|
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 12 Apr., 2019 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
Class that manages all mesh classes:
- Core
- Models
- Message handler
- Message sender
- Scanner
- Advertiser Also:
- Starts and retries sync requests.
- Sends crownstone state at a regular interval.
◆ Mesh() [1/2]
Constructor, singleton, thus made private.
◆ Mesh() [2/2]
Copy constructor, singleton, thus made private.
◆ advertiseIbeacon()
void Mesh::advertiseIbeacon |
( |
| ) |
|
Start advertising as iBeacon.
◆ checkFlashValid()
bool Mesh::checkFlashValid |
( |
| ) |
|
Checks if flash pages have valid data.
If not, the pages will be erased, wait for event EVT_MESH_PAGES_ERASED. Has to be done before storage is initialized.
- Returns
- true when valid.
◆ configureModels()
void Mesh::configureModels |
( |
dsm_handle_t |
appkeyHandle | ) |
|
|
private |
◆ getInstance()
static Mesh & Mesh::getInstance |
( |
| ) |
|
|
static |
Get a reference to the Mesh object.
◆ handleEvent()
void Mesh::handleEvent |
( |
event_t & |
event | ) |
|
|
virtual |
◆ init()
Init the mesh.
- Returns
- ERR_SUCCESS Initialized successfully.
-
ERR_WRONG_STATE Flash pages should be erased.
◆ initAdvertiser()
void Mesh::initAdvertiser |
( |
| ) |
|
◆ initModels()
void Mesh::initModels |
( |
| ) |
|
|
private |
◆ onTick()
void Mesh::onTick |
( |
uint32_t |
tickCount | ) |
|
|
private |
◆ operator=()
Assignment operator, singleton, thus made private.
◆ requestSync()
bool Mesh::requestSync |
( |
bool |
propagateSyncMessageOverMesh = true | ) |
|
|
private |
Dispatches an internal event to request what data this crownstone needs to receive from the mesh.
Afterwards, broadcasts a BT message in order to obtain the desired information.
Assumes all event handlers that are interested in obtaining data are registered with the event dispatcher.
- Parameters
-
[propagateSyncMessageOverMesh] | if set to false no mesh messages will be sent. (Use this internally to check if device is synced.) |
- Returns
- true When request was necessary. If propagateSyncMessageOverMesh is true, a mesh message will be sent to resolve the sync.
-
false When nothing had to be requested, so everything is synced.
◆ start()
Start the mesh.
Start using the radio and handle incoming messages.
◆ startSync()
Start synchronization of data with other nodes in mesh.
◆ stop()
Stop the mesh.
Stops all radio usage.
- Returns
- ERR_SUCCESS When the mesh stopped.
-
ERR_WAIT_FOR_SUCCESS When the mesh will stop, wait for NRF_MESH_EVT_DISABLED.
◆ stopAdvertising()
void Mesh::stopAdvertising |
( |
| ) |
|
◆ _advertiser
◆ _core
◆ _enabled
BOOL Mesh::_enabled = true |
|
private |
◆ _modelMulticast
◆ _modelMulticastAcked
◆ _modelMulticastNeighbours
◆ _modelSelector
◆ _modelUnicast
◆ _msgHandler
◆ _msgSender
◆ _scanner
◆ _syncCountdown
uint32_t Mesh::_syncCountdown = -1 |
|
private |
◆ _synced
bool Mesh::_synced = false |
|
private |
◆ _syncFailedCountdown
uint32_t Mesh::_syncFailedCountdown = 0 |
|
private |
The documentation for this class was generated from the following file: