提交 97700651 编写于 作者: L lverpeng

add bluetoothManager.md

Signed-off-by: Nlverpeng <lverpeng118@163.com>
上级 aab1f0cb
......@@ -19,14 +19,12 @@ import bluetooth from '@system.bluetooth';
开始搜寻附近的低功耗蓝牙外围设备。此操作比较耗费系统资源,请在搜索并连接到设备后调用[bluetooth.stopBLEScan](#bluetoothstopblescanobject)方法停止搜索。
**需要权限:** ohos.permission.DISCOVER_BLUETOOTH、ohos.permission.LOCATION
**系统能力:** SystemCapability.Communication.Bluetooth.Lite
**参数:**
**表1** StartBLEScanOptions
| 参数名 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| interval | number | 否 | 上报设备的间隔,单位毫秒,默认值为0。0表示找到新设备立即上报,其他数值根据传入的间隔上报。 |
| success | Function | 否 | 接口调用成功的回调函数。 |
......@@ -55,14 +53,12 @@ import bluetooth from '@system.bluetooth';
停止搜寻附近的低功耗蓝牙外围设备。与[bluetooth.startBLEScan(OBJECT)](#bluetoothstartblescanobject)接口配套使用。
**需要权限:** ohos.permission.DISCOVER_BLUETOOTH、ohos.permission.LOCATION
**系统能力:** SystemCapability.Communication.Bluetooth.Lite
**参数:**
**表2** StopBLEScanOptions
| 参数名 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
......@@ -89,14 +85,12 @@ import bluetooth from '@system.bluetooth';
订阅寻找到新设备。再次调用时,会覆盖前一次调用效果,即仅最后一次调用生效。
**需要权限:** ohos.permission.DISCOVER_BLUETOOTH、ohos.permission.LOCATION
**系统能力:** SystemCapability.Communication.Bluetooth.Lite
**参数:**
**表3** SubscribeBLEFoundOptions
| 参数 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| success | Function | 是 | 寻找到新设备上报时调用的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
......@@ -135,8 +129,6 @@ import bluetooth from '@system.bluetooth';
解除订阅寻找到新设备。
**需要权限:** ohos.permission.DISCOVER_BLUETOOTH、ohos.permission.LOCATION
**系统能力:** SystemCapability.Communication.Bluetooth.Lite
**示例:**
......
# 蓝牙服务子系统错误码
## 2900001
**错误信息**
Service stopped.
**错误描述**
蓝牙服务已停止,蓝牙服务相关的接口无法调用。
**可能原因**
蓝牙服务启动异常。
**处理步骤**
重新执行打开或关闭蓝牙。
## 2900003
**错误信息**
Bluetooth switch is off.
**错误描述**
蓝牙开关已关闭。
**可能原因**
蓝牙开关已关闭。
**处理步骤**
重新执行打开蓝牙开关。
## 2900004
**错误信息**
Profile is not supported.
**错误描述**
配置文件是不支持的。
**可能原因**
该配置文件在当前设备环境不支持。
**处理步骤**
检查设备是否支持该配置文件功能,若不支持则停止调用。
## 2900099
**错误信息**
Operation failed.
**错误描述**
操作失败。
**可能原因**
该配置文件在当前设备环境不支持。
**处理步骤**
请重试该操作。
## 2901000
**错误信息**
Read forbidden.
**错误描述**
禁止读操作。
**可能原因**
无读操作权限。
**处理步骤**
检查是否有读操作权限。
## 2901001
**错误信息**
Write forbidden.
**错误描述**
禁止写操作。
**可能原因**
无写操作权限。
**处理步骤**
检查是否有写操作权限。
## 2901054
**错误信息**
IO error.
**错误描述**
IO传输失败。
**可能原因**
IO传输异常,造成失败。
**处理步骤**
请重试该操作。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册