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

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

Callback triggered in response to 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 setAdvertisingParameters(AdvertisingSetParameters) indicating result of the operation.

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

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

void onAdvertisingSetStopped(AdvertisingSet advertisingSet)

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

void onPeriodicAdvertisingDataSet(AdvertisingSet advertisingSet, int status)

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

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

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

void onPeriodicAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int status)

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

void onScanResponseDataSet(AdvertisingSet advertisingSet, int status)

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

Inherited methods

Constants

ADVERTISE_FAILED_ALREADY_STARTED

added in API level 26
int ADVERTISE_FAILED_ALREADY_STARTED

Failed to start advertising as the advertising is already started.

Constant Value: 3 (0x00000003)

ADVERTISE_FAILED_DATA_TOO_LARGE

added in API level 26
int ADVERTISE_FAILED_DATA_TOO_LARGE

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

Constant Value: 1 (0x00000001)

ADVERTISE_FAILED_FEATURE_UNSUPPORTED

added in API level 26
int ADVERTISE_FAILED_FEATURE_UNSUPPORTED

This feature is not supported on this platform.

Constant Value: 5 (0x00000005)

ADVERTISE_FAILED_INTERNAL_ERROR

added in API level 26
int ADVERTISE_FAILED_INTERNAL_ERROR

Operation failed due to an internal error.

Constant Value: 4 (0x00000004)

ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

added in API level 26
int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

Failed to start advertising because no advertising instance is available.

Constant Value: 2 (0x00000002)

ADVERTISE_SUCCESS

added in API level 26
int ADVERTISE_SUCCESS

The requested operation was successful.

Constant Value: 0 (0x00000000)

Public constructors

AdvertisingSetCallback

added in API level 26
AdvertisingSetCallback ()

Public methods

onAdvertisingDataSet

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

Callback triggered in response to 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
void onAdvertisingEnabled (AdvertisingSet advertisingSet, 
                boolean enable, 
                int status)

Callback triggered in response to 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
void onAdvertisingParametersUpdated (AdvertisingSet advertisingSet, 
                int txPower, 
                int status)

Callback triggered in response to 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
void onAdvertisingSetStarted (AdvertisingSet advertisingSet, 
                int txPower, 
                int status)

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

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

onPeriodicAdvertisingDataSet

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

Callback triggered in response to 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
void onPeriodicAdvertisingEnabled (AdvertisingSet advertisingSet, 
                boolean enable, 
                int status)

Callback triggered in response to 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
void onPeriodicAdvertisingParametersUpdated (AdvertisingSet advertisingSet, 
                int status)

Callback triggered in response to 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
void onScanResponseDataSet (AdvertisingSet advertisingSet, 
                int status)

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

Parameters
advertisingSet AdvertisingSet: The advertising set.

status int: Status of the operation.