AdvertisingSetCallback


public abstract class AdvertisingSetCallback
extends Object

java.lang.Object
   ↳ android.bluetooth.le.AdvertisingSetCallback


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

Summary

Constants

int ADVERTISE_FAILED_ALREADY_STARTED

Failed to start advertising as the advertising is already started.

int ADVERTISE_FAILED_DATA_TOO_LARGE

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

int ADVERTISE_FAILED_FEATURE_UNSUPPORTED

This feature is not supported on this platform.

int ADVERTISE_FAILED_INTERNAL_ERROR

Operation failed due to an internal error.

int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

Failed to start advertising because no advertising instance is available.

int ADVERTISE_SUCCESS

The requested operation was successful.

Public constructors

AdvertisingSetCallback()

Public methods

void onAdvertisingDataSet(AdvertisingSet advertisingSet, int status)

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

void onAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable, int status)

Callback triggered in response to BluetoothLeAdvertiser.startAdvertisingSet indicating result of the operation.

void onAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int txPower, int status)

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

void onAdvertisingSetStarted(AdvertisingSet advertisingSet, int txPower, int status)

Callback triggered in response to BluetoothLeAdvertiser.startAdvertisingSet indicating result of the operation.

void onAdvertisingSetStopped(AdvertisingSet advertisingSet)

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

void onPeriodicAdvertisingDataSet(AdvertisingSet advertisingSet, int status)

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

void onPeriodicAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable, int status)

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

void onPeriodicAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int status)

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

void onScanResponseDataSet(AdvertisingSet advertisingSet, int status)

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

Inherited methods

Constants

Added in API level 26
public static final int ADVERTISE_FAILED_ALREADY_STARTED

Failed to start advertising as the advertising is already started.

Constant Value: 3 (0x00000003)

Added in API level 26
public static final int ADVERTISE_FAILED_DATA_TOO_LARGE

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

Constant Value: 1 (0x00000001)

Added in API level 26
public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED

This feature is not supported on this platform.

Constant Value: 5 (0x00000005)

Added in API level 26
public static final int ADVERTISE_FAILED_INTERNAL_ERROR

Operation failed due to an internal error.

Constant Value: 4 (0x00000004)

Added in API level 26
public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

Failed to start advertising because no advertising instance is available.

Constant Value: 2 (0x00000002)

Added in API level 26
public static final int ADVERTISE_SUCCESS

The requested operation was successful.

Constant Value: 0 (0x00000000)

Public constructors

AdvertisingSetCallback

Added in API level 26
public AdvertisingSetCallback ()

Public methods

onAdvertisingDataSet

Added in API level 26
public void onAdvertisingDataSet (AdvertisingSet advertisingSet, 
                int status)

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
public void onAdvertisingEnabled (AdvertisingSet advertisingSet, 
                boolean enable, 
                int status)

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

enable boolean

status int: Status of the operation.

onAdvertisingParametersUpdated

Added in API level 26
public void onAdvertisingParametersUpdated (AdvertisingSet advertisingSet, 
                int txPower, 
                int status)

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
public void onAdvertisingSetStarted (AdvertisingSet advertisingSet, 
                int txPower, 
                int status)

Callback triggered in response to 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
public void onAdvertisingSetStopped (AdvertisingSet advertisingSet)

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

onPeriodicAdvertisingDataSet

Added in API level 26
public void onPeriodicAdvertisingDataSet (AdvertisingSet advertisingSet, 
                int status)

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
public void onPeriodicAdvertisingEnabled (AdvertisingSet advertisingSet, 
                boolean enable, 
                int status)

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

enable boolean

status int: Status of the operation.

onPeriodicAdvertisingParametersUpdated

Added in API level 26
public void onPeriodicAdvertisingParametersUpdated (AdvertisingSet advertisingSet, 
                int status)

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
public void onScanResponseDataSet (AdvertisingSet advertisingSet, 
                int status)

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

status int: Status of the operation.