Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#constants) \| [Ctors](https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#pubctors) \| [Methods](https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#inhmethods)

# AdvertisingSetCallback

*** ** * ** ***

` public abstract class AdvertisingSetCallback `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.le.AdvertisingSetCallback |

<br />

*** ** * ** ***

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

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_FAILED_ALREADY_STARTED` Failed to start advertising as the advertising is already started. |
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_FAILED_DATA_TOO_LARGE` Failed to start advertising as the advertise data to be broadcasted is too large. |
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_FAILED_FEATURE_UNSUPPORTED` This feature is not supported on this platform. |
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_FAILED_INTERNAL_ERROR` Operation failed due to an internal error. |
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_FAILED_TOO_MANY_ADVERTISERS` Failed to start advertising because no advertising instance is available. |
| `int` | `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#ADVERTISE_SUCCESS` The requested operation was successful. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#AdvertisingSetCallback()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onAdvertisingDataSet(android.bluetooth.le.AdvertisingSet,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onAdvertisingEnabled(android.bluetooth.le.AdvertisingSet,%20boolean,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, boolean enable, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.PeriodicAdvertisingParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertisingSetCallback)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet,%20int,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int txPower, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onAdvertisingSetStarted(android.bluetooth.le.AdvertisingSet,%20int,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int txPower, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.PeriodicAdvertisingParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertisingSetCallback)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onAdvertisingSetStopped(android.bluetooth.le.AdvertisingSet)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback)` indicating advertising set is stopped. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onPeriodicAdvertisingDataSet(android.bluetooth.le.AdvertisingSet,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onPeriodicAdvertisingEnabled(android.bluetooth.le.AdvertisingSet,%20boolean,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, boolean enable, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingEnabled(boolean)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onPeriodicAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters)` indicating result of the operation. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#onScanResponseDataSet(android.bluetooth.le.AdvertisingSet,%20int)(https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet advertisingSet, int status) ` Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### ADVERTISE_FAILED_ALREADY_STARTED

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_FAILED_ALREADY_STARTED
```

Failed to start advertising as the advertising is already started.

<br />

Constant Value: 3 (0x00000003)

### ADVERTISE_FAILED_DATA_TOO_LARGE

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_FAILED_DATA_TOO_LARGE
```

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

<br />

Constant Value: 1 (0x00000001)

### ADVERTISE_FAILED_FEATURE_UNSUPPORTED

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED
```

This feature is not supported on this platform.

<br />

Constant Value: 5 (0x00000005)

### ADVERTISE_FAILED_INTERNAL_ERROR

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_FAILED_INTERNAL_ERROR
```

Operation failed due to an internal error.

<br />

Constant Value: 4 (0x00000004)

### ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS
```

Failed to start advertising because no advertising instance is available.

<br />

Constant Value: 2 (0x00000002)

### ADVERTISE_SUCCESS

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADVERTISE_SUCCESS
```

The requested operation was successful.

<br />

Constant Value: 0 (0x00000000)

## Public constructors

### AdvertisingSetCallback

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AdvertisingSetCallback ()
```

<br />

<br />

## Public methods

### onAdvertisingDataSet

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onAdvertisingDataSet (AdvertisingSet advertisingSet, 
                int status)
```

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation. If status is ADVERTISE_SUCCESS, then data was changed.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onAdvertisingEnabled

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.PeriodicAdvertisingParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertisingSetCallback)` indicating result of the operation. If status is ADVERTISE_SUCCESS, then advertising set is advertising.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `enable` | `boolean` <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onAdvertisingParametersUpdated

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters)` indicating result of the operation.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `txPower` | `int`: tx power that will be used for this set. <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onAdvertisingSetStarted

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.PeriodicAdvertisingParameters,%20android.bluetooth.le.AdvertiseData,%20android.bluetooth.le.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.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set that was started or null if error. <br /> |
| `txPower` | `int`: tx power that will be used for this set. <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onAdvertisingSetStopped

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onAdvertisingSetStopped (AdvertisingSet advertisingSet)
```

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/BluetoothLeAdvertiser#stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback)` indicating advertising set is stopped.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |

### onPeriodicAdvertisingDataSet

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onPeriodicAdvertisingDataSet (AdvertisingSet advertisingSet, 
                int status)
```

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onPeriodicAdvertisingEnabled

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingEnabled(boolean)` indicating result of the operation.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `enable` | `boolean` <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onPeriodicAdvertisingParametersUpdated

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onPeriodicAdvertisingParametersUpdated (AdvertisingSet advertisingSet, 
                int status)
```

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters)` indicating result of the operation.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `status` | `int`: Status of the operation. <br /> |

### onScanResponseDataSet

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void onScanResponseDataSet (AdvertisingSet advertisingSet, 
                int status)
```

Callback triggered in response to `https://developer.android.com/reference/android/bluetooth/le/AdvertisingSet#setAdvertisingData(android.bluetooth.le.AdvertiseData)` indicating result of the operation.

<br />

| Parameters ||
|---|---|
| `advertisingSet` | `AdvertisingSet`: The advertising set. <br /> |
| `status` | `int`: Status of the operation. <br /> |