BeaconScanner

Scans for nearby beacons. BeaconScanner uses data stored in the 'Beacons' feature layer to perform a scan and report information related to iBeacon devices. Some of the data produced by BeaconScanner is not a part of the official iBeacon standard.

Since

200.6.0

Constructors

Link copied to clipboard
constructor(definition: IndoorPositioningDefinition)

Creates a new BeaconScanner object using the information contained in the provided IndoorPositioningDefinition. BeaconScanner uses the 'Beacons' feature layer from the ArcGIS Indoors Information Model, which is stored in IndoorPositioningDefinition, to perform scans for a list of beacons. For a map to be IPS-aware, one of the following must be true:

Properties

Link copied to clipboard

Returns a list of all beacons discovered in the last scanning session. A scanning session starts when you call BeaconScanner.start and ends by calling BeaconScanner.stop. This property resets when user starts a new scanning session (by calling BeaconScanner.start). A BeaconInfo.lastRssi value of 127 means the iBeacon device was detected, but no iBeacon data was received. While BeaconScanner is running, some entries can have a BeaconInfo.lastRssi of 127 even if this iBeacon device transmits iBeacon data due to how iBeacon devices transmit multiple packets with different information. If a packet not related to iBeacon is received first, then BeaconScanner may consider this device as a beacon that does not transmit iBeacon data until the first iBeacon data arrives. To avoid that scenario, check for a BeaconInfo.lastRssi value of 127 after stopping a scan session.

Link copied to clipboard

Returns a list of iBeacons discovered in the last second. This event is triggered every second to provide all iBeacons visible in the last second. A visible iBeacon is a beacon that transmits iBeacon data in the advertisement data. If an iBeacon device does not produce an iBeacon advertisement packet, it will not be included in the list of visible beacons.

Link copied to clipboard
val status: StateFlow<BeaconScannerStatus>

The current status of the BeaconScanner. The status indicates if the BeaconScanner is starting, started, stopping, stopped, or has failed to start.

Functions

Link copied to clipboard
suspend fun start(): Result<Unit>

Starts the BeaconScanner. If IndoorPositioningDefinition is not loaded when BeaconScanner starts, IndoorPositioningDefinition performs loading during the starting phase, which can lead to a significant delay before BeaconScanner is started. To prevent such a delay, manually load IndoorPositioningDefinition before starting BeaconScanner.

Link copied to clipboard
suspend fun stop(): Result<Unit>

Stops the BeaconScanner.