harmony 鸿蒙@ohos.bluetooth (Bluetooth) (System API)
@ohos.bluetooth (Bluetooth) (System API)
The Bluetooth module provides classic Bluetooth capabilities and Bluetooth Low Energy (BLE) scan and advertising.
NOTE The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. The APIs provided by this module are no longer maintained since API version 9. You are advised to use profile APIs of @ohos.bluetooth.ble. This topic describes only the system APIs provided by the module. For details about its public APIs, see @ohos.bluetooth (Bluetooth).
Modules to Import
import bluetooth from '@ohos.bluetooth';
bluetooth.cancelPairedDevice8+(deprecated)
cancelPairedDevice(deviceId: string): boolean
Cancels a paired remote device.
NOTE
This API is supported since API version 8 and deprecated since API version 9. Use bluetoothManager.cancelPairedDevice instead.
System API: This is a system API.
Required permissions: ohos.permission.DISCOVER_BLUETOOTH
System capability: SystemCapability.Communication.Bluetooth.Core
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
deviceId | string | Yes | Address of the remote device to cancel, for example, XX:XX:XX:XX:XX:XX. |
Return value
Type | Description |
---|---|
boolean | Returns true if the operation is successful; returns false otherwise. |
Example
let result : boolean = bluetooth.cancelPairedDevice("XX:XX:XX:XX:XX:XX");
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Connectivity Kit (Short-Range Communication Service)
harmony 鸿蒙Bluetooth Error Codes
harmony 鸿蒙SecureElement Error Codes
harmony 鸿蒙@ohos.bluetooth.a2dp (Bluetooth A2DP Module) (System API)
harmony 鸿蒙@ohos.bluetooth.a2dp (Bluetooth A2DP Module)
harmony 鸿蒙@ohos.bluetooth.access (Bluetooth Access Module) (System API)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦