提交 28e89c4f 编写于 作者: Z zengyawen

update docs

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 4a77f414
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- [Background Task Management ](background-task-management/Readme-EN.md) - [Background Task Management ](background-task-management/Readme-EN.md)
- [Media](media/Readme-EN.md) - [Media](media/Readme-EN.md)
- [Security](security/Readme-EN.md) - [Security](security/Readme-EN.md)
- [IPC & RPC](connectivity/ipc-rpc.md) - [Connectivity](connectivity/Readme-EN.md)
- [Data Management](database/Readme-EN.md) - [Data Management](database/Readme-EN.md)
- [USB Service](usb/Readme-EN.md) - [USB Service](usb/Readme-EN.md)
- [DFX](dfx/Readme-EN.md) - [DFX](dfx/Readme-EN.md)
......
# Bluetooth > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **Note:**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The Bluetooth module provides Classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
The Bluetooth module provides Classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
## Modules to Import ## Modules to Import
...@@ -2193,7 +2192,7 @@ Defines the SPP configuration parameters. ...@@ -2193,7 +2192,7 @@ Defines the SPP configuration parameters.
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| uuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;SPP. | | uuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;SPP. |
| isPrimary | boolean | Yes | Yes | Whether&nbsp;it&nbsp;is&nbsp;a&nbsp;secure&nbsp;channel. | | isPrimary | boolean | Yes | Yes | Whether&nbsp;it&nbsp;is&nbsp;a&nbsp;secure&nbsp;channel. |
| type | [ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref2575mcpsimp,link:#SppType](#SppType) | Yes | Yes | Type&nbsp;of&nbsp;the&nbsp;SPP&nbsp;link. | | type | [SppType](#SppType) | Yes | Yes | Type&nbsp;of&nbsp;the&nbsp;SPP&nbsp;link. |
## SppType ## SppType
...@@ -2213,8 +2212,8 @@ Defines the GATT service API parameters. ...@@ -2213,8 +2212,8 @@ Defines the GATT service API parameters.
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| serviceUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;service,&nbsp;for&nbsp;example,&nbsp;**00001888-0000-1000-8000-00805f9b34fb**. | | serviceUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;service,&nbsp;for&nbsp;example,&nbsp;**00001888-0000-1000-8000-00805f9b34fb**. |
| isPrimary | boolean | Yes | Yes | Whether&nbsp;the&nbsp;service&nbsp;is&nbsp;a&nbsp;primary&nbsp;service.&nbsp;The&nbsp;value&nbsp;**true**&nbsp;means&nbsp;a&nbsp;primary&nbsp;service. | | isPrimary | boolean | Yes | Yes | Whether&nbsp;the&nbsp;service&nbsp;is&nbsp;a&nbsp;primary&nbsp;service.&nbsp;The&nbsp;value&nbsp;**true**&nbsp;means&nbsp;a&nbsp;primary&nbsp;service. |
| characteristics | Array&lt;[ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref2628mcpsimp,link:#BLECharacteristic](#BLECharacteristic)&gt; | Yes | Yes | List&nbsp;of&nbsp;characteristics&nbsp;of&nbsp;the&nbsp;service. | | characteristics | Array&lt;[BLECharacteristic](#BLECharacteristic)&gt; | Yes | Yes | List&nbsp;of&nbsp;characteristics&nbsp;of&nbsp;the&nbsp;service. |
| includeServices | Array&lt;[ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref2635mcpsimp,link:#GattService](#GattService)&gt; | Yes | Yes | Services&nbsp;on&nbsp;which&nbsp;the&nbsp;service&nbsp;depends. | | includeServices | Array&lt;[GattService](#GattService)&gt; | Yes | Yes | Services&nbsp;on&nbsp;which&nbsp;the&nbsp;service&nbsp;depends. |
## BLECharacteristic ## BLECharacteristic
...@@ -2226,7 +2225,7 @@ Defines the characteristic API parameters. ...@@ -2226,7 +2225,7 @@ Defines the characteristic API parameters.
| serviceUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;service,&nbsp;for&nbsp;example,&nbsp;**00001888-0000-1000-8000-00805f9b34fb**. | | serviceUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;service,&nbsp;for&nbsp;example,&nbsp;**00001888-0000-1000-8000-00805f9b34fb**. |
| characteristicUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;characteristic,&nbsp;for&nbsp;example,&nbsp;**00002a11-0000-1000-8000-00805f9b34fb**. | | characteristicUuid | string | Yes | Yes | UUID&nbsp;of&nbsp;the&nbsp;characteristic,&nbsp;for&nbsp;example,&nbsp;**00002a11-0000-1000-8000-00805f9b34fb**. |
| characteristicValue | ArrayBuffer | Yes | Yes | Binary&nbsp;value&nbsp;of&nbsp;the&nbsp;characteristic. | | characteristicValue | ArrayBuffer | Yes | Yes | Binary&nbsp;value&nbsp;of&nbsp;the&nbsp;characteristic. |
| descriptors | Array&lt;[ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref2677mcpsimp,link:#BLEDescriptor](#BLEDescriptor)&gt; | Yes | Yes | List&nbsp;of&nbsp;descriptors&nbsp;of&nbsp;the&nbsp;characteristic. | | descriptors | Array&lt;[BLEDescriptor](#BLEDescriptor)&gt; | Yes | Yes | List&nbsp;of&nbsp;descriptors&nbsp;of&nbsp;the&nbsp;characteristic. |
## BLEDescriptor ## BLEDescriptor
...@@ -2331,7 +2330,7 @@ Defines the parameters of **BLEConnectChangedState**. ...@@ -2331,7 +2330,7 @@ Defines the parameters of **BLEConnectChangedState**.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| deviceId | string | Yes | No | Address&nbsp;of&nbsp;the&nbsp;peer&nbsp;device,&nbsp;for&nbsp;example,&nbsp;**8F:8F:8E:8E:6D:6D**. | | deviceId | string | Yes | No | Address&nbsp;of&nbsp;the&nbsp;peer&nbsp;device,&nbsp;for&nbsp;example,&nbsp;**8F:8F:8E:8E:6D:6D**. |
| state | [ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref3060mcpsimp,link:#ProfileConnectionState](#ProfileConnectionState) | Yes | Yes | BLE&nbsp;connection&nbsp;state. | | state | [ProfileConnectionState](#ProfileConnectionState) | Yes | Yes | BLE&nbsp;connection&nbsp;state. |
## ProfileConnectionState ## ProfileConnectionState
...@@ -2364,8 +2363,8 @@ Defines the scan configuration parameters. ...@@ -2364,8 +2363,8 @@ Defines the scan configuration parameters.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| interval | number | Yes | Yes | Delay&nbsp;in&nbsp;reporting&nbsp;the&nbsp;scan&nbsp;result.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**0**. | | interval | number | Yes | Yes | Delay&nbsp;in&nbsp;reporting&nbsp;the&nbsp;scan&nbsp;result.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**0**. |
| dutyMode | [ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref3154mcpsimp,link:#ScanDuty](#ScanDuty) | Yes | Yes | Scan&nbsp;duty.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**SCAN_MODE_LOW_POWER**. | | dutyMode | [ScanDuty](#ScanDuty) | Yes | Yes | Scan&nbsp;duty.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**SCAN_MODE_LOW_POWER**. |
| matchMode | [ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref3161mcpsimp,link:#MatchMode](#MatchMode) | Yes | Yes | Hardware&nbsp;match&nbsp;mode&nbsp;for&nbsp;BLE&nbsp;scan&nbsp;filters.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**MATCH_MODE_AGGRESSIVE**. | | matchMode | [MatchMode](#MatchMode) | Yes | Yes | Hardware&nbsp;match&nbsp;mode&nbsp;for&nbsp;BLE&nbsp;scan&nbsp;filters.&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;**MATCH_MODE_AGGRESSIVE**. |
## ScanDuty ## ScanDuty
...@@ -2433,8 +2432,8 @@ Defines the content of a BLE advertisement packet. ...@@ -2433,8 +2432,8 @@ Defines the content of a BLE advertisement packet.
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| serviceUuids | Array&lt;string&gt; | Yes | Yes | List&nbsp;of&nbsp;service&nbsp;UUIDs&nbsp;to&nbsp;be&nbsp;broadcasted. | | serviceUuids | Array&lt;string&gt; | Yes | Yes | List&nbsp;of&nbsp;service&nbsp;UUIDs&nbsp;to&nbsp;be&nbsp;broadcasted. |
| manufactureData | Array&lt;[ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref3348mcpsimp,link:#ManufactureData](#ManufactureData)&gt; | Yes | Yes | List&nbsp;of&nbsp;manufacturers&nbsp;to&nbsp;be&nbsp;broadcasted. | | manufactureData | Array&lt;[ManufactureData](#ManufactureData)&gt; | Yes | Yes | List&nbsp;of&nbsp;manufacturers&nbsp;to&nbsp;be&nbsp;broadcasted. |
| serviceData | Array&lt;[ERROR:Invalid&nbsp;link:en-us_topic_0000001193344974.xml#xref3355mcpsimp,link:#ServiceData](#ServiceData)&gt; | Yes | Yes | List&nbsp;of&nbsp;service&nbsp;data&nbsp;to&nbsp;be&nbsp;broadcasted. | | serviceData | Array&lt;[ServiceData](#ServiceData)&gt; | Yes | Yes | List&nbsp;of&nbsp;service&nbsp;data&nbsp;to&nbsp;be&nbsp;broadcasted. |
## ManufactureData ## ManufactureData
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- [后台任务管理](background-task-management/Readme-CN.md) - [后台任务管理](background-task-management/Readme-CN.md)
- [媒体](media/Readme-CN.md) - [媒体](media/Readme-CN.md)
- [安全](security/Readme-CN.md) - [安全](security/Readme-CN.md)
- [IPC与RPC通信](connectivity/ipc-rpc.md) - [网络与连接](connectivity/Readme-CN.md)
- [数据管理](database/Readme-CN.md) - [数据管理](database/Readme-CN.md)
- [USB服务](usb/Readme-CN.md) - [USB服务](usb/Readme-CN.md)
- [DFX](dfx/Readme-CN.md) - [DFX](dfx/Readme-CN.md)
......
# Bluetooth > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> 蓝牙模块提供了基础的传统蓝牙能力以及BLE的扫描、广播等功能。
蓝牙模块提供了基础的传统蓝牙能力以及BLE的扫描、广播等功能。
## 导入模块 ## 导入模块
...@@ -24,6 +22,8 @@ ohos.permission.DISCOVER_BLUETOOTH ...@@ -24,6 +22,8 @@ ohos.permission.DISCOVER_BLUETOOTH
ohos.permission.LOCATION ohos.permission.LOCATION
## bluetooth.enableBluetooth ## bluetooth.enableBluetooth
enableBluetooth(): boolean enableBluetooth(): boolean
...@@ -2200,7 +2200,7 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2200,7 +2200,7 @@ let rssi = gattClient.getRssiValue().then((data) => {
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| uuid | string | 是 | 是 | spp单据的uuid。 | | uuid | string | 是 | 是 | spp单据的uuid。 |
| isPrimary | boolean | 是 | 是 | 是否是安全通道。 | | isPrimary | boolean | 是 | 是 | 是否是安全通道。 |
| type | [ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref2575mcpsimp,link:#SppType](#SppType) | 是 | 是 | Spp链路类型。 | | type | [SppType](#SppType) | 是 | 是 | Spp链路类型。 |
## SppType ## SppType
...@@ -2220,8 +2220,8 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2220,8 +2220,8 @@ let rssi = gattClient.getRssiValue().then((data) => {
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | | serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 |
| isPrimary | boolean | 是 | 是 | 如果是主服务设置为true,否则设置为false。 | | isPrimary | boolean | 是 | 是 | 如果是主服务设置为true,否则设置为false。 |
| characteristics | Array&lt;[ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref2628mcpsimp,link:#BLECharacteristic](#BLECharacteristic)&gt; | 是 | 是 | 当前服务包含的特征列表。 | | characteristics | Array&lt;[BLECharacteristic](#BLECharacteristic)&gt; | 是 | 是 | 当前服务包含的特征列表。 |
| includeServices | Array&lt;[ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref2635mcpsimp,link:#GattService](#GattService)&gt; | 是 | 是 | 当前服务依赖的其它服务。 | | includeServices | Array&lt;[GattService](#GattService)&gt; | 是 | 是 | 当前服务依赖的其它服务。 |
## BLECharacteristic ## BLECharacteristic
...@@ -2233,7 +2233,7 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2233,7 +2233,7 @@ let rssi = gattClient.getRssiValue().then((data) => {
| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | | serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 |
| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | | characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 |
| characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 | | characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 |
| descriptors | Array&lt;[ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref2677mcpsimp,link:#BLEDescriptor](#BLEDescriptor)&gt; | 是 | 是 | 特定特征的描述符列表。 | | descriptors | Array&lt;[BLEDescriptor](#BLEDescriptor)&gt; | 是 | 是 | 特定特征的描述符列表。 |
## BLEDescriptor ## BLEDescriptor
...@@ -2338,7 +2338,7 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2338,7 +2338,7 @@ let rssi = gattClient.getRssiValue().then((data) => {
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| deviceId | string | 是 | 否 | 表示远端设备地址,例如:"8F:8F:8E:8E:6D:6D"。 | | deviceId | string | 是 | 否 | 表示远端设备地址,例如:"8F:8F:8E:8E:6D:6D"。 |
| state | [ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref3060mcpsimp,link:#ProfileConnectionState](#ProfileConnectionState) | 是 | 是 | 表示BLE连接状态的枚举。 | | state | [ProfileConnectionState](#ProfileConnectionState) | 是 | 是 | 表示BLE连接状态的枚举。 |
## ProfileConnectionState ## ProfileConnectionState
...@@ -2371,8 +2371,8 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2371,8 +2371,8 @@ let rssi = gattClient.getRssiValue().then((data) => {
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| interval | number | 是 | 是 | 表示扫描结果上报延迟时间,默认值为0。 | | interval | number | 是 | 是 | 表示扫描结果上报延迟时间,默认值为0。 |
| dutyMode | [ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref3154mcpsimp,link:#ScanDuty](#ScanDuty) | 是 | 是 | 表示扫描模式,默认值为SCAN_MODE_LOW_POWER。 | | dutyMode | [ScanDuty](#ScanDuty) | 是 | 是 | 表示扫描模式,默认值为SCAN_MODE_LOW_POWER。 |
| matchMode | [ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref3161mcpsimp,link:#MatchMode](#MatchMode) | 是 | 是 | 表示硬件的过滤匹配模式,默认值为MATCH_MODE_AGGRESSIVE。 | | matchMode | [MatchMode](#MatchMode) | 是 | 是 | 表示硬件的过滤匹配模式,默认值为MATCH_MODE_AGGRESSIVE。 |
## ScanDuty ## ScanDuty
...@@ -2440,8 +2440,8 @@ let rssi = gattClient.getRssiValue().then((data) => { ...@@ -2440,8 +2440,8 @@ let rssi = gattClient.getRssiValue().then((data) => {
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| serviceUuids | Array&lt;string&gt; | 是 | 是 | 表示要广播的服务&nbsp;UUID&nbsp;列表。 | | serviceUuids | Array&lt;string&gt; | 是 | 是 | 表示要广播的服务&nbsp;UUID&nbsp;列表。 |
| manufactureData | Array&lt;[ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref3348mcpsimp,link:#ManufactureData](#ManufactureData)&gt; | 是 | 是 | 表示要广播的广播的制造商信息列表。 | | manufactureData | Array&lt;[ManufactureData](#ManufactureData)&gt; | 是 | 是 | 表示要广播的广播的制造商信息列表。 |
| serviceData | Array&lt;[ERROR:Invalid&nbsp;link:zh-cn_topic_0000001193344974.xml#xref3355mcpsimp,link:#ServiceData](#ServiceData)&gt; | 是 | 是 | 表示要广播的服务数据列表。 | | serviceData | Array&lt;[ServiceData](#ServiceData)&gt; | 是 | 是 | 表示要广播的服务数据列表。 |
## ManufactureData ## ManufactureData
......
# UI # UI
- 方舟开发框架(ArkUI) - [方舟开发框架(ArkUI)概述](arkui-overview.md)
- [方舟开发框架概述](arkui-overview.md) - 基于JS扩展的类Web开发范式
- 基于JS扩展的类Web开发范式
- [概述](ui-js-overview.md) - [概述](ui-js-overview.md)
- 框架说明 - 框架说明
- [文件组织](js-framework-file.md) - [文件组织](js-framework-file.md)
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
- [动画动效](ui-js-animate-dynamic-effects.md) - [动画动效](ui-js-animate-dynamic-effects.md)
- [动画帧](ui-js-animate-frame.md) - [动画帧](ui-js-animate-frame.md)
- [自定义组件](ui-js-custom-components.md) - [自定义组件](ui-js-custom-components.md)
- 基于TS扩展的声明式开发范式 - 基于TS扩展的声明式开发范式
- [概述](ui-ts-overview.md) - [概述](ui-ts-overview.md)
- 框架说明 - 框架说明
- 文件组织 - 文件组织
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册