diff --git a/zh-cn/application-dev/reference/apis/js-apis-bluetoothManager.md b/zh-cn/application-dev/reference/apis/js-apis-bluetoothManager.md index 673a90540c0f1e82f1787f2a566d132192b480e5..fb54017d2ad0394fe5ae52160f9044d69fa4799f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bluetoothManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bluetoothManager.md @@ -893,7 +893,7 @@ try { on(type: "stateChange", callback: Callback<BluetoothState>): void -订阅蓝牙连接状态改变事件。 +订阅蓝牙设备开关状态事件。 **需要权限**:ohos.permission.USE_BLUETOOTH @@ -932,7 +932,7 @@ try { off(type: "stateChange", callback?: Callback<BluetoothState>): void -取消订阅蓝牙连接状态改变事件。 +取消订阅蓝牙设备开关状态事件。 **需要权限**:ohos.permission.USE_BLUETOOTH @@ -2075,7 +2075,7 @@ connect(device: string): void ```js try { - let hidHostProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; + let hidHostProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; hidHostProfile.connect('XX:XX:XX:XX:XX:XX'); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message); @@ -2116,7 +2116,7 @@ disconnect(device: string): void ```js try { - let hidHostProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; + let hidHostProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; hidHostProfile.disconnect('XX:XX:XX:XX:XX:XX'); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message); @@ -2145,7 +2145,7 @@ on(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Stat function onReceiveEvent(data) { console.info('hidHost state = '+ JSON.stringify(data)); } -let hidHost = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; +let hidHost = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; hidHost.on('connectionStateChange', onReceiveEvent); ``` @@ -2171,7 +2171,7 @@ off(type: "connectionStateChange", callback?: Callback<[StateChangeParam](#St function onReceiveEvent(data) { console.info('hidHost state = '+ JSON.stringify(data)); } -let hidHost = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; +let hidHost = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_HID_HOST) as bluetoothManager.HidHostProfile; hidHost.on('connectionStateChange', onReceiveEvent); hidHost.off('connectionStateChange', onReceiveEvent); ``` @@ -2215,7 +2215,7 @@ disconnect(device: string): void ```js try { - let panProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; + let panProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; panProfile.disconnect('XX:XX:XX:XX:XX:XX'); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message); @@ -2244,7 +2244,7 @@ on(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Stat function onReceiveEvent(data) { console.info('pan state = '+ JSON.stringify(data)); } -let panProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; +let panProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; panProfile.on('connectionStateChange', onReceiveEvent); ``` @@ -2270,7 +2270,7 @@ off(type: "connectionStateChange", callback?: Callback<[StateChangeParam](#St function onReceiveEvent(data) { console.info('pan state = '+ JSON.stringify(data)); } -let panProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; +let panProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; panProfile.on('connectionStateChange', onReceiveEvent); panProfile.off('connectionStateChange', onReceiveEvent); ``` @@ -2309,7 +2309,7 @@ setTethering(enable: boolean): void ```js try { - let panProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; + let panProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; panProfile.setTethering(true); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message); @@ -2337,7 +2337,7 @@ isTetheringOn(): boolean ```js try { - let panProfile = bluetoothManager.getProfileInst(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; + let panProfile = bluetoothManager.getProfileInstance(bluetoothManager.ProfileId.PROFILE_PAN_NETWORK) as bluetoothManager.PanProfile; let ret = panProfile.isTetheringOn(); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message);