CappedAverageRssiCalculator

A RSSI calculator whose algorithm performs an average of latest values. The number of these values is capped to a custom maximum. The aim is to lessen the influence of erratic values, as the signal strength is unstable and so the measurement lacks precision.

Parameters

capacity

The depth of the queue. When reached, if a new value is submitted, the oldest value is discarded. A typical setting is 5, for a balance between reactivity and stability.

Constructors

Link copied to clipboard
constructor(capacity: Int)

Functions

Link copied to clipboard
open override fun calculateRssi(deviceIdentifier: Int, rssi: Int): Int

Ingests a new value to get a calculated substitute.

Link copied to clipboard
open override fun clear()

Removes all entries.

open override fun clear(deviceIdentifier: Int)

Removes an entry.