From bdfdd6d630da3ddc118fc020d61d0bda30ee1382 Mon Sep 17 00:00:00 2001 From: wangyanhandsome Date: Mon, 20 Jun 2022 14:51:39 +0800 Subject: [PATCH] add avrcp & pan profile interface Signed-off-by: wangyanhandsome --- api/@ohos.bluetooth.d.ts | 61 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/api/@ohos.bluetooth.d.ts b/api/@ohos.bluetooth.d.ts index 0184aaa1d6..54bdf747c1 100644 --- a/api/@ohos.bluetooth.d.ts +++ b/api/@ohos.bluetooth.d.ts @@ -363,7 +363,7 @@ declare namespace bluetooth { * @return Returns instance of profile. * @since 9 */ - function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile; + function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; /** * Base interface of profile. @@ -538,6 +538,60 @@ declare namespace bluetooth { off(type: "connectionStateChange", callback?: Callback): void; } + /** + * Manager pan profile. + */ + interface PanProfile extends BaseProfile { + /** + * Disconnect to device with pan. + * + * @param device The address of the remote device to disconnect. + * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. + * @since 9 + * @permission permission ohos.permission.USE_BLUETOOTH + * @systemapi Hide this for inner system use. + */ + disconnect(device: string): boolean; + + /** + * Subscribe the event reported when the profile connection state changes . + * + * @param type Type of the profile connection state changes event to listen for . + * @param callback Callback used to listen for event. + * @since 9 + */ + on(type: "connectionStateChange", callback: Callback): void; + + /** + * Unsubscribe the event reported when the profile connection state changes. + * + * @param type Type of the profile connection state changes event to listen for. + * @param callback Callback used to listen for event. + * @since 9 + */ + off(type: "connectionStateChange", callback?: Callback): void; + + /** + * Enable bluetooth tethering. + * + * @param enable Specifies whether to enable tethering. The value {@code true} indicates + * that tethering is enabled, and the value {@code false} indicates that tethering is disabled. + * @since 9 + * @permission permission ohos.permission.DISCOVER_BLUETOOTH + * @systemapi Hide this for inner system use. + */ + setTethering(enable: boolean): void; + + /** + * Obtains the tethering enable or disable. + * + * @return Returns the value {@code true} is tethering is on, returns {@code false} otherwise. + * @since 9 + * @systemapi Hide this for inner system use. + */ + isTetheringOn(): boolean; + } + namespace BLE { /** * create a JavaScript Gatt server instance. @@ -1607,6 +1661,11 @@ declare namespace bluetooth { * @since 9 */ PROFILE_HID_HOST = 6, + + /** + * @since 9 + */ + PROFILE_PAN_NETWORK = 7, } } -- Gitee