BluetoothProbe class
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
-
- Object
- AbstractExecutor<
Measure> - Probe
- StreamProbe
- PeriodicStreamProbe
- BufferingPeriodicStreamProbe
- BluetoothProbe
Constructors
Properties
- bufferingStream → Stream
-
The stream of events to buffer. Implemented by subclasses.
no setteroverride
- configuration → Measure?
-
The configuration of this executor as set in initialize.
no setterinherited
- deployment → SmartphoneDeployment?
-
The deployment that this executor is part of executing.
no setterinherited
-
deviceManager
↔ DeviceManager<
DeviceConfiguration< DeviceRegistration> , DeviceRegistration> -
The device manager of the device this probe collects data from.
getter/setter pairinherited
- enabled ↔ bool
-
Whether this probe is enabled.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- measure → Measure?
-
The
Measurethat configures this probe.no setterinherited -
measurements
→ Stream<
Measurement> -
The stream of
Measurementcollected by this executor.no setterinherited -
permissions
→ List<
Permission> -
The permissions this probe needs. Empty if none.
no setterinherited
-
remoteIds
→ List<
String> -
The remote device ids to filter the scan on. Empty if no
BluetoothScanPeriodicSamplingConfiguration is used.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplingConfiguration → PeriodicSamplingConfiguration?
-
The sampling configuration for this probe.
no setterinherited
- samplingState → SamplingState
-
The runtime sampling state of this executor.
no setterinherited
-
services
→ List<
Guid> -
The service UUIDs to filter the scan on. Empty if no
BluetoothScanPeriodicSamplingConfiguration is used.
no setter
- state → ExecutorState
-
The runtime state of this executor.
no setterinherited
-
stateEvents
→ Stream<
ExecutorState> -
The runtime state changes of this executor.
no setterinherited
-
stream
→ Stream<
Measurement> -
The stream of
Measurements to forward. Implemented by subclasses.no setterinherited - type → String?
-
The data type this probe collects, e.g.
dk.cachet.carp.steps.no setterinherited
Methods
-
addError(
Object error, [StackTrace? stacktrace]) → void -
Logs
erroras a warning and adds it to themeasurementsstream.inherited -
addMeasurement(
Measurement measurement) → void -
Adds
measurementtomeasurements.inherited -
arePermissionsGranted(
) → Future< bool> -
Whether all
permissionsare granted. Returns false if checking fails.inherited -
dispose(
) → void -
Disposes this executor.
inherited
-
error(
) → void -
Moves this executor to
ExecutorState.Undefined.inherited -
getMeasurement(
) → Future< Measurement?> -
Returns the
Measurementfor the last sampling window.override -
hasRequiredPermissions(
) → Future< bool> -
Whether this probe is allowed to run.
inherited
-
initialize(
Measure configuration, [SmartphoneDeployment? deployment]) → void -
Configures and initializes the executor. Call before resume.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
) → Future< void> -
Callback when this executor is disposed.
inherited
-
onInitialize(
) → bool -
Called by initialize. Returns true if successfully initialized.
inherited
-
onPause(
) → Future< bool> -
Called by pause. Returns true if successfully paused.
inherited
-
onResume(
) → Future< bool> -
Called by resume. Returns true if successfully resumed.
inherited
-
onSamplingData(
dynamic event) → void -
Called for each event on bufferingStream; buffers it.
override
-
onSamplingEnd(
) → void -
Called when a sampling window ends, before getMeasurement.
override
-
onSamplingStart(
) → void -
Called when a sampling window starts, before listening.
override
-
pause(
) → void -
Pauses the executor until resume is called.
inherited
-
pauseButShouldBeResumed(
) → void -
Pauses the executor and marks it to be resumed later.
inherited
-
requestPermissions(
) → Future< bool> -
Asks the user for any
permissionsnot yet granted.inherited -
resume(
) → void -
Starts or resumes the executor.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- DEFAULT_TIMEOUT → const int
- Default scan timeout in milliseconds (4 seconds), used if no duration is configured.