openharmony 鸿蒙 changelogs-bluetooth

2023-02-17 浏览 (751)

Bluetooth Subsystem ChangeLog

cl.bluetooth.1 API Migration to @ohos.bluetoothManager.d.ts

@ohos.bluetooth.d.ts does not allow for throwing error codes, which is required by API version 9 and system APIs. Therefore, all APIs of @ohos.bluetooth.d.ts are migrated to the newly added @ohos.bluetoothManager.d.ts, and error code description is also added.

To use Bluetooth APIs, import @ohos.bluetoothManager.

import bluetoothManager from '@ohos.bluetoothManager';

Change Impacts

System APIs and APIs in API version 9 are affected. Import @ohos.bluetoothManager to use APIs that can throw error codes.

import bluetoothManager from '@ohos.bluetoothManager';

Key API/Component Changes

ClassOriginal APINew APIChange Type
bluetoothfunction getState(): BluetoothStatefunction getState(): BluetoothStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothmethodfunction getBtConnectionState(): ProfileConnectionState;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction pairDevice(deviceId: string): booleanfunction pairDevice(deviceId: string): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction cancelPairedDevice(deviceId: string): booleanfunction cancelPairedDevice(deviceId: string): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction getRemoteDeviceName(deviceId: string): stringfunction getRemoteDeviceName(deviceId: string): stringMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction getRemoteDeviceClass(deviceId: string): DeviceClassfunction getRemoteDeviceClass(deviceId: string): DeviceClassMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction enableBluetooth(): booleanfunction enableBluetooth(): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction disableBluetooth(): booleanfunction disableBluetooth(): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction getLocalName(): stringfunction getLocalName(): stringMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction getPairedDevices(): Array<string>;function getPairedDevices(): Array<string>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction getProfileConnState(profileId: ProfileId): ProfileConnectionStatefunction getProfileConnectionState(profileId: ProfileId): ProfileConnectionStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the API name to getProfileConnectionState.
bluetoothfunction setDevicePairingConfirmation(device: string, accept: boolean): booleanfunction setDevicePairingConfirmation(device: string, accept: boolean): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction setLocalName(name: string): boolean;function setLocalName(name: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction setBluetoothScanMode(mode: ScanMode, duration: number): booleanfunction setBluetoothScanMode(mode: ScanMode, duration: number): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction getBluetoothScanMode(): ScanModfunction getBluetoothScanMode(): ScanModeMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction startBluetoothDiscovery(): booleanfunction startBluetoothDiscovery(): voidMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts, added the ohos.permission.APPROXIMATELY_LOCATION permission, and changed the return value to void.
bluetoothfunction stopBluetoothDiscovery(): boolean;function stopBluetoothDiscovery(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void;function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void;function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction on(type: "bondStateChange", callback: Callback<BondStateParam>): void;function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction off(type: "bondStateChange", callback?: Callback<BondStateParam>): void;function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction on(type: "pinRequired", callback: Callback<PinRequiredParam>): void;function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void;function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction on(type: "stateChange", callback: Callback<BluetoothState>): void;function on(type: "stateChange", callback: Callback<BluetoothState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction off(type: "stateChange", callback?: Callback<BluetoothState>): void;function off(type: "stateChange", callback?: Callback<BluetoothState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void;function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppAccept(serverSocket: number, callback: AsyncCallback<number>): void;function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void;function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppCloseServerSocket(socket: number): void;function sppCloseServerSocket(socket: number): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppCloseClientSocket(socket: number): void;function sppCloseClientSocket(socket: number): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction sppWrite(clientSocket: number, data: ArrayBuffer): boolean;function sppWrite(clientSocket: number, data: ArrayBuffer): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetoothfunction on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void;function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void;function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothfunction getProfile(profileId: ProfileId): A2dpSourceProfileHandsFreeAudioGatewayProfile;function getProfileInstance(profileId: ProfileId): A2dpSourceProfile
bluetoothfunction getProfileInst(profileId: ProfileId): A2dpSourceProfileHandsFreeAudioGatewayProfileHidHostProfile
BaseProfilegetConnectionDevices(): Array<string>;getConnectionDevices(): Array<string>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BaseProfilegetDeviceState(device: string): ProfileConnectionState;getDeviceState(device: string): ProfileConnectionState;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
A2dpSourceProfileconnect(device: string): boolean;connect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
A2dpSourceProfiledisconnect(device: string): boolean;disconnect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
A2dpSourceProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
A2dpSourceProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
A2dpSourceProfilegetPlayingState(device: string): PlayingState;getPlayingState(device: string): PlayingState;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
HandsFreeAudioGatewayProfileconnect(device: string): boolean;connect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
HandsFreeAudioGatewayProfiledisconnect(device: string): boolean;disconnect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
HandsFreeAudioGatewayProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
HandsFreeAudioGatewayProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
HidHostProfileconnect(device: string): boolean;connect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
HidHostProfiledisconnect(device: string): boolean;disconnect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
HidHostProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
HidHostProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
PanProfiledisconnect(device: string): boolean;disconnect(device: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
PanProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
PanProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
PanProfilesetTethering(enable: boolean): void;setTethering(enable: boolean): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
PanProfileisTetheringOn(): boolean;isTetheringOn(): boolean;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEfunction createGattServer(): GattServer;function createGattServer(): GattServer;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEfunction createGattClientDevice(deviceId: string): GattClientDevice;function createGattClientDevice(deviceId: string): GattClientDevice;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEfunction getConnectedBLEDevices(): Array<string>;function getConnectedBLEDevices(): Array<string>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEfunction startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void;function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and added the ohos.permission.APPROXIMATELY_LOCATION permission.
BLEfunction stopBLEScan(): void;function stopBLEScan(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEmefunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;thodfunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLEfunction off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void;function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServerstartAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void;startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServerstopAdvertising(): void;stopAdvertising(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeraddService(service: GattService): boolean;addService(service: GattService): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattServerremoveService(serviceUuid: string): boolean;removeService(serviceUuid: string): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattServerclose(): void;close(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServernotifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean;notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattServersendResponse(serverResponse: ServerResponse): boolean;sendResponse(serverResponse: ServerResponse): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattServeron(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void;on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeroff(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void;off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeron(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void;on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeroff(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void;off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeron(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void;on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeroff(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void;off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeron(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void;on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeroff(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void;off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeron(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServeroff(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void;off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDeviceconnect(): boolean;connect(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevicedisconnect(): boolean;disconnect(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDeviceclose(): boolean;close(): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevicegetDeviceName(callback: AsyncCallback<string>): void;getDeviceName(callback: AsyncCallback<string>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicegetDeviceName(): Promise<string>;getDeviceName(): Promise<string>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicegetServices(callback: AsyncCallback<Array<GattService>>): void;getServices(callback: AsyncCallback<Array<GattService>>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicegetServices(): Promise<Array<GattService>>;getServices(): Promise<Array<GattService>>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicereadCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void;readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicereadCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>;readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicereadDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void;readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicereadDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>;readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicewriteCharacteristicValue(characteristic: BLECharacteristic): boolean;writeCharacteristicValue(characteristic: BLECharacteristic): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevicewriteDescriptorValue(descriptor: BLEDescriptor): boolean;writeDescriptorValue(descriptor: BLEDescriptor): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevicegetRssiValue(callback: AsyncCallback<number>): void;getRssiValue(callback: AsyncCallback<number>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicegetRssiValue(): Promise<number>;getRssiValue(): Promise<number>;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevicesetBLEMtuSize(mtu: number): boolean;setBLEMtuSize(mtu: number): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevicesetNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean;setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDeviceon(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void;on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDeviceoff(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void;off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDeviceon(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void;on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDeviceoff(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void;off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void;Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothGattServiceGattServiceMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBLECharacteristicBLECharacteristicMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBLEDescriptorBLEDescriptorMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothNotifyCharacteristicNotifyCharacteristicMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothCharacteristicReadReqCharacteristicReadRequestMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothCharacteristicWriteReqCharacteristicWriteRequestMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothDescriptorReadReDescriptorReadRequestMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothDescriptorWriteReqDescriptorWriteRequestMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothServerResponseServerResponseMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBLEConnectChangedStateBLEConnectChangedStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothScanResultScanResultMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothAdvertiseSettingAdvertiseSettingMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothAdvertiseDataAdvertiseDataMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothManufactureDataManufactureDataMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothServiceDataServiceDataMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothScanFilterScanFilterMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothScanOptionsScanOptionsMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothSppOptionSppOptionMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothPinRequiredParamPinRequiredParamMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothDeviceClassDeviceClassMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBondStateParamBondStateParamMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothStateChangeParamStateChangeParamMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothScanDutyScanDutyMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothMatchModeMatchModeMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothProfileConnectionStateProfileConnectionStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBluetoothStateBluetoothStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothSppTypeSppTypeMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothScanModeScanModeMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothBondStateBondStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothMajorClassMajorClassMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothMajorMinorClassMajorMinorClassMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothPlayingStatePlayingStateMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetoothProfileIdProfileIdMigrated this API in API version 9 to @ohos.bluetoothManager.d.ts.

(Optional) Adaptation Guide

The following uses enableLocation as an example to show how it is called in the new version:

import bluetoothManager from '@ohos.bluetoothManager';
try {
    var state = bluetoothManager.getState();
} catch (err) {
    console.error("errCode:" + err.code + ",errMessage:" + err.message);
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Web Subsystem ChangeLog

harmony 鸿蒙Ability Subsystem ChangeLog

harmony 鸿蒙Distributed Data Management Subsystem JS API Changelog

harmony 鸿蒙File Management Subsystem ChangeLog

harmony 鸿蒙Globalization Subsystem ChangeLog

harmony 鸿蒙Media Subsystem ChangeLog

harmony 鸿蒙Test Subsystem ChangeLog

harmony 鸿蒙USB Subsystem API Changelog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/3a4721838c58401f89d02722473d6baf