openharmony 鸿蒙 changelogs-bluetooth

2023-02-03 浏览 (671)

蓝牙服务子系统ChangeLog

cl.bluetooth.1 接口迁移到新增的@ohos.bluetoothManager.d.ts

@ohos.bluetooth.d.ts接口不支持抛出错误码,而API9以及SystemAPI都需要支持错误码抛出,为了支持该功能,把@ohos.bluetooth.d.ts中所有接口,迁移到新增的@ohos.bluetoothManager.d.ts中,并增加错误码描述。

后续需要import @ohos.bluetoothManager才能使用蓝牙服务的接口:

import bluetoothManager from '@ohos.bluetoothManager';

变更影响

对API9以及SystemAPI接口的使用有影响,需要import @ohos.bluetoothManager来使用抛错误码的接口:

import bluetoothManager from '@ohos.bluetoothManager';

关键的接口/组件变更

类名旧接口新接口变更类型
bluetoothfunction getState(): BluetoothStatefunction getState(): BluetoothStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothmethodfunction getBtConnectionState(): ProfileConnectionState;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction pairDevice(deviceId: string): booleanfunction pairDevice(deviceId: string): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction cancelPairedDevice(deviceId: string): booleanfunction cancelPairedDevice(deviceId: string): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction getRemoteDeviceName(deviceId: string): stringfunction getRemoteDeviceName(deviceId: string): stringAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction getRemoteDeviceClass(deviceId: string): DeviceClassfunction getRemoteDeviceClass(deviceId: string): DeviceClassAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction enableBluetooth(): booleanfunction enableBluetooth(): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction disableBluetooth(): booleanfunction disableBluetooth(): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction getLocalName(): stringfunction getLocalName(): stringAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction getPairedDevices(): Array<string>;function getPairedDevices(): Array<string>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction getProfileConnState(profileId: ProfileId): ProfileConnectionStatefunction getProfileConnectionState(profileId: ProfileId): ProfileConnectionStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileConnectionState
bluetoothfunction setDevicePairingConfirmation(device: string, accept: boolean): booleanfunction setDevicePairingConfirmation(device: string, accept: boolean): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction setLocalName(name: string): boolean;function setLocalName(name: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction setBluetoothScanMode(mode: ScanMode, duration: number): booleanfunction setBluetoothScanMode(mode: ScanMode, duration: number): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction getBluetoothScanMode(): ScanModfunction getBluetoothScanMode(): ScanModeAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction startBluetoothDiscovery(): booleanfunction startBluetoothDiscovery(): voidAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION,接口返回值改为void
bluetoothfunction stopBluetoothDiscovery(): boolean;function stopBluetoothDiscovery(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void;function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void;function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction on(type: "bondStateChange", callback: Callback<BondStateParam>): void;function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction off(type: "bondStateChange", callback?: Callback<BondStateParam>): void;function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction on(type: "pinRequired", callback: Callback<PinRequiredParam>): void;function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void;function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction on(type: "stateChange", callback: Callback<BluetoothState>): void;function on(type: "stateChange", callback: Callback<BluetoothState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction off(type: "stateChange", callback?: Callback<BluetoothState>): void;function off(type: "stateChange", callback?: Callback<BluetoothState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void;function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppAccept(serverSocket: number, callback: AsyncCallback<number>): void;function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void;function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppCloseServerSocket(socket: number): void;function sppCloseServerSocket(socket: number): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppCloseClientSocket(socket: number): void;function sppCloseClientSocket(socket: number): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothfunction sppWrite(clientSocket: number, data: ArrayBuffer): boolean;function sppWrite(clientSocket: number, data: ArrayBuffer): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
bluetoothfunction on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void;function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts。
bluetoothfunction off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void;function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void;API9接口变更,迁移到@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>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BaseProfilegetDeviceState(device: string): ProfileConnectionState;getDeviceState(device: string): ProfileConnectionState;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
A2dpSourceProfileconnect(device: string): boolean;connect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
A2dpSourceProfiledisconnect(device: string): boolean;disconnect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
A2dpSourceProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
A2dpSourceProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
A2dpSourceProfilegetPlayingState(device: string): PlayingState;getPlayingState(device: string): PlayingState;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
HandsFreeAudioGatewayProfileconnect(device: string): boolean;connect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
HandsFreeAudioGatewayProfiledisconnect(device: string): boolean;disconnect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts ,接口返回值改为void
HandsFreeAudioGatewayProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
HandsFreeAudioGatewayProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
HidHostProfileconnect(device: string): boolean;connect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
HidHostProfiledisconnect(device: string): boolean;disconnect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
HidHostProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
HidHostProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
PanProfiledisconnect(device: string): boolean;disconnect(device: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
PanProfileon(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
PanProfileoff(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
PanProfilesetTethering(enable: boolean): void;setTethering(enable: boolean): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
PanProfileisTetheringOn(): boolean;isTetheringOn(): boolean;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEfunction createGattServer(): GattServer;function createGattServer(): GattServer;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEfunction createGattClientDevice(deviceId: string): GattClientDevice;function createGattClientDevice(deviceId: string): GattClientDevice;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEfunction getConnectedBLEDevices(): Array<string>;function getConnectedBLEDevices(): Array<string>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEfunction startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void;function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION
BLEfunction stopBLEScan(): void;function stopBLEScan(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEmefunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;thodfunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
BLEfunction off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void;function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServerstartAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void;startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServerstopAdvertising(): void;stopAdvertising(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeraddService(service: GattService): boolean;addService(service: GattService): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattServerremoveService(serviceUuid: string): boolean;removeService(serviceUuid: string): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattServerclose(): void;close(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServernotifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean;notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattServersendResponse(serverResponse: ServerResponse): boolean;sendResponse(serverResponse: ServerResponse): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattServeron(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void;on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeroff(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void;off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeron(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void;on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeroff(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void;off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeron(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void;on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeroff(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void;off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeron(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void;on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeroff(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void;off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeron(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattServeroff(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void;off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDeviceconnect(): boolean;connect(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDevicedisconnect(): boolean;disconnect(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDeviceclose(): boolean;close(): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDevicegetDeviceName(callback: AsyncCallback<string>): void;getDeviceName(callback: AsyncCallback<string>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicegetDeviceName(): Promise<string>;getDeviceName(): Promise<string>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicegetServices(callback: AsyncCallback<Array<GattService>>): void;getServices(callback: AsyncCallback<Array<GattService>>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicegetServices(): Promise<Array<GattService>>;getServices(): Promise<Array<GattService>>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicereadCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void;readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicereadCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>;readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicereadDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void;readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicereadDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>;readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicewriteCharacteristicValue(characteristic: BLECharacteristic): boolean;writeCharacteristicValue(characteristic: BLECharacteristic): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDevicewriteDescriptorValue(descriptor: BLEDescriptor): boolean;writeDescriptorValue(descriptor: BLEDescriptor): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDevicegetRssiValue(callback: AsyncCallback<number>): void;getRssiValue(callback: AsyncCallback<number>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicegetRssiValue(): Promise<number>;getRssiValue(): Promise<number>;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDevicesetBLEMtuSize(mtu: number): boolean;setBLEMtuSize(mtu: number): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDevicesetNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean;setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void
GattClientDeviceon(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void;on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDeviceoff(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void;off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDeviceon(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void;on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
GattClientDeviceoff(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void;off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void;API9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothGattServiceGattServiceAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBLECharacteristicBLECharacteristicAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBLEDescriptorBLEDescriptorAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothNotifyCharacteristicNotifyCharacteristicAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothCharacteristicReadReqCharacteristicReadRequestAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothCharacteristicWriteReqCharacteristicWriteRequestAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothDescriptorReadReDescriptorReadRequestAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothDescriptorWriteReqDescriptorWriteRequestAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothServerResponseServerResponseAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBLEConnectChangedStateBLEConnectChangedStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothScanResultScanResultAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothAdvertiseSettingAdvertiseSettingAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothAdvertiseDataAdvertiseDataAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothManufactureDataManufactureDataAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothServiceDataServiceDataAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothScanFilterScanFilterAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothScanOptionsScanOptionsAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothSppOptionSppOptionAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothPinRequiredParamPinRequiredParamAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothDeviceClassDeviceClassAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBondStateParamBondStateParamAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothStateChangeParamStateChangeParamAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothScanDutyScanDutyAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothMatchModeMatchModeAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothProfileConnectionStateProfileConnectionStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBluetoothStateBluetoothStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothSppTypeSppTypeAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothScanModeScanModeAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothBondStateBondStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothMajorClassMajorClassAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothMajorMinorClassMajorMinorClassAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothPlayingStatePlayingStateAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts
bluetoothProfileIdProfileIdAPI9接口变更,迁移到@ohos.bluetoothManager.d.ts

适配指导(可选,不涉及则可以删除)

以enableLocation为例,在新版本上需要使用如下方式进行调用:

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

你可能感兴趣的鸿蒙文章

harmony 鸿蒙web子系统ChangeLog

harmony 鸿蒙元能力子系统ChangeLog

harmony 鸿蒙分布式数据管理子系统JS API变更Changelog

harmony 鸿蒙文件管理子系统ChangeLog

harmony 鸿蒙全球化子系统ChangeLog

harmony 鸿蒙媒体子系统ChangeLog

harmony 鸿蒙测试子系统ChangeLog

harmony 鸿蒙USB服务子系统ChangeLog

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