Skip to content

BeaconProbe

Monitors iBeacon regions and collects a BeaconData measurement listing each nearby BeaconDevice while the phone is inside a region.

Used for the ConnectivitySamplingPackage.BEACON measure. Uses a BeaconRangingPeriodicSamplingConfiguration for the beaconRegions to monitor and the beaconDistance. Only beacons closer than beaconDistance are included. Does not start if no regions are configured.

Inheritance

Constructors

BeaconProbe

BeaconProbe()

Properties

beaconDistance

int get beaconDistance

The maximum beacon distance in meters. Default is 2.

beaconRegions

List<Region> get beaconRegions

The configured regions, converted to the beacon plugin's Region type.

samplingConfiguration

BeaconRangingPeriodicSamplingConfiguration? get samplingConfiguration
override

The sampling configuration for this probe.

Configuration is obtained in the following order:

Returns null in case no configuration is found.

See also the section on Sampling schemes and configurations in the CARP Core Framework. In addition to CARP Core, CARP Mobile Sensing also supports sampling schemes in the sampling packages, which are used as the 4th possible configuration in the list above.

stream

Stream<Measurement> get stream
override

The stream of Measurement objects for this StreamProbe. Must be implemented by sub-classes.

Methods

onInitialize

bool onInitialize()
override

Callback when this executor is initialized. Returns true if successfully initialized, false otherwise.

Note that this is a non-async method and should hence be 'light-weight' and not block execution for a long duration.