AdvertiseCallback
abstract class AdvertiseCallback
kotlin.Any | |
↳ | android.bluetooth.le.AdvertiseCallback |
Bluetooth LE advertising 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 larger than 31 bytes. |
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. |
Public constructors | |
---|---|
Public methods | |
---|---|
open Unit |
onStartFailure(errorCode: Int) Callback when advertising could not be started. |
open Unit |
onStartSuccess(settingsInEffect: AdvertiseSettings!) Callback triggered in response to android. |
Constants
ADVERTISE_FAILED_ALREADY_STARTED
static val ADVERTISE_FAILED_ALREADY_STARTED: Int
Failed to start advertising as the advertising is already started.
Value: 3
ADVERTISE_FAILED_DATA_TOO_LARGE
static val ADVERTISE_FAILED_DATA_TOO_LARGE: Int
Failed to start advertising as the advertise data to be broadcasted is larger than 31 bytes.
Value: 1
ADVERTISE_FAILED_FEATURE_UNSUPPORTED
static val ADVERTISE_FAILED_FEATURE_UNSUPPORTED: Int
This feature is not supported on this platform.
Value: 5
ADVERTISE_FAILED_INTERNAL_ERROR
static val ADVERTISE_FAILED_INTERNAL_ERROR: Int
Operation failed due to an internal error.
Value: 4
ADVERTISE_FAILED_TOO_MANY_ADVERTISERS
static val ADVERTISE_FAILED_TOO_MANY_ADVERTISERS: Int
Failed to start advertising because no advertising instance is available.
Value: 2
Public constructors
Public methods
onStartFailure
open fun onStartFailure(errorCode: Int): Unit
Callback when advertising could not be started.
Parameters | |
---|---|
errorCode |
Int: Error code (see ADVERTISE_FAILED_* constants) for advertising start failures. |
onStartSuccess
open fun onStartSuccess(settingsInEffect: AdvertiseSettings!): Unit
Callback triggered in response to android.bluetooth.le.BluetoothLeAdvertiser#startAdvertising indicating that the advertising has been started successfully.
Parameters | |
---|---|
settingsInEffect |
AdvertiseSettings!: The actual settings used for advertising, which may be different from what has been requested. |