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(AdvertiseData) indicating result of the operation.

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

Callback triggered in response to BluetoothLeAdvertiser.startAdvertisingSet(AdvertisingSetParameters, AdvertiseData, AdvertiseData, PeriodicAdvertisingParameters, AdvertiseData, AdvertisingSetCallback) indicating result of the operation.

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

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

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

Callback triggered in response to BluetoothLeAdvertiser.startAdvertisingSet(AdvertisingSetParameters, AdvertiseData, AdvertiseData, PeriodicAdvertisingParameters, AdvertiseData, AdvertisingSetCallback) indicating result of the operation.

void onAdvertisingSetStopped(AdvertisingSet advertisingSet)

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

void onPeriodicAdvertisingDataSet(AdvertisingSet advertisingSet, int status)

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

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

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

void onPeriodicAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int status)

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

void onScanResponseDataSet(AdvertisingSet advertisingSet, int status)

Callback triggered in response to AdvertisingSet.setAdvertisingData(AdvertiseData) 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(AdvertiseData) 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(AdvertisingSetParameters, AdvertiseData, AdvertiseData, PeriodicAdvertisingParameters, AdvertiseData, AdvertisingSetCallback) 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(AdvertisingSetParameters) 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(AdvertisingSetParameters, AdvertiseData, AdvertiseData, PeriodicAdvertisingParameters, AdvertiseData, AdvertisingSetCallback) 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(AdvertisingSetCallback) 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(AdvertiseData) 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(boolean) 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(PeriodicAdvertisingParameters) 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(AdvertiseData) indicating result of the operation.

Parameters
advertisingSet AdvertisingSet: The advertising set.

status int: Status of the operation.