public interface DiscoveryListener
date: 2019/8/3 09:17 author: zengfansheng
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ERROR_LACK_LOCATION_PERMISSION
缺少定位权限。
|
static int |
ERROR_LOCATION_SERVICE_CLOSED
系统位置服务未开启
|
static int |
ERROR_SCAN_FAILED
搜索错误
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
onDeviceFound(BluetoothDevice device,
int rssi)
搜索到蓝牙设备
|
void |
onDiscoveryError(int errorCode,
java.lang.String errorMsg)
搜索错误
|
void |
onDiscoveryStart()
蓝牙搜索开始
|
void |
onDiscoveryStop()
蓝牙搜索停止
|
static final int ERROR_LACK_LOCATION_PERMISSION
Manifest.permission#ACCESS_COARSE_LOCATION 或者 Manifest.permission#ACCESS_FINE_LOCATIONstatic final int ERROR_LOCATION_SERVICE_CLOSED
static final int ERROR_SCAN_FAILED
void onDiscoveryStart()
void onDiscoveryStop()
void onDeviceFound(@NonNull
BluetoothDevice device,
int rssi)
device - 搜索到的蓝牙设备rssi - 信息强度void onDiscoveryError(int errorCode,
@NonNull
java.lang.String errorMsg)
errorCode - ERROR_LACK_LOCATION_PERMISSION, ERROR_LOCATION_SERVICE_CLOSED