# è“牙æœåŠ¡å系统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æ‰èƒ½ä½¿ç”¨è“牙æœåŠ¡çš„æŽ¥å£ï¼š ```ts import bluetoothManager from '@ohos.bluetoothManager'; ``` **å˜æ›´å½±å“** 对API9以åŠSystemAPI接å£çš„使用有影å“,需è¦import @ohos.bluetoothManageræ¥ä½¿ç”¨æŠ›é”™è¯¯ç 的接å£ï¼š ```ts import bluetoothManager from '@ohos.bluetoothManager'; ``` **关键的接å£/ç»„ä»¶å˜æ›´** | ç±»å | æ—§æŽ¥å£ | æ–°æŽ¥å£ | å˜æ›´ç±»åž‹ | | -- | -- | -- | -- | | bluetooth | function getState(): BluetoothState | function getState(): BluetoothState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | method | function getBtConnectionState(): ProfileConnectionState; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function pairDevice(deviceId: string): boolean | function pairDevice(deviceId: string): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function cancelPairedDevice(deviceId: string): boolean | function cancelPairedDevice(deviceId: string): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function getRemoteDeviceName(deviceId: string): string | function getRemoteDeviceName(deviceId: string): string| API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass | function getRemoteDeviceClass(deviceId: string): DeviceClass | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function enableBluetooth(): boolean | function enableBluetooth(): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function disableBluetooth(): boolean | function disableBluetooth(): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function getLocalName(): string | function getLocalName(): string | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function getPairedDevices(): Array<string>; | function getPairedDevices(): Array<string>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState | function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£å修改为getProfileConnectionState | | bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean | function setDevicePairingConfirmation(device: string, accept: boolean): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function setLocalName(name: string): boolean; | function setLocalName(name: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean | function setBluetoothScanMode(mode: ScanMode, duration: number): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function getBluetoothScanMode(): ScanMod | function getBluetoothScanMode(): ScanMode | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function startBluetoothDiscovery(): boolean | function startBluetoothDiscovery(): void | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.tsï¼Œæ–°åŠ æƒé™ohos.permission.APPROXIMATELY_LOCATION,接å£è¿”回值改为void | | bluetooth | function stopBluetoothDiscovery(): boolean; | function stopBluetoothDiscovery(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function on(type: "bondStateChange", callback: Callback<BondStateParam>): void; | function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@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; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@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; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function sppCloseServerSocket(socket: number): void; | function sppCloseServerSocket(socket: number): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function sppCloseClientSocket(socket: number): void; | function sppCloseClientSocket(socket: number): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | function sppWrite(clientSocket: number, data: ArrayBuffer): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | 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。 | | 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 | | bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£å修改为getProfileInstance | | bluetooth | function getProfileInst(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£å修改为getProfileInstance | | BaseProfile | getConnectionDevices(): Array<string>; | getConnectionDevices(): Array<string>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | BaseProfile | getDeviceState(device: string): ProfileConnectionState; | getDeviceState(device: string): ProfileConnectionState; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | A2dpSourceProfile | connect(device: string): boolean; | connect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | A2dpSourceProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | A2dpSourceProfile | getPlayingState(device: string): PlayingState; | getPlayingState(device: string): PlayingState; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | HandsFreeAudioGatewayProfile | connect(device: string): boolean; | connect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts ,接å£è¿”回值改为void | | HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | HidHostProfile | connect(device: string): boolean; | connect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | HidHostProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | HidHostProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | HidHostProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | PanProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | PanProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | PanProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | PanProfile | setTethering(enable: boolean): void; | setTethering(enable: boolean): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | PanProfile | isTetheringOn(): boolean; | isTetheringOn(): boolean; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | BLE | function createGattServer(): GattServer; | function createGattServer(): GattServer; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | function createGattClientDevice(deviceId: string): GattClientDevice; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | BLE | function getConnectedBLEDevices(): Array<string>; | function getConnectedBLEDevices(): Array<string>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | 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 | | BLE | function stopBLEScan(): void; | function stopBLEScan(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | 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 | | BLE | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | stopAdvertising(): void; | stopAdvertising(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | addService(service: GattService): boolean; | addService(service: GattService): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattServer | removeService(serviceUuid: string): boolean; | removeService(serviceUuid: string): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattServer | close(): void; | close(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattServer | sendResponse(serverResponse: ServerResponse): boolean; | sendResponse(serverResponse: ServerResponse): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattServer | on(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void; | on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | off(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void; | off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void; | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void; | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | on(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void; | on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | off(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void; | off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | on(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void; | on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;| API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void; | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;| API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattServer | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | connect(): boolean; | connect(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | disconnect(): boolean; | disconnect(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | close(): boolean; | close(): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | getDeviceName(callback: AsyncCallback<string>): void; | getDeviceName(callback: AsyncCallback<string>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | getDeviceName(): Promise<string>; | getDeviceName(): Promise<string>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | getServices(callback: AsyncCallback<Array<GattService>>): void; | getServices(callback: AsyncCallback<Array<GattService>>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | getServices(): Promise<Array<GattService>>; | getServices(): Promise<Array<GattService>>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | writeCharacteristicValue(characteristic: BLECharacteristic): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | writeDescriptorValue(descriptor: BLEDescriptor): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | getRssiValue(callback: AsyncCallback<number>): void; | getRssiValue(callback: AsyncCallback<number>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | getRssiValue(): Promise<number>; | getRssiValue(): Promise<number>; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | setBLEMtuSize(mtu: number): boolean; | setBLEMtuSize(mtu: number): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts,接å£è¿”回值改为void | | GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | GattService | GattService | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BLECharacteristic | BLECharacteristic | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BLEDescriptor | BLEDescriptor | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | NotifyCharacteristic | NotifyCharacteristic | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | CharacteristicReadReq | CharacteristicReadRequest | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | CharacteristicWriteReq | CharacteristicWriteRequest | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | DescriptorReadRe | DescriptorReadRequest | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | DescriptorWriteReq | DescriptorWriteRequest | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ServerResponse | ServerResponse | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BLEConnectChangedState | BLEConnectChangedState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ScanResult | ScanResult | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | AdvertiseSetting | AdvertiseSetting | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | AdvertiseData | AdvertiseData | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ManufactureData | ManufactureData | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ServiceData | ServiceData | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ScanFilter | ScanFilter | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ScanOptions | ScanOptions | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | SppOption | SppOption | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | PinRequiredParam | PinRequiredParam | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | DeviceClass | DeviceClass | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BondStateParam | BondStateParam | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | StateChangeParam | StateChangeParam | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ScanDuty | ScanDuty | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | MatchMode | MatchMode | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ProfileConnectionState | ProfileConnectionState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BluetoothState | BluetoothState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | SppType | SppType | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ScanMode | ScanMode | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | BondState | BondState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | MajorClass | MajorClass | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | MajorMinorClass | MajorMinorClass | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | PlayingState | PlayingState | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | | bluetooth | ProfileId | ProfileId | API9接å£å˜æ›´ï¼Œè¿ç§»åˆ°@ohos.bluetoothManager.d.ts | **适酿Œ‡å¯¼ï¼ˆå¯é€‰ï¼Œä¸æ¶‰åŠåˆ™å¯ä»¥åˆ 除)** 以enableLocation为例,在新版本上需è¦ä½¿ç”¨å¦‚下方å¼è¿›è¡Œè°ƒç”¨ï¼š ```ts import bluetoothManager from '@ohos.bluetoothManager'; try { var state = bluetoothManager.getState(); } catch (err) { console.error("errCode:" + err.code + ",errMessage:" + err.message); } ```