harmony 鸿蒙Bluetooth Subsystem ChangeLog

  • 2023-02-17
  • 浏览 (616)

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

Class Original API New API Change Type
bluetooth function getState(): BluetoothState function getState(): BluetoothState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth method function getBtConnectionState(): ProfileConnectionState; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function pairDevice(deviceId: string): boolean function pairDevice(deviceId: string): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function cancelPairedDevice(deviceId: string): boolean function cancelPairedDevice(deviceId: string): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function getRemoteDeviceName(deviceId: string): string function getRemoteDeviceName(deviceId: string): string Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function getRemoteDeviceClass(deviceId: string): DeviceClass function getRemoteDeviceClass(deviceId: string): DeviceClass Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function enableBluetooth(): boolean function enableBluetooth(): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function disableBluetooth(): boolean function disableBluetooth(): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function getLocalName(): string function getLocalName(): string Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function getPairedDevices(): Array<string>; function getPairedDevices(): Array<string>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function getProfileConnState(profileId: ProfileId): ProfileConnectionState function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the API name to getProfileConnectionState.
bluetooth function setDevicePairingConfirmation(device: string, accept: boolean): boolean function setDevicePairingConfirmation(device: string, accept: boolean): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function 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.
bluetooth function setBluetoothScanMode(mode: ScanMode, duration: number): boolean function setBluetoothScanMode(mode: ScanMode, duration: number): void Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function getBluetoothScanMode(): ScanMod function getBluetoothScanMode(): ScanMode Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function startBluetoothDiscovery(): boolean function startBluetoothDiscovery(): void Migrated 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.
bluetooth function stopBluetoothDiscovery(): boolean; function stopBluetoothDiscovery(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function sppCloseServerSocket(socket: number): void; function sppCloseServerSocket(socket: number): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function sppCloseClientSocket(socket: number): void; function sppCloseClientSocket(socket: number): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth function 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.
bluetooth function 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.
bluetooth function 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.
bluetooth function getProfile(profileId: ProfileId): A2dpSourceProfile HandsFreeAudioGatewayProfile; function getProfileInstance(profileId: ProfileId): A2dpSourceProfile
bluetooth function getProfileInst(profileId: ProfileId): A2dpSourceProfile HandsFreeAudioGatewayProfile HidHostProfile
BaseProfile getConnectionDevices(): Array<string>; getConnectionDevices(): Array<string>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BaseProfile getDeviceState(device: string): ProfileConnectionState; getDeviceState(device: string): ProfileConnectionState; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
A2dpSourceProfile connect(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.
A2dpSourceProfile disconnect(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.
A2dpSourceProfile on(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.
A2dpSourceProfile off(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.
A2dpSourceProfile getPlayingState(device: string): PlayingState; getPlayingState(device: string): PlayingState; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
HandsFreeAudioGatewayProfile connect(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.
HandsFreeAudioGatewayProfile disconnect(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.
HandsFreeAudioGatewayProfile on(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.
HandsFreeAudioGatewayProfile off(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.
HidHostProfile connect(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.
HidHostProfile disconnect(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.
HidHostProfile on(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.
HidHostProfile off(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.
PanProfile disconnect(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.
PanProfile on(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.
PanProfile off(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.
PanProfile setTethering(enable: boolean): void; setTethering(enable: boolean): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
PanProfile isTetheringOn(): boolean; isTetheringOn(): boolean; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE function createGattServer(): GattServer; function createGattServer(): GattServer; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE function createGattClientDevice(deviceId: string): GattClientDevice; function createGattClientDevice(deviceId: string): GattClientDevice; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE function getConnectedBLEDevices(): Array<string>; function getConnectedBLEDevices(): Array<string>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE function 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.
BLE function stopBLEScan(): void; function stopBLEScan(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE mefunction on(type: “BLEDeviceFind”, callback: Callback<Array<ScanResult>>): void;thod function on(type: “BLEDeviceFind”, callback: Callback<Array<ScanResult>>): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
BLE function 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.
GattServer startAdvertising(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.
GattServer stopAdvertising(): void; stopAdvertising(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServer addService(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.
GattServer removeService(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.
GattServer close(): void; close(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattServer notifyCharacteristicChanged(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.
GattServer sendResponse(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.
GattServer on(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.
GattServer off(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.
GattServer on(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.
GattServer off(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.
GattServer on(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.
GattServer off(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.
GattServer on(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.
GattServer off(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.
GattServer on(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.
GattServer off(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.
GattClientDevice connect(): boolean; connect(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevice disconnect(): boolean; disconnect(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevice close(): boolean; close(): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts and changed the return value to void.
GattClientDevice getDeviceName(callback: AsyncCallback<string>): void; getDeviceName(callback: AsyncCallback<string>): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice getDeviceName(): Promise<string>; getDeviceName(): Promise<string>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice getServices(callback: AsyncCallback<Array<GattService>>): void; getServices(callback: AsyncCallback<Array<GattService>>): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice getServices(): Promise<Array<GattService>>; getServices(): Promise<Array<GattService>>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice readCharacteristicValue(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.
GattClientDevice readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice readDescriptorValue(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.
GattClientDevice readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice writeCharacteristicValue(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.
GattClientDevice writeDescriptorValue(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.
GattClientDevice getRssiValue(callback: AsyncCallback<number>): void; getRssiValue(callback: AsyncCallback<number>): void; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice getRssiValue(): Promise<number>; getRssiValue(): Promise<number>; Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
GattClientDevice setBLEMtuSize(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.
GattClientDevice setNotifyCharacteristicChanged(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.
GattClientDevice on(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.
GattClientDevice off(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.
GattClientDevice on(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.
GattClientDevice off(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.
bluetooth GattService GattService Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BLECharacteristic BLECharacteristic Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BLEDescriptor BLEDescriptor Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth NotifyCharacteristic NotifyCharacteristic Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth CharacteristicReadReq CharacteristicReadRequest Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth CharacteristicWriteReq CharacteristicWriteRequest Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth DescriptorReadRe DescriptorReadRequest Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth DescriptorWriteReq DescriptorWriteRequest Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ServerResponse ServerResponse Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BLEConnectChangedState BLEConnectChangedState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ScanResult ScanResult Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth AdvertiseSetting AdvertiseSetting Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth AdvertiseData AdvertiseData Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ManufactureData ManufactureData Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ServiceData ServiceData Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ScanFilter ScanFilter Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ScanOptions ScanOptions Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth SppOption SppOption Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth PinRequiredParam PinRequiredParam Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth DeviceClass DeviceClass Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BondStateParam BondStateParam Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth StateChangeParam StateChangeParam Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ScanDuty ScanDuty Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth MatchMode MatchMode Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ProfileConnectionState ProfileConnectionState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BluetoothState BluetoothState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth SppType SppType Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ScanMode ScanMode Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth BondState BondState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth MajorClass MajorClass Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth MajorMinorClass MajorMinorClass Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth PlayingState PlayingState Migrated this API in API version 9 to @ohos.bluetoothManager.d.ts.
bluetooth ProfileId ProfileId Migrated 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

0  赞