AndroidEnvironment

A mock environment that can be used to test the behavior of the Central Manager.

Types

Link copied to clipboard
object Permission

Android permissions.

Link copied to clipboard
object SdkVersion

Android SDK versions.

Properties

Link copied to clipboard
abstract val androidSdkVersion: Int

The Android SDK version.

Link copied to clipboard
abstract val bluetoothState: StateFlow<Manager.State>

A flow emitting the current Bluetooth state.

Link copied to clipboard
abstract val deviceName: String
Link copied to clipboard

The local Bluetooth adapter name, or null if the required permission is not granted.

Link copied to clipboard

Whether the BLUETOOTH_ADVERTISE permission is granted.

Link copied to clipboard

Whether the BLUETOOTH_CONNECT permission is granted.

Link copied to clipboard
open override val isBluetoothEnabled: Boolean
Link copied to clipboard

Whether the BLUETOOTH_SCAN permission is granted.

Link copied to clipboard
Link copied to clipboard

Whether LE 2M PHY is supported on the device.

Link copied to clipboard

Whether LE Coded PHY is supported on the device.

Link copied to clipboard

Whether LE Extended Advertising feature is supported.

Link copied to clipboard

Whether LE Periodic Advertising feature is supported.

Link copied to clipboard

Whether location service is enabled on the device.

Link copied to clipboard

Whether the ACCESS_FINE_LOCATION permission is granted.

Link copied to clipboard

Whether location is required to scan for Bluetooth LE devices.

Link copied to clipboard

Whether multi advertisement is supported by the chipset.

Link copied to clipboard
abstract val leMaximumAdvertisingDataLength: @Range(from = 31, to = 1650) Int

The maximum LE advertising data length in bytes, if LE Extended Advertising feature is supported.

Link copied to clipboard
abstract val locationState: StateFlow<Boolean>

A flow emitting the state of the location service, true when enabled, false otherwise. Location service is required to scan for Bluetooth LE beacons when isLocationRequiredForScanning is true.

Link copied to clipboard

Whether the device requires runtime permissions to use Bluetooth.

Link copied to clipboard

Whether the device supports runtime permissions.

Functions

Link copied to clipboard
abstract fun close()

Unregisters the broadcast receiver that listens for Bluetooth state changes.

Link copied to clipboard
abstract fun enableBluetooth()

Sends an intent to enable Bluetooth adapter on the device.