99 .burst_period_ms = 500,
100 .accumulation_period_ms = 2 * 60 * 1000,
101 .boot_sequence_period_ms = 1 * 60 * 1000
103 .min_samples_to_trigger_burst = 20,
104 .burst_period_ms = 5,
105 .accumulation_period_ms = 30 * 60 * 1000,
106 .boot_sequence_period_ms = 1 * 60 * 1000,
A coroutine essentially is a throttling mechanism: it takes in a tick-event or tick count and execute...
Definition: cs_Coroutine.h:40
Event listener.
Definition: cs_EventListener.h:17
Definition: cs_MeshMsgEvent.h:71
This class/component keeps track of the rssi distance of a crownstone to its neighbors (i....
Definition: cs_MeshTopologyResearch.h:28
static constexpr uint8_t CHANNEL_COUNT
Definition: cs_MeshTopologyResearch.h:55
void recordRssiValue(stone_id_t sender_id, int8_t rssi, uint8_t channel)
Saves rssi value to last received map and variance recorder map.
uint8_t getMeanRssiRepresentation(float mean)
Returns the 7 bit representation of the given mean as defined in cs_PacketsInternal....
stone_id_t my_id
Definition: cs_MeshTopologyResearch.h:52
void init()
Obtains the stone_id_t of this crownstone to use for forwarded ping messages.
void handleEvent(event_t &evt)
Handles the following events: CS_TICK: Coroutine for rssi data updates.
uint8_t getCountRepresentation(uint32_t count)
Returns the 6 bit representation of the given count as defined in cs_PacketsInternal....
bool boot_sequence_finished
Definition: cs_MeshTopologyResearch.h:62
Coroutine flushRoutine
Definition: cs_MeshTopologyResearch.h:69
void sendRssiDataOverMesh(rssi_data_message_t *rssi_data_message)
Dispatches an event of type CMD_SEND_MESH_MSG in order to send a CS_MESH_MODEL_TYPE_RSSI_DATA.
uint8_t getVarianceRepresentation(float standard_deviation)
Returns the 3 bit descriptor of the given variance as defined in cs_PacketsInternal....
void receiveRssiDataMessage(MeshMsgEvent &mesh_msg_evt)
Any received rssi_data_message_t will be sendRssiDataOverUart.
void sendPingRequestOverMesh()
Dispatches an event of type CMD_SEND_MESH_MSG in order to send a CS_MESH_MODEL_TYPE_RSSI_PING.
void receiveMeshMsgEvent(MeshMsgEvent &mesh_msg_evt)
If the event was no-hop:
std::map< stone_id_t, VarianceAggregator > variance_map[CHANNEL_COUNT]
Definition: cs_MeshTopologyResearch.h:59
static constexpr uint8_t CHANNEL_START
Definition: cs_MeshTopologyResearch.h:56
void sendPingResponseOverMesh()
Dispatches an event of type CMD_SEND_MESH_MSG in order to send a CMD_SEND_MESH_MSG_NOOP.
void sendRssiDataOverUart(rssi_data_message_t *rssi_data_message)
Writes a message of type UART_OPCODE_TX_RSSI_DATA_MESSAGE with the given parameter as data.
stone_id_t last_stone_id_broadcasted_in_burst
Definition: cs_MeshTopologyResearch.h:65
static constexpr TimingSettings Settings
Definition: cs_MeshTopologyResearch.h:96
uint32_t flushAggregatedRssiData()
Coroutine method: To prevent the mesh from flooding, flushing is throttled.
void receivePingMessage(MeshMsgEvent &mesh_msg_evt)
If the ping message is a request that has not hopped,.
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 9,...
Definition: cs_Event.h:26
uint8_t stone_id_t
Definition: cs_Typedefs.h:23
Definition: cs_MeshTopologyResearch.h:71
uint32_t boot_sequence_period_ms
When boot sequence period expires, a flush (burst) of the rssi data will be triggered.
Definition: cs_MeshTopologyResearch.h:93
uint32_t accumulation_period_ms
This value determines the period between end and start of bursts.
Definition: cs_MeshTopologyResearch.h:87
uint32_t burst_period_ms
Period between sending data in 'burst mode'.
Definition: cs_MeshTopologyResearch.h:82
uint8_t min_samples_to_trigger_burst
When flushAggregatedRssiData is in the flushing phase, only variance_map entries that have accumulate...
Definition: cs_MeshTopologyResearch.h:77