#include <cs_MeshTopology.h>
◆ add()
void MeshTopology::add |
( |
stone_id_t |
id, |
|
|
int8_t |
rssi, |
|
|
uint8_t |
channel |
|
) |
| |
|
private |
Add a neighbour to the list.
◆ find()
Find a neighbour in the list.
◆ getMacAddress()
Get the MAC address of a neighbouring crownstone.
- Parameters
-
[in] | stoneId | The stone ID of the crownstone. |
- Returns
- ERR_WAIT_FOR_SUCCESS When the MAC address is requested. Wait for EVT_MESH_TOPO_MAC_RESULT. However, there will be no event if it times out.
-
ERR_NOT_FOUND When the stone is not a known neighbour.
◆ getRssi()
Get the RSSI of given stone ID and put it in the result buffer.
◆ handleEvent()
void MeshTopology::handleEvent |
( |
event_t & |
evt | ) |
|
|
virtual |
◆ init()
Initializes the class:
- Reads State.
- Allocates buffer.
- Starts listening for events.
◆ onMeshMsg()
◆ onNeighbourRssi()
◆ onStoneMacMsg()
◆ onTickSecond()
void MeshTopology::onTickSecond |
( |
| ) |
|
|
private |
◆ print()
void MeshTopology::print |
( |
| ) |
|
|
private |
◆ reset()
void MeshTopology::reset |
( |
| ) |
|
|
private |
Resets the stored topology.
◆ sendNext()
void MeshTopology::sendNext |
( |
| ) |
|
|
private |
Sends the RSSI of 1 neighbour over the mesh and UART.
◆ sendNoop()
void MeshTopology::sendNoop |
( |
| ) |
|
|
private |
Send a no-hop noop mesh message.
◆ sendRssiToUart()
Sends the RSSI to a neighbour over UART.
◆ updateNeighbour()
Update the data of a node in the list.
◆ _fastIntervalCountdown
uint16_t MeshTopology::_fastIntervalCountdown |
|
private |
Countdown in seconds until sending at regular interval again.
◆ _msgCount
uint8_t MeshTopology::_msgCount = 0 |
|
private |
Overflowing message counter.
◆ _myId
Stone ID of this crownstone, read on init.
◆ _neighbourCount
uint8_t MeshTopology::_neighbourCount = 0 |
|
private |
Number of neighbours in the list.
◆ _neighbours
A list of all known neighbours, allocated on init.
◆ _nextSendIndex
uint8_t MeshTopology::_nextSendIndex = 0 |
|
private |
Next index of the neighbours list to send via the mesh.
◆ _sendCountdown
uint16_t MeshTopology::_sendCountdown |
|
private |
Countdown in seconds until sending the next mesh message.
◆ _sendNoopCountdown
uint16_t MeshTopology::_sendNoopCountdown |
|
private |
Countdown in seconds until sending the next no hop ping mesh message.
◆ FAST_INTERVAL_TIMEOUT_SECONDS
constexpr uint16_t MeshTopology::FAST_INTERVAL_TIMEOUT_SECONDS = 5 * 60 |
|
staticconstexpr |
After a reset, the FAST intervals will be used instead, for this amount of seconds.
◆ INDEX_NOT_FOUND
constexpr uint8_t MeshTopology::INDEX_NOT_FOUND = 0xFF |
|
staticconstexprprivate |
◆ MAX_NEIGHBOURS
constexpr uint8_t MeshTopology::MAX_NEIGHBOURS = 50 |
|
staticconstexpr |
Maximum number of neighbours in the list.
◆ RSSI_INIT
constexpr int8_t MeshTopology::RSSI_INIT = 0 |
|
staticconstexprprivate |
◆ SEND_INTERVAL_SECONDS_PER_NEIGHBOUR
constexpr uint16_t MeshTopology::SEND_INTERVAL_SECONDS_PER_NEIGHBOUR = 5 * 60 |
|
staticconstexpr |
Interval at which a mesh messages is sent for each neighbour.
◆ SEND_INTERVAL_SECONDS_PER_NEIGHBOUR_FAST
constexpr uint16_t MeshTopology::SEND_INTERVAL_SECONDS_PER_NEIGHBOUR_FAST = 10 |
|
staticconstexpr |
◆ SEND_NOOP_INTERVAL_SECONDS
constexpr uint16_t MeshTopology::SEND_NOOP_INTERVAL_SECONDS = 1 * 60 |
|
staticconstexpr |
Interval at which a no-hop noop message is sent.
Should be lower than TIMEOUT_SECONDS, so that a message is sent before timeout.
◆ SEND_NOOP_INTERVAL_SECONDS_FAST
constexpr uint16_t MeshTopology::SEND_NOOP_INTERVAL_SECONDS_FAST = 10 |
|
staticconstexpr |
◆ TIMEOUT_SECONDS
constexpr uint8_t MeshTopology::TIMEOUT_SECONDS = 3 * 60 |
|
staticconstexpr |
Time after last seen, before a neighbour is removed from the list.
The documentation for this class was generated from the following file: