Definition: cs_AssetStore.h:15
Helper class to manage decoupling of components.
Definition: cs_Component.h:35
Event listener.
Definition: cs_EventListener.h:17
This class implements the in-mesh computation of which crownstone is nearest to a 'trackable' device.
Definition: cs_NearestCrownstoneTracker.h:32
static constexpr uint8_t LAST_RECEIVED_TIMEOUT_THRESHOLD
Definition: cs_NearestCrownstoneTracker.h:33
void saveWinningReport(asset_record_t &rec, rssi_and_channel_t winningRssi, stone_id_t winningId)
saves the report in the _winning list.
void broadcastPersonalReport(asset_record_t &record)
makes a report from the records personalRssi field and broadcast it over the mesh.
static constexpr auto FILTER_STRATEGY
Definition: cs_NearestCrownstoneTracker.h:41
bool onReceiveAssetAdvertisement(cs_mesh_model_msg_asset_report_id_t &trackedEvent)
Heart of the algorithm.
void broadcastReport(cs_mesh_model_msg_asset_report_id_t &report)
Sends a mesh broadcast for the given report.
stone_id_t _myStoneId
Definition: cs_NearestCrownstoneTracker.h:58
static constexpr uint16_t MIN_THROTTLED_ADVERTISEMENT_PERIOD_MS
Definition: cs_NearestCrownstoneTracker.h:34
static constexpr int8_t RSSI_CUT_OFF_THRESHOLD
Definition: cs_NearestCrownstoneTracker.h:37
AssetStore * _assetStore
Definition: cs_NearestCrownstoneTracker.h:59
void handleMeshMsgEvent(event_t &evt)
Called on EVT_RECV_MESH_MSG events.
asset_record_t * getRecordFiltered(const asset_id_t &assetId)
getRecord for assetId from assetStore and return it.
void onWinnerChanged(bool winnerIsThisCrownstone)
(Only logs a message)
void handleEvent(event_t &evt)
Handlers for: EVT_ASSET_ACCEPTED EVT_FILTERS_UPDATED.
static constexpr uint8_t RSSI_FALL_OFF_RATE_DB_PER_S
Definition: cs_NearestCrownstoneTracker.h:36
FilterStrategy
Definition: cs_NearestCrownstoneTracker.h:39
bool handleAcceptedAsset(const scanned_device_t &asset, const asset_id_t &id, uint8_t filterBitmask)
Returns true if it is desired to send a message to inform other devices in the mesh of relevant chang...
void onReceiveAssetReport(cs_mesh_model_msg_asset_report_id_t &report, stone_id_t reporter)
Heart of the algorithm.
void handleAssetAcceptedEvent(event_t &evt)
Called on EVT_ASSET_ACCEPTED events.
void sendUartUpdate(asset_record_t &record)
Sends a message over UART containing the winner, its rssi and the asset id.
cs_ret_code_t init() override
Caches CONFIG_CROWNSTONE_ID and AssetStore.
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
uint16_t cs_ret_code_t
Definition: cs_Typedefs.h:21
Definition: cs_AssetFilterPackets.h:93
Definition: cs_AssetRecord.h:12
Definition: cs_MeshModelPackets.h:236
Definition: cs_RssiAndChannel.h:63
Scanned device.
Definition: cs_PacketsInternal.h:107