#include <cs_AssetStore.h>
◆ AssetStore()
◆ addThrottlingBump()
void AssetStore::addThrottlingBump |
( |
asset_record_t & |
record, |
|
|
uint16_t |
timeToNextThrottleOpenMs |
|
) |
| |
Adds a value to the records' throttlingCountdownTicks.
This will ensure that the record.isThrottled() will be true for (at least) timeToNextThrottleOpenMs.
◆ decrementThrottlingCounters()
void AssetStore::decrementThrottlingCounters |
( |
| ) |
|
|
private |
Decrements throttlingCountdownTicks by 1of all valid records, until zero is reached.
◆ getOrCreateRecord()
returns a pointer of record if found, else tries to create a new blank record and return a pointer to that, else returns nullptr.
◆ getRecord()
returns a pointer of record if found, else returns nullptr.
◆ handleAcceptedAsset()
Get or create a record for the given assetId.
Then update rssi values according to the incoming scan and revert the lastReceivedCounter to 0.
Returns the adjusted record if found, else returns nullptr
◆ handleEvent()
void AssetStore::handleEvent |
( |
event_t & |
event | ) |
|
|
overridevirtual |
◆ incrementLastReceivedCounters()
void AssetStore::incrementLastReceivedCounters |
( |
| ) |
|
|
private |
Adds 1 to the update/sent counters of all valid records, until 0xff is reached.
◆ init()
Components can implement this if they need to get references to sibling or if they need to do specific initialization.
- Components are responsible for calling init() on their children.
- init is allowed to assume all siblings are constructed.
E.g.
class componentX : public Component { public: cs_ret_code_t init() { // construct childA ... // construct childZ
return initChildren(); } };
Reimplemented from Component.
◆ throttlingBumpMsToTicks()
uint16_t AssetStore::throttlingBumpMsToTicks |
( |
uint16_t |
timeToNextThrottleOpenMs | ) |
|
Convert ms to ticks, rounding fractional parts upwards.
◆ _store
◆ LAST_RECEIVED_COUNTER_PERIOD_MS
constexpr auto AssetStore::LAST_RECEIVED_COUNTER_PERIOD_MS = 1000 |
|
staticconstexpr |
Interval at which the timeout counter is increased, should be 1 second.
◆ LAST_RECEIVED_TIMEOUT_THRESHOLD_S
constexpr uint8_t AssetStore::LAST_RECEIVED_TIMEOUT_THRESHOLD_S = 250 |
|
staticconstexpr |
Time in seconds after which a record is timed out.
Must be smaller than 0xFF.
◆ MAX_RECORDS
constexpr auto AssetStore::MAX_RECORDS = 50u |
|
staticconstexprprivate |
◆ THROTTLE_COUNTER_PERIOD_MS
constexpr auto AssetStore::THROTTLE_COUNTER_PERIOD_MS = 100 |
|
staticconstexpr |
Interval at which the throttle countdown is decreased.
◆ updateLastReceivedCounterRoutine
Coroutine AssetStore::updateLastReceivedCounterRoutine |
|
private |
◆ updateLastSentCounterRoutine
Coroutine AssetStore::updateLastSentCounterRoutine |
|
private |
The documentation for this class was generated from the following file: