public abstract class BleAdvertiseCallback extends Object
You can inherit from this class to implement BLE advertising callbacks.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
RESULT_FAIL_ALREADY_STARTED |
Failed to start BLE advertising because it has already been started.
|
static int |
RESULT_FAIL_DATA_ILLEGAL |
Failed to start BLE advertising because the advertising data is larger than 31 bytes.
|
static int |
RESULT_FAIL_ERROR |
Failed to start BLE advertising because an error occurred.
|
static int |
RESULT_FAIL_FEATURE_UNSUPPORTED |
Failed to start BLE advertising because it is not supported.
|
static int |
RESULT_FAIL_TOO_MANY_ADVERTISERS |
Failed to start BLE advertising because no more advertisers can be added.
|
static int |
RESULT_SUCC |
BLE advertising is started successfully.
|
| 构造器 | 说明 |
|---|---|
BleAdvertiseCallback() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
startResultEvent(int result) |
Called when BLE advertising is started via
BleAdvertiser#startAdvertising(BleAdvertiseSettings, BleAdvertiseData, BleAdvertiseData). |
public static final int RESULT_FAIL_ALREADY_STARTED
public static final int RESULT_FAIL_DATA_ILLEGAL
public static final int RESULT_FAIL_ERROR
public static final int RESULT_FAIL_FEATURE_UNSUPPORTED
public static final int RESULT_FAIL_TOO_MANY_ADVERTISERS
public static final int RESULT_SUCC
public void startResultEvent(int result)
BleAdvertiser#startAdvertising(BleAdvertiseSettings, BleAdvertiseData, BleAdvertiseData).result - Indicates the result of starting BLE advertising. The value can be RESULT_SUCC,
indicating that BLE advertising is started successfully. The value can also be any of the following,
indicating a failure to start BLE advertising: RESULT_FAIL_DATA_ILLEGAL, RESULT_FAIL_TOO_MANY_ADVERTISERS,
RESULT_FAIL_ALREADY_STARTED, RESULT_FAIL_ERROR, and RESULT_FAIL_FEATURE_UNSUPPORTED.