advertising

fun advertising(parameters: AdvertisingSetParameters = LegacyAdvertisingSetParameters(true), delay: Duration = Duration.ZERO, timeout: Duration = Duration.INFINITE, isAdvertisingWhenConnected: Boolean = false, isBeacon: Boolean = false, advertisingData: AdvertisingDataScope.() -> Unit): PeripheralSpec.Builder<ID>

Adds an advertising set to the peripheral.

Parameters

parameters

The advertising parameters.

delay

The delay before the advertising starts.

timeout

The advertising timeout, since the start of advertising. By default set to infinite.

isAdvertisingWhenConnected

Whether the device should advertise when connected.

isBeacon

Whether the device is a beacon which can reveal user's location, that is an iBeacon or Eddystone beacon. On Android 12+ such advertisements require location permission granted or are excluded from the scan results.

advertisingData

The builder for the advertising data.


fun advertising(parameters: AdvertisingSetParameters = LegacyAdvertisingSetParameters(true), delay: Duration = Duration.ZERO, maxAdvertisingEvents: @Range(from = 1, to = 255) Int, isAdvertisingWhenConnected: Boolean = false, isBeacon: Boolean = false, advertisingData: AdvertisingDataScope.() -> Unit): PeripheralSpec.Builder<ID>

Adds an advertising set to the peripheral.

Parameters

parameters

The advertising parameters.

delay

The delay before the advertising starts.

maxAdvertisingEvents

The maximum number of advertising events, in range 1..255.

isAdvertisingWhenConnected

Whether the device should advertise when connected.

isBeacon

Whether the device is a beacon which can reveal user's location, that is an iBeacon or Eddystone beacon. On Android 12+ such advertisements require location permission granted or are excluded from the scan results.

advertisingData

The builder for the advertising data.