ADevicePlugin

abstract class ADevicePlugin<D : ADevice> : APlugin

Implementation common to Processor and Explorer plugins, mainly related to device management.

Parameters

D

The model for the kind of device to manage.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
protected fun addDevice(device: D)

Adds a device to the managed collection.

Link copied to clipboard
protected abstract fun addFilterCriteria(sfb: ScanFilter.Builder)

Called by the engine during the build of a fr.maxcom.beacon.configuration.ScanContext to give the plugin the opportunity to set its filter criteria, typically based on the Service Data or the Manufacturer Specific Data.

Link copied to clipboard
open fun clear()

Clears any cache or persisted data from a previous run.

Link copied to clipboard
protected fun lookupDevice(btDevice: BluetoothDevice): D?

Lookups for a device in the managed collection.

Link copied to clipboard
protected fun mismatch(data: ByteArray?, minLength: Int, prefix: ByteArray): Boolean

Performs an evaluation for non validity about a frame pattern recognition.

Link copied to clipboard
protected open fun onLost(device: D)

A hook called when a device is deemed lost. This default implementation does nothing.

Link copied to clipboard
protected fun refreshDevice(device: D, rssi: Int)

Refreshes the knowledge of a device already in the managed collection.

Link copied to clipboard
protected fun removeLostDevices(shiftedTimeMillis: Long)

Removes lost devices from the managed collection.

Link copied to clipboard
open fun setDeviceFilters(filters: List<DeviceFilter>)

Sets filters.