提交 5d32eba2 编写于 作者: A Annie_wang

Update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 36993f06
# @system.bluetooth (Bluetooth) # @system.bluetooth (Bluetooth)
> **NOTE**<br/> > **NOTE**
> >
> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.bluetooth`](js-apis-bluetooth.md). > - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.bluetooth`](js-apis-bluetooth.md).
> >
...@@ -19,11 +19,10 @@ import bluetooth from '@system.bluetooth'; ...@@ -19,11 +19,10 @@ import bluetooth from '@system.bluetooth';
Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes system resources. Call [bluetooth.stopBLEScan](#bluetoothstopblescanobject) to stop the scan after a BLE device is detected and connected. Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes system resources. Call [bluetooth.stopBLEScan](#bluetoothstopblescanobject) to stop the scan after a BLE device is detected and connected.
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Lite **System capability**: SystemCapability.Communication.Bluetooth.Lite
**Parameters** **Parameters**
**Table 1** StartBLEScanOptions **Table 1** StartBLEScanOptions
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -42,7 +41,7 @@ Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes sys ...@@ -42,7 +41,7 @@ Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes sys
console.log('call bluetooth.startBLEScan success.'); console.log('call bluetooth.startBLEScan success.');
}, },
fail(code, data) { fail(code, data) {
console.log('call bluetooth.startBLEScan failed, code: ${code}, data: ${data}.'); console.log('call bluetooth.startBLEScan failed, code:' + code + ', data:' + data);
}, },
complete() { complete() {
console.log('call bluetooth.startBLEScan complete.'); console.log('call bluetooth.startBLEScan complete.');
...@@ -55,11 +54,10 @@ Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes sys ...@@ -55,11 +54,10 @@ Scans for Bluetooth Low Energy (BLE) devices nearby. This operation consumes sys
Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLEScan(OBJECT)](#bluetoothstartblescanobject) in pairs. Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLEScan(OBJECT)](#bluetoothstartblescanobject) in pairs.
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Lite **System capability**: SystemCapability.Communication.Bluetooth.Lite
**Parameters** **Parameters**
**Table 2** StopBLEScanOptions **Table 2** StopBLEScanOptions
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -76,7 +74,7 @@ Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLE ...@@ -76,7 +74,7 @@ Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLE
console.log('call bluetooth.stopBLEScan success.'); console.log('call bluetooth.stopBLEScan success.');
}, },
fail(data, code) { fail(data, code) {
console.log('call bluethooth.stopBLEScan fail, code: ${code}, data: ${data}.'); console.log('call bluethooth.stopBLEScan fail, code:' + code + ', data:' + data);
}, },
complete() { complete() {
console.log('call bluethooth.stopBLEScan complete.'); console.log('call bluethooth.stopBLEScan complete.');
...@@ -89,8 +87,6 @@ Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLE ...@@ -89,8 +87,6 @@ Stops scanning for BLE devices nearby. This API is used with [bluetooth.startBLE
Subscribes to the newly detected BLE device. If this API is called multiple times, the last call takes effect. Subscribes to the newly detected BLE device. If this API is called multiple times, the last call takes effect.
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Lite **System capability**: SystemCapability.Communication.Bluetooth.Lite
**Parameters** **Parameters**
...@@ -122,10 +118,10 @@ Subscribes to the newly detected BLE device. If this API is called multiple time ...@@ -122,10 +118,10 @@ Subscribes to the newly detected BLE device. If this API is called multiple time
``` ```
bluetooth.subscribeBLEFound({ bluetooth.subscribeBLEFound({
success(data) { success(data) {
console.log('Called bluetooth.subscribeBLEFound successsully, data: ${data}.'); console.log('call bluetooth.subscribeBLEFound success, data: ${data}.');
}, },
fail(data, code) { fail(data, code) {
console.log('Failed to call bluetooth.startBLEScan, data: ${data}, code: ${code}.'); console.log('call bluetooth.startBLEScan failed, code:' + code + ', data:' + data);
} }
}); });
``` ```
...@@ -135,8 +131,6 @@ Subscribes to the newly detected BLE device. If this API is called multiple time ...@@ -135,8 +131,6 @@ Subscribes to the newly detected BLE device. If this API is called multiple time
Unsubscribes from the newly detected devices. Unsubscribes from the newly detected devices.
**Required permissions**: ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION
**System capability**: SystemCapability.Communication.Bluetooth.Lite **System capability**: SystemCapability.Communication.Bluetooth.Lite
**Example** **Example**
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 3. 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 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>- The APIs provided by this module are deprecated since API version 9. You are advised to use [cryptoFramework-Cipher](js-apis-cryptoFramework.md#Cipher).
## Modules to Import ## Modules to Import
...@@ -18,9 +18,10 @@ Defines the response to the cipher interface called. ...@@ -18,9 +18,10 @@ Defines the response to the cipher interface called.
**System capability**: SystemCapability.Security.Cipher **System capability**: SystemCapability.Security.Cipher
| Name| Type | Mandatory| Description | | Name| Type | Readable| Writable|Description |
| ------ | ------ | ---- | ------------ | | ------ | ------ | ---- | ---- | ------------ |
| text | string | Yes | Response content.| | text | string | Yes | No | Response content.|
## CipherRsaOptions ## CipherRsaOptions
...@@ -88,10 +89,10 @@ export default { ...@@ -88,10 +89,10 @@ export default {
'+Enz0RzmVFh/4yk6lmqRzuEFQqhQqSZzaLq6sq2N2G0Sv2Xl3sLvqAfe2HNm2oBw\n' + '+Enz0RzmVFh/4yk6lmqRzuEFQqhQqSZzaLq6sq2N2G0Sv2Xl3sLvqAfe2HNm2oBw\n' +
'jBpApTJ3TeneOo6Z5QIDAQAB', 'jBpApTJ3TeneOo6Z5QIDAQAB',
success: function(data) { success: function(data) {
console.log(`Handling successful:${data.text}`); console.log(`handling success:${data.text}`);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log(`### cipher.rsa encryption failed ### ${code}:${data}`); console.log(`### cipher.rsa encrypt fail ### ${code}:${data}`);
}, },
complete: function() { complete: function() {
console.log(`operation complete!`); console.log(`operation complete!`);
...@@ -121,10 +122,10 @@ export default { ...@@ -121,10 +122,10 @@ export default {
'M9TORIgdH8MjIbWsGnndAkEAw9yURDaorE8IYPLF2IEn09g1uzvWPs3phDb6smVx\n' + 'M9TORIgdH8MjIbWsGnndAkEAw9yURDaorE8IYPLF2IEn09g1uzvWPs3phDb6smVx\n' +
'8GfqIdUNf+aCG5TZK/kXBF1sqcsi7jXMAf4jBlejVbSVZg==', '8GfqIdUNf+aCG5TZK/kXBF1sqcsi7jXMAf4jBlejVbSVZg==',
success: function(data) { success: function(data) {
console.log(`Handling successful:${data.text}`); console.log(`handling success:${data.text}`);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log(`### cipher.rsa encryption failed ### ${code}:${data}`); console.log(`### cipher.rsa encrypt fail ### ${code}:${data}`);
}, },
complete: function() { complete: function() {
console.log(`operation complete!`); console.log(`operation complete!`);
...@@ -165,10 +166,10 @@ export default { ...@@ -165,10 +166,10 @@ export default {
ivOffset: '0', ivOffset: '0',
ivLen: '16', ivLen: '16',
success: function(data) { success: function(data) {
console.log(`Handling successful:${data.text}`); console.log(`handling success:${data.text}`);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log(`### cipher.rsa encryption failed ### ${code}:${data}`); console.log(`### cipher.rsa encrypt fail ### ${code}:${data}`);
}, },
complete: function() { complete: function() {
console.log(`operation complete!`); console.log(`operation complete!`);
...@@ -185,10 +186,10 @@ export default { ...@@ -185,10 +186,10 @@ export default {
ivOffset: '0', ivOffset: '0',
ivLen: '16', ivLen: '16',
success: function(data) { success: function(data) {
console.log(`Handling successful:${data.text}`); console.log(`handling success:${data.text}`);
}, },
fail: function(data, code) { fail: function(data, code) {
console.log(`### cipher.aes encryption failed ### ${code}:${data}`); console.log(`### cipher.aes encrypt fail ### ${code}:${data}`);
}, },
complete: function() { complete: function() {
console.log(`operation complete!`); console.log(`operation complete!`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册