BluetoothProbe
Scans for nearby, visible Bluetooth devices and collects a Bluetooth measurement that lists each device found during the scan.
Used for the ConnectivitySamplingPackage.BLUETOOTH measure. Uses a PeriodicSamplingConfiguration for the interval and duration of the scan. Use a BluetoothScanPeriodicSamplingConfiguration to filter by services and remoteIds. If the scan fails, the measurement holds an Error.
- Inheritance
Constructors
BluetoothProbe
Constants
DEFAULT_TIMEOUT
Default scan timeout in milliseconds (4 seconds), used if no duration is configured.
Properties
bufferingStream
The stream of events to be buffered. Must be specified by sub-classes.
remoteIds
The remote device ids to filter the scan on. Empty if no BluetoothScanPeriodicSamplingConfiguration is used.
services
The service UUIDs to filter the scan on. Empty if no BluetoothScanPeriodicSamplingConfiguration is used.
Methods
getMeasurement
Subclasses should implement / override this method to collect the Measurement. This method will be called every time data has been buffered for a duration and should return the final measurement for the buffered data.
Can return null if no data is available. Can return an Error if an error occurs.
onSamplingData
- dynamic event
Handler for handling onData events from the buffering stream.
onSamplingEnd
Handler called when sampling period ends.
onSamplingStart
Handler called when sampling period starts.