Api26

constructor(deviceName: String = DEFAULT_NAME, isBluetoothSupported: Boolean = true, isBluetoothEnabled: Boolean = true, isMultipleAdvertisementSupported: Boolean = true, isLeExtendedAdvertisingSupported: Boolean = true, leMaximumAdvertisingDataLength: @Range(from = 31, to = 1650) Int = if (isLeExtendedAdvertisingSupported) 1650 else 31, isLe2MPhySupported: Boolean = true, isLeCodedPhySupported: Boolean = true, isScanningOnLeCodedPhySupported: Boolean = isLeCodedPhySupported, isLocationPermissionGranted: Boolean = true, isLocationEnabled: Boolean = true, advertiser: MockAdvertiser = DEFAULT_MOCK_ADVERTISER, scanner: MockScanner = DEFAULT_MOCK_SCANNER)

Parameters

deviceName

The device name, by default set to "Mock".

isBluetoothSupported

Whether Bluetooth is supported on the device.

isBluetoothEnabled

Whether Bluetooth is enabled on the device.

isMultipleAdvertisementSupported

Whether multi advertisement is supported by the chipset.

isLeExtendedAdvertisingSupported

Whether LE Extended Advertising feature is supported.

leMaximumAdvertisingDataLength

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

isLe2MPhySupported

Whether LE 2M PHY is supported on the device.

isLeCodedPhySupported

Whether LE Coded PHY is supported on the device.

isScanningOnLeCodedPhySupported

Whether the device can scan for Bluetooth LE devices advertising on LE Coded PHY as Primary PHY.

isLocationPermissionGranted

Whether the fine location permission is granted.

isLocationEnabled

Whether location service is enabled on the device.

advertiser

A callback that will be called when the app requests to advertise. The callback should return TX power level used for mock advertising.

scanner

A callback that will be called when the mock central manager requests to scan for devices. It returns whether the scan was successful, secretly failed, or returned an error.