Added in API level 26

AdvertisingSetCallback


abstract class AdvertisingSetCallback
kotlin.Any
   ↳ android.bluetooth.le.AdvertisingSetCallback

Bluetooth LE advertising set callbacks, used to deliver advertising operation status.

Summary

Constants
static Int

Failed to start advertising as the advertising is already started.

static Int

Failed to start advertising as the advertise data to be broadcasted is too large.

static Int

This feature is not supported on this platform.

static Int

Operation failed due to an internal error.

static Int

Failed to start advertising because no advertising instance is available.

static Int

The requested operation was successful.

Public constructors

Public methods
open Unit
onAdvertisingDataSet(advertisingSet: AdvertisingSet!, status: Int)

Callback triggered in response to AdvertisingSet#setAdvertisingData indicating result of the operation.

open Unit
onAdvertisingEnabled(advertisingSet: AdvertisingSet!, enable: Boolean, status: Int)

Callback triggered in response to android.

open Unit
onAdvertisingParametersUpdated(advertisingSet: AdvertisingSet!, txPower: Int, status: Int)

Callback triggered in response to AdvertisingSet#setAdvertisingParameters indicating result of the operation.

open Unit
onAdvertisingSetStarted(advertisingSet: AdvertisingSet!, txPower: Int, status: Int)

Callback triggered in response to android.

open Unit

Callback triggered in response to BluetoothLeAdvertiser#stopAdvertisingSet indicating advertising set is stopped.

open Unit
onPeriodicAdvertisingDataSet(advertisingSet: AdvertisingSet!, status: Int)

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingData indicating result of the operation.

open Unit
onPeriodicAdvertisingEnabled(advertisingSet: AdvertisingSet!, enable: Boolean, status: Int)

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingEnabled indicating result of the operation.

open Unit

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingParameters indicating result of the operation.

open Unit
onScanResponseDataSet(advertisingSet: AdvertisingSet!, status: Int)

Callback triggered in response to AdvertisingSet#setAdvertisingData indicating result of the operation.

Constants

Added in API level 26
static val ADVERTISE_FAILED_ALREADY_STARTED: Int

Failed to start advertising as the advertising is already started.

Value: 3
Added in API level 26
static val ADVERTISE_FAILED_DATA_TOO_LARGE: Int

Failed to start advertising as the advertise data to be broadcasted is too large.

Value: 1
Added in API level 26
static val ADVERTISE_FAILED_FEATURE_UNSUPPORTED: Int

This feature is not supported on this platform.

Value: 5
Added in API level 26
static val ADVERTISE_FAILED_INTERNAL_ERROR: Int

Operation failed due to an internal error.

Value: 4
Added in API level 26
static val ADVERTISE_FAILED_TOO_MANY_ADVERTISERS: Int

Failed to start advertising because no advertising instance is available.

Value: 2
Added in API level 26
static val ADVERTISE_SUCCESS: Int

The requested operation was successful.

Value: 0

Public constructors

AdvertisingSetCallback

Added in API level 26
AdvertisingSetCallback()

Public methods

onAdvertisingDataSet

Added in API level 26
open fun onAdvertisingDataSet(
    advertisingSet: AdvertisingSet!,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setAdvertisingData indicating result of the operation. If status is ADVERTISE_SUCCESS, then data was changed.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.

onAdvertisingEnabled

Added in API level 26
open fun onAdvertisingEnabled(
    advertisingSet: AdvertisingSet!,
    enable: Boolean,
    status: Int
): Unit

Callback triggered in response to android.bluetooth.le.BluetoothLeAdvertiser#startAdvertisingSet indicating result of the operation. If status is ADVERTISE_SUCCESS, then advertising set is advertising.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.

onAdvertisingParametersUpdated

Added in API level 26
open fun onAdvertisingParametersUpdated(
    advertisingSet: AdvertisingSet!,
    txPower: Int,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setAdvertisingParameters indicating result of the operation.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
txPower Int: tx power that will be used for this set.
status Int: Status of the operation.

onAdvertisingSetStarted

Added in API level 26
open fun onAdvertisingSetStarted(
    advertisingSet: AdvertisingSet!,
    txPower: Int,
    status: Int
): Unit

Callback triggered in response to android.bluetooth.le.BluetoothLeAdvertiser#startAdvertisingSet indicating result of the operation. If status is ADVERTISE_SUCCESS, then advertisingSet contains the started set and it is advertising. If error occurred, advertisingSet is null, and status will be set to proper error code.

Parameters
advertisingSet AdvertisingSet!: The advertising set that was started or null if error.
txPower Int: tx power that will be used for this set.
status Int: Status of the operation.

onAdvertisingSetStopped

Added in API level 26
open fun onAdvertisingSetStopped(advertisingSet: AdvertisingSet!): Unit

Callback triggered in response to BluetoothLeAdvertiser#stopAdvertisingSet indicating advertising set is stopped.

Parameters
advertisingSet AdvertisingSet!: The advertising set.

onPeriodicAdvertisingDataSet

Added in API level 26
open fun onPeriodicAdvertisingDataSet(
    advertisingSet: AdvertisingSet!,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingData indicating result of the operation.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.

onPeriodicAdvertisingEnabled

Added in API level 26
open fun onPeriodicAdvertisingEnabled(
    advertisingSet: AdvertisingSet!,
    enable: Boolean,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingEnabled indicating result of the operation.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.

onPeriodicAdvertisingParametersUpdated

Added in API level 26
open fun onPeriodicAdvertisingParametersUpdated(
    advertisingSet: AdvertisingSet!,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setPeriodicAdvertisingParameters indicating result of the operation.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.

onScanResponseDataSet

Added in API level 26
open fun onScanResponseDataSet(
    advertisingSet: AdvertisingSet!,
    status: Int
): Unit

Callback triggered in response to AdvertisingSet#setAdvertisingData indicating result of the operation.

Parameters
advertisingSet AdvertisingSet!: The advertising set.
status Int: Status of the operation.