1# 蓝牙服务子系统ChangeLog 2 3## cl.bluetooth.1 接口迁移到新增的@ohos.bluetoothManager.d.ts 4 5@ohos.bluetooth.d.ts接口不支持抛出错误码,而API9以及SystemAPI都需要支持错误码抛出,为了支持该功能,把@ohos.bluetooth.d.ts中所有接口,迁移到新增的@ohos.bluetoothManager.d.ts中,并增加错误码描述。 6 7后续需要import @ohos.bluetoothManager才能使用蓝牙服务的接口: 8 9 ```ts 10 import bluetoothManager from '@ohos.bluetoothManager'; 11 ``` 12 13 14**变更影响** 15 16对API9以及SystemAPI接口的使用有影响,需要import @ohos.bluetoothManager来使用抛错误码的接口: 17 18 ```ts 19 import bluetoothManager from '@ohos.bluetoothManager'; 20 ``` 21 22**关键的接口/组件变更** 23 24| 类名 | 旧接口 | 新接口 | 变更类型 | 25| -- | -- | -- | -- | 26| bluetooth | function getState(): BluetoothState | function getState(): BluetoothState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 27| bluetooth | method | function getBtConnectionState(): ProfileConnectionState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 28| bluetooth | function pairDevice(deviceId: string): boolean | function pairDevice(deviceId: string): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 29| bluetooth | function cancelPairedDevice(deviceId: string): boolean | function cancelPairedDevice(deviceId: string): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 30| bluetooth | function getRemoteDeviceName(deviceId: string): string | function getRemoteDeviceName(deviceId: string): string| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 31| bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass | function getRemoteDeviceClass(deviceId: string): DeviceClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 32| bluetooth | function enableBluetooth(): boolean | function enableBluetooth(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 33| bluetooth | function disableBluetooth(): boolean | function disableBluetooth(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 34| bluetooth | function getLocalName(): string | function getLocalName(): string | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 35| bluetooth | function getPairedDevices(): Array<string>; | function getPairedDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 36| bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState | function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileConnectionState | 37| bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean | function setDevicePairingConfirmation(device: string, accept: boolean): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 38| bluetooth | function setLocalName(name: string): boolean; | function setLocalName(name: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 39| bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean | function setBluetoothScanMode(mode: ScanMode, duration: number): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 40| bluetooth | function getBluetoothScanMode(): ScanMod | function getBluetoothScanMode(): ScanMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 41| bluetooth | function startBluetoothDiscovery(): boolean | function startBluetoothDiscovery(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION,接口返回值改为void | 42| bluetooth | function stopBluetoothDiscovery(): boolean; | function stopBluetoothDiscovery(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 43| bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 44| bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 45| bluetooth | function on(type: "bondStateChange", callback: Callback<BondStateParam>): void; | function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 46| bluetooth | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 47| bluetooth | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 48| bluetooth | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 49| bluetooth | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 50| bluetooth | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 51| bluetooth | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 52| bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 53| bluetooth | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 54| bluetooth | function sppCloseServerSocket(socket: number): void; | function sppCloseServerSocket(socket: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 55| bluetooth | function sppCloseClientSocket(socket: number): void; | function sppCloseClientSocket(socket: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 56| bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | function sppWrite(clientSocket: number, data: ArrayBuffer): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 57| bluetooth | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts。 | 58| bluetooth | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 59| bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileInstance | 60| bluetooth | function getProfileInst(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileInstance | 61| BaseProfile | getConnectionDevices(): Array<string>; | getConnectionDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 62| BaseProfile | getDeviceState(device: string): ProfileConnectionState; | getDeviceState(device: string): ProfileConnectionState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 63| A2dpSourceProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 64| A2dpSourceProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 65| A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 66| A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 67| A2dpSourceProfile | getPlayingState(device: string): PlayingState; | getPlayingState(device: string): PlayingState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 68| HandsFreeAudioGatewayProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 69| HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts ,接口返回值改为void | 70| HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 71| HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 72| HidHostProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 73| HidHostProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 74| HidHostProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 75| HidHostProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 76| PanProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 77| PanProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 78| PanProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 79| PanProfile | setTethering(enable: boolean): void; | setTethering(enable: boolean): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 80| PanProfile | isTetheringOn(): boolean; | isTetheringOn(): boolean; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 81| BLE | function createGattServer(): GattServer; | function createGattServer(): GattServer; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 82| BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | function createGattClientDevice(deviceId: string): GattClientDevice; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 83| BLE | function getConnectedBLEDevices(): Array<string>; | function getConnectedBLEDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 84| BLE | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION | 85| BLE | function stopBLEScan(): void; | function stopBLEScan(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 86| BLE | mefunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;thod | function on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 87| BLE | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 88| GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 89| GattServer | stopAdvertising(): void; | stopAdvertising(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 90| GattServer | addService(service: GattService): boolean; | addService(service: GattService): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 91| GattServer | removeService(serviceUuid: string): boolean; | removeService(serviceUuid: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 92| GattServer | close(): void; | close(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts 93| GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 94| GattServer | sendResponse(serverResponse: ServerResponse): boolean; | sendResponse(serverResponse: ServerResponse): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 95| GattServer | on(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void; | on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 96| GattServer | off(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void; | off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 97| GattServer | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void; | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 98| GattServer | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void; | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 99| GattServer | on(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void; | on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 100| GattServer | off(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void; | off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 101| GattServer | on(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void; | on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 102| GattServer | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void; | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 103| GattServer | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 104| GattServer | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 105| GattClientDevice | connect(): boolean; | connect(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 106| GattClientDevice | disconnect(): boolean; | disconnect(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 107| GattClientDevice | close(): boolean; | close(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 108| GattClientDevice | getDeviceName(callback: AsyncCallback<string>): void; | getDeviceName(callback: AsyncCallback<string>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 109| GattClientDevice | getDeviceName(): Promise<string>; | getDeviceName(): Promise<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 110| GattClientDevice | getServices(callback: AsyncCallback<Array<GattService>>): void; | getServices(callback: AsyncCallback<Array<GattService>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 111| GattClientDevice | getServices(): Promise<Array<GattService>>; | getServices(): Promise<Array<GattService>>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 112| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 113| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 114| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 115| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 116| GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | writeCharacteristicValue(characteristic: BLECharacteristic): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 117| GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | writeDescriptorValue(descriptor: BLEDescriptor): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 118| GattClientDevice | getRssiValue(callback: AsyncCallback<number>): void; | getRssiValue(callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 119| GattClientDevice | getRssiValue(): Promise<number>; | getRssiValue(): Promise<number>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 120| GattClientDevice | setBLEMtuSize(mtu: number): boolean; | setBLEMtuSize(mtu: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 121| GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | 122| GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 123| GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 124| GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 125| GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 126| bluetooth | GattService | GattService | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 127| bluetooth | BLECharacteristic | BLECharacteristic | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 128| bluetooth | BLEDescriptor | BLEDescriptor | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 129| bluetooth | NotifyCharacteristic | NotifyCharacteristic | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 130| bluetooth | CharacteristicReadReq | CharacteristicReadRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 131| bluetooth | CharacteristicWriteReq | CharacteristicWriteRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 132| bluetooth | DescriptorReadRe | DescriptorReadRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 133| bluetooth | DescriptorWriteReq | DescriptorWriteRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 134| bluetooth | ServerResponse | ServerResponse | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 135| bluetooth | BLEConnectChangedState | BLEConnectChangedState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 136| bluetooth | ScanResult | ScanResult | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 137| bluetooth | AdvertiseSetting | AdvertiseSetting | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 138| bluetooth | AdvertiseData | AdvertiseData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 139| bluetooth | ManufactureData | ManufactureData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 140| bluetooth | ServiceData | ServiceData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 141| bluetooth | ScanFilter | ScanFilter | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 142| bluetooth | ScanOptions | ScanOptions | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 143| bluetooth | SppOption | SppOption | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 144| bluetooth | PinRequiredParam | PinRequiredParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 145| bluetooth | DeviceClass | DeviceClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 146| bluetooth | BondStateParam | BondStateParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 147| bluetooth | StateChangeParam | StateChangeParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 148| bluetooth | ScanDuty | ScanDuty | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 149| bluetooth | MatchMode | MatchMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 150| bluetooth | ProfileConnectionState | ProfileConnectionState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 151| bluetooth | BluetoothState | BluetoothState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 152| bluetooth | SppType | SppType | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 153| bluetooth | ScanMode | ScanMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 154| bluetooth | BondState | BondState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 155| bluetooth | MajorClass | MajorClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 156| bluetooth | MajorMinorClass | MajorMinorClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 157| bluetooth | PlayingState | PlayingState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 158| bluetooth | ProfileId | ProfileId | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | 159 160 161 162**适配指导(可选,不涉及则可以删除)** 163 164以enableLocation为例,在新版本上需要使用如下方式进行调用: 165 166 ```ts 167 import bluetoothManager from '@ohos.bluetoothManager'; 168 try { 169 var state = bluetoothManager.getState(); 170 } catch (err) { 171 console.error("errCode:" + err.code + ",errMessage:" + err.message); 172 } 173 ``` 174