1/* 2 * Copyright (C) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import type { AsyncCallback, Callback } from './@ohos.base'; 17 18/** 19 * Provides methods to operate or manage Bluetooth. 20 * 21 * @namespace bluetooth 22 * @syscap SystemCapability.Communication.Bluetooth.Core 23 * @since 7 24 * @deprecated since 9 25 * @useinstead ohos.bluetoothManager 26 */ 27declare namespace bluetooth { 28 /** 29 * Obtains the Bluetooth status of a device. 30 * 31 * @permission ohos.permission.USE_BLUETOOTH 32 * @returns { BluetoothState } Returns the Bluetooth status, which can be {@link BluetoothState#STATE_OFF}, 33 * {@link BluetoothState#STATE_TURNING_ON}, {@link BluetoothState#STATE_ON}, {@link BluetoothState#STATE_TURNING_OFF}, 34 * {@link BluetoothState#STATE_BLE_TURNING_ON}, {@link BluetoothState#STATE_BLE_ON}, 35 * or {@link BluetoothState#STATE_BLE_TURNING_OFF}. 36 * @syscap SystemCapability.Communication.Bluetooth.Core 37 * @since 7 38 * @deprecated since 9 39 * @useinstead ohos.bluetoothManager/bluetoothManager.getState 40 */ 41 function getState(): BluetoothState; 42 43 /** 44 * Get the local device connection state to any profile of any remote device. 45 * 46 * @permission ohos.permission.USE_BLUETOOTH 47 * @returns { ProfileConnectionState } One of {@link ProfileConnectionState#STATE_DISCONNECTED}, 48 * {@link ProfileConnectionState#STATE_CONNECTING}, {@link ProfileConnectionState#STATE_CONNECTED}, 49 * {@link ProfileConnectionState#STATE_DISCONNECTING}. 50 * @syscap SystemCapability.Communication.Bluetooth.Core 51 * @since 7 52 * @deprecated since 9 53 * @useinstead ohos.bluetoothManager/bluetoothManager.getBtConnectionState 54 */ 55 function getBtConnectionState(): ProfileConnectionState; 56 57 /** 58 * Starts pairing with a remote Bluetooth device. 59 * 60 * @permission ohos.permission.DISCOVER_BLUETOOTH 61 * @param { string } deviceId - The address of the remote device to pair. 62 * @returns { boolean } Returns {@code true} if the pairing process is started; returns {@code false} otherwise. 63 * @syscap SystemCapability.Communication.Bluetooth.Core 64 * @since 7 65 * @deprecated since 9 66 * @useinstead ohos.bluetoothManager/bluetoothManager.pairDevice 67 */ 68 function pairDevice(deviceId: string): boolean; 69 70 /** 71 * Remove a paired remote device. 72 * 73 * @permission ohos.permission.DISCOVER_BLUETOOTH 74 * @param { string } deviceId - The address of the remote device to be removed. 75 * @returns { boolean } Returns {@code true} if the cancel process is started; returns {@code false} otherwise. 76 * @syscap SystemCapability.Communication.Bluetooth.Core 77 * @systemapi Hide this for inner system use 78 * @since 8 79 * @deprecated since 9 80 * @useinstead ohos.bluetoothManager/bluetoothManager.cancelPairedDevice 81 */ 82 function cancelPairedDevice(deviceId: string): boolean; 83 84 /** 85 * Obtains the name of a peer Bluetooth device. 86 * 87 * @permission ohos.permission.USE_BLUETOOTH 88 * @param { string } deviceId - The address of the remote device. 89 * @returns { string } Returns the device name in character string format. 90 * @syscap SystemCapability.Communication.Bluetooth.Core 91 * @since 8 92 * @deprecated since 9 93 * @useinstead ohos.bluetoothManager/bluetoothManager.getRemoteDeviceName 94 */ 95 function getRemoteDeviceName(deviceId: string): string; 96 97 /** 98 * Obtains the class of a peer Bluetooth device. 99 * 100 * @permission ohos.permission.USE_BLUETOOTH 101 * @param { string } deviceId - The address of the remote device. 102 * @returns { DeviceClass } The class of the remote device, {@link DeviceClass}. 103 * @syscap SystemCapability.Communication.Bluetooth.Core 104 * @since 8 105 * @deprecated since 9 106 * @useinstead ohos.bluetoothManager/bluetoothManager.getRemoteDeviceClass 107 */ 108 function getRemoteDeviceClass(deviceId: string): DeviceClass; 109 110 /** 111 * Enables Bluetooth on a device. 112 * 113 * @permission ohos.permission.DISCOVER_BLUETOOTH 114 * @returns { boolean } Returns {@code true} if Bluetooth is being enabled; returns {@code false} if an error occurs. 115 * @syscap SystemCapability.Communication.Bluetooth.Core 116 * @since 8 117 * @deprecated since 9 118 * @useinstead ohos.bluetoothManager/bluetoothManager.enableBluetooth 119 */ 120 function enableBluetooth(): boolean; 121 122 /** 123 * Disables Bluetooth on a device. 124 * 125 * @permission ohos.permission.DISCOVER_BLUETOOTH 126 * @returns { boolean } Returns {@code true} if Bluetooth is being disabled; returns {@code false} if an error occurs. 127 * @syscap SystemCapability.Communication.Bluetooth.Core 128 * @since 8 129 * @deprecated since 9 130 * @useinstead ohos.bluetoothManager/bluetoothManager.disableBluetooth 131 */ 132 function disableBluetooth(): boolean; 133 134 /** 135 * Obtains the Bluetooth local name of a device. 136 * 137 * @permission ohos.permission.USE_BLUETOOTH 138 * @returns { string } Returns the name the device. 139 * @syscap SystemCapability.Communication.Bluetooth.Core 140 * @since 8 141 * @deprecated since 9 142 * @useinstead ohos.bluetoothManager/bluetoothManager.getLocalName 143 */ 144 function getLocalName(): string; 145 146 /** 147 * Obtains the list of Bluetooth devices that have been paired with the current device. 148 * 149 * @permission ohos.permission.USE_BLUETOOTH 150 * @returns { Array<string> } Returns a list of paired Bluetooth devices's address. 151 * @syscap SystemCapability.Communication.Bluetooth.Core 152 * @since 8 153 * @deprecated since 9 154 * @useinstead ohos.bluetoothManager/bluetoothManager.getPairedDevices 155 */ 156 function getPairedDevices(): Array<string>; 157 158 /** 159 * Obtains the connection state of profile. 160 * 161 * @permission ohos.permission.USE_BLUETOOTH 162 * @param { ProfileId } profileId - The profile id. 163 * @returns { ProfileConnectionState } Returns the connection state. 164 * @syscap SystemCapability.Communication.Bluetooth.Core 165 * @since 8 166 * @deprecated since 9 167 * @useinstead ohos.bluetoothManager/bluetoothManager.getProfileConnectionState 168 */ 169 function getProfileConnState(profileId: ProfileId): ProfileConnectionState; 170 171 /** 172 * Sets the confirmation of pairing with a certain device. 173 * 174 * @permission ohos.permission.MANAGE_BLUETOOTH 175 * @param { string } device - The address of the remote device. 176 * @param { boolean } accept - Indicates whether to accept the pairing request, {@code true} indicates accept or {@code false} otherwise. 177 * @returns { boolean } Returns {@code true} if the pairing confirmation is set; returns {@code false} otherwise. 178 * @syscap SystemCapability.Communication.Bluetooth.Core 179 * @since 8 180 * @deprecated since 9 181 * @useinstead ohos.bluetoothManager/bluetoothManager.setDevicePairingConfirmation 182 */ 183 function setDevicePairingConfirmation(device: string, accept: boolean): boolean; 184 185 /** 186 * Sets the Bluetooth friendly name of a device. 187 * 188 * @permission ohos.permission.DISCOVER_BLUETOOTH 189 * @param { string } name - Indicates a valid Bluetooth name. 190 * @returns { boolean } Returns {@code true} if the Bluetooth name is set successfully; returns {@code false} otherwise. 191 * @syscap SystemCapability.Communication.Bluetooth.Core 192 * @since 8 193 * @deprecated since 9 194 * @useinstead ohos.bluetoothManager/bluetoothManager.setLocalName 195 */ 196 function setLocalName(name: string): boolean; 197 198 /** 199 * Sets the Bluetooth scan mode for a device. 200 * 201 * @permission ohos.permission.USE_BLUETOOTH 202 * @param { ScanMode } mode - Indicates the Bluetooth scan mode to set, {@link ScanMode}. 203 * @param { number } duration - Indicates the duration in seconds, in which the host is discoverable. 204 * @returns { boolean } Returns {@code true} if the Bluetooth scan mode is set; returns {@code false} otherwise. 205 * @syscap SystemCapability.Communication.Bluetooth.Core 206 * @since 8 207 * @deprecated since 9 208 * @useinstead ohos.bluetoothManager/bluetoothManager.setBluetoothScanMode 209 */ 210 function setBluetoothScanMode(mode: ScanMode, duration: number): boolean; 211 212 /** 213 * Obtains the Bluetooth scanning mode of a device. 214 * 215 * @permission ohos.permission.USE_BLUETOOTH 216 * @returns { ScanMode } Returns the Bluetooth scanning mode, {@link ScanMode}. 217 * @syscap SystemCapability.Communication.Bluetooth.Core 218 * @since 8 219 * @deprecated since 9 220 * @useinstead ohos.bluetoothManager/bluetoothManager.getBluetoothScanMode 221 */ 222 function getBluetoothScanMode(): ScanMode; 223 224 /** 225 * Starts scanning Bluetooth devices. 226 * 227 * @permission ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.LOCATION 228 * @returns { boolean } Returns {@code true} if the scan is started successfully; returns {@code false} otherwise. 229 * @syscap SystemCapability.Communication.Bluetooth.Core 230 * @since 8 231 * @deprecated since 9 232 * @useinstead ohos.bluetoothManager/bluetoothManager.startBluetoothDiscovery 233 */ 234 function startBluetoothDiscovery(): boolean; 235 236 /** 237 * Stops Bluetooth device scanning. 238 * 239 * @permission ohos.permission.DISCOVER_BLUETOOTH 240 * @returns { boolean } Returns {@code true} if scanning is stopped successfully; returns {@code false} otherwise. 241 * @syscap SystemCapability.Communication.Bluetooth.Core 242 * @since 8 243 * @deprecated since 9 244 * @useinstead ohos.bluetoothManager/bluetoothManager.stopBluetoothDiscovery 245 */ 246 function stopBluetoothDiscovery(): boolean; 247 248 /** 249 * Subscribe the event reported when a remote Bluetooth device is discovered. 250 * 251 * @permission ohos.permission.USE_BLUETOOTH 252 * @param { 'bluetoothDeviceFind' } type - Type of the discovering event to listen for. 253 * @param { Callback<Array<string>> } callback - Callback used to listen for the discovering event. 254 * @syscap SystemCapability.Communication.Bluetooth.Core 255 * @since 8 256 * @deprecated since 9 257 * @useinstead ohos.bluetoothManager/bluetoothManager.on#event:bluetoothDeviceFind 258 */ 259 function on(type: 'bluetoothDeviceFind', callback: Callback<Array<string>>): void; 260 261 /** 262 * Unsubscribe the event reported when a remote Bluetooth device is discovered. 263 * 264 * @permission ohos.permission.USE_BLUETOOTH 265 * @param { 'bluetoothDeviceFind' } type - Type of the discovering event to listen for. 266 * @param { Callback<Array<string>> } callback - Callback used to listen for the discovering event. 267 * @syscap SystemCapability.Communication.Bluetooth.Core 268 * @since 8 269 * @deprecated since 9 270 * @useinstead ohos.bluetoothManager/bluetoothManager.off#event:bluetoothDeviceFind 271 */ 272 function off(type: 'bluetoothDeviceFind', callback?: Callback<Array<string>>): void; 273 274 /** 275 * Subscribe the event reported when a remote Bluetooth device is bonded. 276 * 277 * @permission ohos.permission.USE_BLUETOOTH 278 * @param { 'bondStateChange' } type - Type of the bond state event to listen for. 279 * @param { Callback<BondStateParam> } callback - Callback used to listen for the bond state event, {@link BondStateParam}. 280 * @syscap SystemCapability.Communication.Bluetooth.Core 281 * @since 8 282 * @deprecated since 9 283 * @useinstead ohos.bluetoothManager/bluetoothManager.on#event:bondStateChange 284 */ 285 function on(type: 'bondStateChange', callback: Callback<BondStateParam>): void; 286 287 /** 288 * Unsubscribe the event reported when a remote Bluetooth device is bonded. 289 * 290 * @permission ohos.permission.USE_BLUETOOTH 291 * @param { 'bondStateChange' } type - Type of the bond state event to listen for. 292 * @param { Callback<BondStateParam> } callback - Callback used to listen for the bond state event. 293 * @syscap SystemCapability.Communication.Bluetooth.Core 294 * @since 8 295 * @deprecated since 9 296 * @useinstead ohos.bluetoothManager/bluetoothManager.off#event:bondStateChange 297 */ 298 function off(type: 'bondStateChange', callback?: Callback<BondStateParam>): void; 299 300 /** 301 * Subscribe the event of a pairing request from a remote Bluetooth device. 302 * 303 * @permission ohos.permission.DISCOVER_BLUETOOTH 304 * @param { 'pinRequired' } type - Type of the pairing request event to listen for. 305 * @param { Callback<PinRequiredParam> } callback - Callback used to listen for the pairing request event. 306 * @syscap SystemCapability.Communication.Bluetooth.Core 307 * @since 8 308 * @deprecated since 9 309 * @useinstead ohos.bluetoothManager/bluetoothManager.on#event:pinRequired 310 */ 311 function on(type: 'pinRequired', callback: Callback<PinRequiredParam>): void; 312 313 /** 314 * Unsubscribe the event of a pairing request from a remote Bluetooth device. 315 * 316 * @permission ohos.permission.DISCOVER_BLUETOOTH 317 * @param { 'pinRequired' } type - Type of the pairing request event to listen for. 318 * @param { Callback<PinRequiredParam> } callback - Callback used to listen for the pairing request event. 319 * @syscap SystemCapability.Communication.Bluetooth.Core 320 * @since 8 321 * @deprecated since 9 322 * @useinstead ohos.bluetoothManager/bluetoothManager.off#event:pinRequired 323 */ 324 function off(type: 'pinRequired', callback?: Callback<PinRequiredParam>): void; 325 326 /** 327 * Subscribe the event reported when the Bluetooth state changes. 328 * 329 * @permission ohos.permission.USE_BLUETOOTH 330 * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for. 331 * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event. 332 * @syscap SystemCapability.Communication.Bluetooth.Core 333 * @since 8 334 * @deprecated since 9 335 * @useinstead ohos.bluetoothManager/bluetoothManager.on#event:stateChange 336 */ 337 function on(type: 'stateChange', callback: Callback<BluetoothState>): void; 338 339 /** 340 * Unsubscribe the event reported when the Bluetooth state changes. 341 * 342 * @permission ohos.permission.USE_BLUETOOTH 343 * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for. 344 * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event. 345 * @syscap SystemCapability.Communication.Bluetooth.Core 346 * @since 8 347 * @deprecated since 9 348 * @useinstead ohos.bluetoothManager/bluetoothManager.off#event:stateChange 349 */ 350 function off(type: 'stateChange', callback?: Callback<BluetoothState>): void; 351 352 /** 353 * Creates a Bluetooth server listening socket. 354 * 355 * @permission ohos.permission.USE_BLUETOOTH 356 * @param { string } name - Indicates the service name. 357 * @param { SppOption } option - Indicates the listen parameters {@link SppOption}. 358 * @param { AsyncCallback<number> } callback - Callback used to return a server socket ID. 359 * @syscap SystemCapability.Communication.Bluetooth.Core 360 * @since 8 361 * @deprecated since 9 362 * @useinstead ohos.bluetoothManager/bluetoothManager.sppListen 363 */ 364 function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; 365 366 /** 367 * Waits for a remote device to connect. 368 * 369 * @param { number } serverSocket - Indicates the server socket ID, returned by {@link sppListen}. 370 * @param { AsyncCallback<number> } callback - Callback used to return a client socket ID. 371 * @syscap SystemCapability.Communication.Bluetooth.Core 372 * @since 8 373 * @deprecated since 9 374 * @useinstead ohos.bluetoothManager/bluetoothManager.sppAccept 375 */ 376 function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; 377 378 /** 379 * Connects to a remote device over the socket. 380 * 381 * @permission ohos.permission.USE_BLUETOOTH 382 * @param { string } device - The address of the remote device to connect. 383 * @param { SppOption } option - Indicates the connect parameters {@link SppOption}. 384 * @param { AsyncCallback<number> } callback - Callback used to return a client socket ID. 385 * @syscap SystemCapability.Communication.Bluetooth.Core 386 * @since 8 387 * @deprecated since 9 388 * @useinstead ohos.bluetoothManager/bluetoothManager.sppConnect 389 */ 390 function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; 391 392 /** 393 * Disables an spp server socket and releases related resources. 394 * 395 * @param { number } socket - Indicates the server socket ID, returned by {@link sppListen}. 396 * @syscap SystemCapability.Communication.Bluetooth.Core 397 * @since 8 398 * @deprecated since 9 399 * @useinstead ohos.bluetoothManager/bluetoothManager.sppCloseServerSocket 400 */ 401 function sppCloseServerSocket(socket: number): void; 402 403 /** 404 * Disables an spp client socket and releases related resources. 405 * 406 * @param { number } socket - Indicates the client socket ID, returned by {@link sppAccept} or {@link sppConnect}. 407 * @syscap SystemCapability.Communication.Bluetooth.Core 408 * @since 8 409 * @deprecated since 9 410 * @useinstead ohos.bluetoothManager/bluetoothManager.sppCloseClientSocket 411 */ 412 function sppCloseClientSocket(socket: number): void; 413 414 /** 415 * Write data through the socket. 416 * 417 * @param { number } clientSocket - Indicates the client socket ID, returned by {@link sppAccept} or {@link sppConnect}. 418 * @param { ArrayBuffer } data - Indicates the data to write. 419 * @returns { boolean } Returns {@code true} if the data is write successfully; returns {@code false} otherwise. 420 * @syscap SystemCapability.Communication.Bluetooth.Core 421 * @since 8 422 * @deprecated since 9 423 * @useinstead ohos.bluetoothManager/bluetoothManager.sppWrite 424 */ 425 function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; 426 427 /** 428 * Subscribe the event reported when data is read from the socket. 429 * 430 * @param { 'sppRead' } type - Type of the spp read event to listen for. 431 * @param { number } clientSocket - Client socket ID, which is obtained by sppAccept or sppConnect. 432 * @param { Callback<ArrayBuffer> } callback - Callback used to listen for the spp read event. 433 * @syscap SystemCapability.Communication.Bluetooth.Core 434 * @since 8 435 * @deprecated since 9 436 * @useinstead ohos.bluetoothManager/bluetoothManager.on#event:sppRead 437 */ 438 function on(type: 'sppRead', clientSocket: number, callback: Callback<ArrayBuffer>): void; 439 440 /** 441 * Unsubscribe the event reported when data is read from the socket. 442 * 443 * @param { 'sppRead' } type - Type of the spp read event to listen for. 444 * @param { number } clientSocket - Client socket ID, which is obtained by sppAccept or sppConnect. 445 * @param { Callback<ArrayBuffer> } callback - Callback used to listen for the spp read event. 446 * @syscap SystemCapability.Communication.Bluetooth.Core 447 * @since 8 448 * @deprecated since 9 449 * @useinstead ohos.bluetoothManager/bluetoothManager.off#event:sppRead 450 */ 451 function off(type: 'sppRead', clientSocket: number, callback?: Callback<ArrayBuffer>): void; 452 453 /** 454 * Obtains the instance of profile. 455 * 456 * @param { ProfileId } profileId - The profile id.. 457 * @returns { A2dpSourceProfile | HandsFreeAudioGatewayProfile } Returns instance of profile. 458 * @syscap SystemCapability.Communication.Bluetooth.Core 459 * @since 8 460 * @deprecated since 9 461 * @useinstead ohos.bluetoothManager/bluetoothManager.getProfileInstance 462 */ 463 function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; 464 465 /** 466 * Base interface of profile. 467 * 468 * @typedef BaseProfile 469 * @syscap SystemCapability.Communication.Bluetooth.Core 470 * @since 7 471 * @deprecated since 9 472 * @useinstead ohos.bluetoothManager/bluetoothManager.BaseProfile 473 */ 474 interface BaseProfile { 475 /** 476 * Obtains the connected devices list of profile. 477 * 478 * @permission ohos.permission.USE_BLUETOOTH 479 * @returns { Array<string> } Returns the address of connected devices list. 480 * @syscap SystemCapability.Communication.Bluetooth.Core 481 * @since 8 482 * @deprecated since 9 483 * @useinstead ohos.bluetoothManager/bluetoothManager.BaseProfile#getConnectionDevices 484 */ 485 getConnectionDevices(): Array<string>; 486 487 /** 488 * Obtains the profile state of device. 489 * 490 * @permission ohos.permission.USE_BLUETOOTH 491 * @param { string } device - The address of bluetooth device. 492 * @returns { ProfileConnectionState } Returns {@link ProfileConnectionState} of device. 493 * @syscap SystemCapability.Communication.Bluetooth.Core 494 * @since 8 495 * @deprecated since 9 496 * @useinstead ohos.bluetoothManager/bluetoothManager.BaseProfile#getDeviceState 497 */ 498 getDeviceState(device: string): ProfileConnectionState; 499 } 500 501 /** 502 * Manager a2dp source profile. 503 * 504 * @typedef A2dpSourceProfile 505 * @syscap SystemCapability.Communication.Bluetooth.Core 506 * @since 7 507 * @deprecated since 9 508 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile 509 */ 510 interface A2dpSourceProfile extends BaseProfile { 511 /** 512 * Connect to device with a2dp. 513 * 514 * @permission ohos.permission.DISCOVER_BLUETOOTH 515 * @param { string } device - The address of the remote device to connect. 516 * @returns { boolean } Returns {@code true} if the connect is in process; returns {@code false} otherwise. 517 * @syscap SystemCapability.Communication.Bluetooth.Core 518 * @since 8 519 * @deprecated since 9 520 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile#connect 521 */ 522 connect(device: string): boolean; 523 524 /** 525 * Disconnect to device with a2dp. 526 * 527 * @permission ohos.permission.DISCOVER_BLUETOOTH 528 * @param { string } device - The address of the remote device to disconnect. 529 * @returns { boolean } Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. 530 * @syscap SystemCapability.Communication.Bluetooth.Core 531 * @since 8 532 * @deprecated since 9 533 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile#disconnect 534 */ 535 disconnect(device: string): boolean; 536 537 /** 538 * Subscribe the event reported when the profile connection state changes . 539 * 540 * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for . 541 * @param { Callback<StateChangeParam> } callback - Callback used to listen for event. 542 * @syscap SystemCapability.Communication.Bluetooth.Core 543 * @since 8 544 * @deprecated since 9 545 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile.on#event:connectionStateChange 546 */ 547 on(type: 'connectionStateChange', callback: Callback<StateChangeParam>): void; 548 549 /** 550 * Unsubscribe the event reported when the profile connection state changes . 551 * 552 * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for . 553 * @param { Callback<StateChangeParam> } callback - Callback used to listen for event. 554 * @syscap SystemCapability.Communication.Bluetooth.Core 555 * @since 8 556 * @deprecated since 9 557 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile.off#event:connectionStateChange 558 */ 559 off(type: 'connectionStateChange', callback?: Callback<StateChangeParam>): void; 560 561 /** 562 * Obtains the playing state of device. 563 * 564 * @param { string } device - The address of the remote device. 565 * @returns { PlayingState } Returns {@link PlayingState} of the remote device. 566 * @syscap SystemCapability.Communication.Bluetooth.Core 567 * @since 8 568 * @deprecated since 9 569 * @useinstead ohos.bluetoothManager/bluetoothManager.A2dpSourceProfile#getPlayingState 570 */ 571 getPlayingState(device: string): PlayingState; 572 } 573 574 /** 575 * Manager handsfree AG profile. 576 * 577 * @typedef HandsFreeAudioGatewayProfile 578 * @syscap SystemCapability.Communication.Bluetooth.Core 579 * @since 7 580 * @deprecated since 9 581 * @useinstead ohos.bluetoothManager/bluetoothManager.HandsFreeAudioGatewayProfile 582 */ 583 interface HandsFreeAudioGatewayProfile extends BaseProfile { 584 /** 585 * Connect to device with hfp. 586 * 587 * @permission ohos.permission.DISCOVER_BLUETOOTH 588 * @param { string } device - The address of the remote device to connect. 589 * @returns { boolean } Returns {@code true} if the connect is in process; returns {@code false} otherwise. 590 * @syscap SystemCapability.Communication.Bluetooth.Core 591 * @since 8 592 * @deprecated since 9 593 * @useinstead ohos.bluetoothManager/bluetoothManager.HandsFreeAudioGatewayProfile#connect 594 */ 595 connect(device: string): boolean; 596 597 /** 598 * Disconnect to device with hfp. 599 * 600 * @permission ohos.permission.DISCOVER_BLUETOOTH 601 * @param { string } device - The address of the remote device to disconnect. 602 * @returns { boolean } Returns {@code true} if the disconnect is in process; returns {@code false} otherwise. 603 * @syscap SystemCapability.Communication.Bluetooth.Core 604 * @since 8 605 * @deprecated since 9 606 * @useinstead ohos.bluetoothManager/bluetoothManager.HandsFreeAudioGatewayProfile#disconnect 607 */ 608 disconnect(device: string): boolean; 609 610 /** 611 * Subscribe the event reported when the profile connection state changes . 612 * 613 * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for . 614 * @param { Callback<StateChangeParam> } callback - Callback used to listen for event. 615 * @syscap SystemCapability.Communication.Bluetooth.Core 616 * @since 8 617 * @deprecated since 9 618 * @useinstead ohos.bluetoothManager/bluetoothManager.HandsFreeAudioGatewayProfile.on#event:connectionStateChange 619 */ 620 on(type: 'connectionStateChange', callback: Callback<StateChangeParam>): void; 621 622 /** 623 * Unsubscribe the event reported when the profile connection state changes . 624 * 625 * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for . 626 * @param { Callback<StateChangeParam> } callback - Callback used to listen for event. 627 * @syscap SystemCapability.Communication.Bluetooth.Core 628 * @since 8 629 * @deprecated since 9 630 * @useinstead ohos.bluetoothManager/bluetoothManager.HandsFreeAudioGatewayProfile.off#event:connectionStateChange 631 */ 632 off(type: 'connectionStateChange', callback?: Callback<StateChangeParam>): void; 633 } 634 635 namespace BLE { 636 /** 637 * create a JavaScript Gatt server instance. 638 * 639 * @returns { GattServer } Returns a JavaScript Gatt server instance {@code GattServer}. 640 * @syscap SystemCapability.Communication.Bluetooth.Core 641 * @since 7 642 * @deprecated since 9 643 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.createGattServer 644 */ 645 function createGattServer(): GattServer; 646 647 /** 648 * create a JavaScript Gatt client device instance. 649 * 650 * @param { string } deviceId - The address of the remote device. 651 * @returns { GattClientDevice } Returns a JavaScript Gatt client device instance {@code GattClientDevice}. 652 * @syscap SystemCapability.Communication.Bluetooth.Core 653 * @since 7 654 * @deprecated since 9 655 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.createGattClientDevice 656 */ 657 function createGattClientDevice(deviceId: string): GattClientDevice; 658 659 /** 660 * Obtains the list of devices in the connected status. 661 * 662 * @permission ohos.permission.USE_BLUETOOTH 663 * @returns { Array<string> } Returns the list of device address. 664 * @syscap SystemCapability.Communication.Bluetooth.Core 665 * @since 7 666 * @deprecated since 9 667 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.getConnectedBLEDevices 668 */ 669 function getConnectedBLEDevices(): Array<string>; 670 671 /** 672 * Starts scanning for specified BLE devices with filters. 673 * 674 * @permission ohos.permission.DISCOVER_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH and ohos.permission.LOCATION 675 * @param { Array<ScanFilter> } filters - Indicates the list of filters used to filter out specified devices. 676 * If you do not want to use filter, set this parameter to {@code null}. 677 * @param { ScanOptions } options - Indicates the parameters for scanning and if the user does not assign a value, the default value will be used. 678 * {@link ScanOptions#interval} set to 0, {@link ScanOptions#dutyMode} set to {@link SCAN_MODE_LOW_POWER} 679 * and {@link ScanOptions#matchMode} set to {@link MATCH_MODE_AGGRESSIVE}. 680 * @syscap SystemCapability.Communication.Bluetooth.Core 681 * @since 7 682 * @deprecated since 9 683 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.startBLEScan 684 */ 685 function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; 686 687 /** 688 * Stops BLE scanning. 689 * 690 * @permission ohos.permission.DISCOVER_BLUETOOTH 691 * @syscap SystemCapability.Communication.Bluetooth.Core 692 * @since 7 693 * @deprecated since 9 694 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.stopBLEScan 695 */ 696 function stopBLEScan(): void; 697 698 /** 699 * Subscribe BLE scan result. 700 * 701 * @permission ohos.permission.USE_BLUETOOTH 702 * @param { 'BLEDeviceFind' } type - Type of the scan result event to listen for. 703 * @param { Callback<Array<ScanResult>> } callback - Callback used to listen for the scan result event. 704 * @syscap SystemCapability.Communication.Bluetooth.Core 705 * @since 7 706 * @deprecated since 9 707 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.on#event:BLEDeviceFind 708 */ 709 function on(type: 'BLEDeviceFind', callback: Callback<Array<ScanResult>>): void; 710 711 /** 712 * Unsubscribe BLE scan result. 713 * 714 * @permission ohos.permission.USE_BLUETOOTH 715 * @param { 'BLEDeviceFind' } type - Type of the scan result event to listen for. 716 * @param { Callback<Array<ScanResult>> } callback - Callback used to listen for the scan result event. 717 * @syscap SystemCapability.Communication.Bluetooth.Core 718 * @since 7 719 * @deprecated since 9 720 * @useinstead ohos.bluetoothManager/bluetoothManager.BLE.off#event:BLEDeviceFind 721 */ 722 function off(type: 'BLEDeviceFind', callback?: Callback<Array<ScanResult>>): void; 723 } 724 725 /** 726 * Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance. 727 * 728 * @typedef GattServer 729 * @syscap SystemCapability.Communication.Bluetooth.Core 730 * @since 7 731 * @deprecated since 9 732 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer 733 */ 734 interface GattServer { 735 /** 736 * Starts BLE advertising. 737 * 738 * @permission ohos.permission.DISCOVER_BLUETOOTH 739 * @param { AdvertiseSetting } setting - Indicates the settings for BLE advertising. 740 * If you need to use the default value, set this parameter to {@code null}. 741 * @param { AdvertiseData } advData - Indicates the advertising data. 742 * @param { AdvertiseData } advResponse - Indicates the scan response associated with the advertising data. 743 * @syscap SystemCapability.Communication.Bluetooth.Core 744 * @since 7 745 * @deprecated since 9 746 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#startAdvertising 747 */ 748 startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; 749 750 /** 751 * Stops BLE advertising. 752 * 753 * @permission ohos.permission.DISCOVER_BLUETOOTH 754 * @syscap SystemCapability.Communication.Bluetooth.Core 755 * @since 7 756 * @deprecated since 9 757 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#stopAdvertising 758 */ 759 stopAdvertising(): void; 760 761 /** 762 * Adds a specified service to be hosted. 763 * <p>The added service and its characteristics are provided by the local device. 764 * 765 * @permission ohos.permission.USE_BLUETOOTH 766 * @param { GattService } service - Indicates the service to add. 767 * @returns { boolean } Returns {@code true} if the service is added; returns {@code false} otherwise. 768 * @syscap SystemCapability.Communication.Bluetooth.Core 769 * @since 7 770 * @deprecated since 9 771 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#addService 772 */ 773 addService(service: GattService): boolean; 774 775 /** 776 * Removes a specified service from the list of GATT services provided by this device. 777 * 778 * @permission ohos.permission.USE_BLUETOOTH 779 * @param { string } serviceUuid - Indicates the UUID of the service to remove. 780 * @returns { boolean } Returns {@code true} if the service is removed; returns {@code false} otherwise. 781 * @syscap SystemCapability.Communication.Bluetooth.Core 782 * @since 7 783 * @deprecated since 9 784 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#removeService 785 */ 786 removeService(serviceUuid: string): boolean; 787 788 /** 789 * Closes this {@code GattServer} object and unregisters its callbacks. 790 * 791 * @permission ohos.permission.USE_BLUETOOTH 792 * @syscap SystemCapability.Communication.Bluetooth.Core 793 * @since 7 794 * @deprecated since 9 795 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#close 796 */ 797 close(): void; 798 799 /** 800 * Sends a notification of a change in a specified local characteristic. 801 * <p>This method should be called for every BLE peripheral device that has requested notifications. 802 * 803 * @permission ohos.permission.USE_BLUETOOTH 804 * @param { string } deviceId - Indicates the address of the BLE peripheral device to receive the notification. 805 * @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed. 806 * @returns { boolean } Returns {@code true} if the notification is sent successfully; returns {@code false} otherwise. 807 * @syscap SystemCapability.Communication.Bluetooth.Core 808 * @since 7 809 * @deprecated since 9 810 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#notifyCharacteristicChanged 811 */ 812 notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; 813 814 /** 815 * Sends a response to a specified read or write request to a given BLE peripheral device. 816 * 817 * @permission ohos.permission.USE_BLUETOOTH 818 * @param { ServerResponse } serverResponse - Indicates the response parameters {@link ServerResponse}. 819 * @returns { boolean } Returns {@code true} if the response is sent successfully; returns {@code false} otherwise. 820 * @syscap SystemCapability.Communication.Bluetooth.Core 821 * @since 7 822 * @deprecated since 9 823 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer#sendResponse 824 */ 825 sendResponse(serverResponse: ServerResponse): boolean; 826 827 /** 828 * Subscribe characteristic read event. 829 * 830 * @permission ohos.permission.USE_BLUETOOTH 831 * @param { 'characteristicRead' } type - Type of the characteristic read event to listen for. 832 * @param { Callback<CharacteristicReadReq> } callback - Callback used to listen for the characteristic read event. 833 * @syscap SystemCapability.Communication.Bluetooth.Core 834 * @since 7 835 * @deprecated since 9 836 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.on#event:characteristicRead 837 */ 838 on(type: 'characteristicRead', callback: Callback<CharacteristicReadReq>): void; 839 840 /** 841 * Unsubscribe characteristic read event. 842 * 843 * @permission ohos.permission.USE_BLUETOOTH 844 * @param { 'characteristicRead' } type - Type of the characteristic read event to listen for. 845 * @param { Callback<CharacteristicReadReq> } callback - Callback used to listen for the characteristic read event. 846 * @syscap SystemCapability.Communication.Bluetooth.Core 847 * @since 7 848 * @deprecated since 9 849 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.off#event:characteristicRead 850 */ 851 off(type: 'characteristicRead', callback?: Callback<CharacteristicReadReq>): void; 852 853 /** 854 * Subscribe characteristic write event. 855 * 856 * @permission ohos.permission.USE_BLUETOOTH 857 * @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for. 858 * @param { Callback<CharacteristicWriteReq> } callback - Callback used to listen for the characteristic write event. 859 * @syscap SystemCapability.Communication.Bluetooth.Core 860 * @since 7 861 * @deprecated since 9 862 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.on#event:characteristicWrite 863 */ 864 on(type: 'characteristicWrite', callback: Callback<CharacteristicWriteReq>): void; 865 866 /** 867 * Unsubscribe characteristic write event. 868 * 869 * @permission ohos.permission.USE_BLUETOOTH 870 * @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for. 871 * @param { Callback<CharacteristicWriteReq> } callback - Callback used to listen for the characteristic write event. 872 * @syscap SystemCapability.Communication.Bluetooth.Core 873 * @since 7 874 * @deprecated since 9 875 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.off#event:characteristicWrite 876 */ 877 off(type: 'characteristicWrite', callback?: Callback<CharacteristicWriteReq>): void; 878 879 /** 880 * Subscribe descriptor read event. 881 * 882 * @permission ohos.permission.USE_BLUETOOTH 883 * @param { 'descriptorRead' } type - Type of the descriptor read event to listen for. 884 * @param { Callback<DescriptorReadReq> } callback - Callback used to listen for the descriptor read event. 885 * @syscap SystemCapability.Communication.Bluetooth.Core 886 * @since 7 887 * @deprecated since 9 888 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.on#event:descriptorRead 889 */ 890 on(type: 'descriptorRead', callback: Callback<DescriptorReadReq>): void; 891 892 /** 893 * Unsubscribe descriptor read event. 894 * 895 * @permission ohos.permission.USE_BLUETOOTH 896 * @param { 'descriptorRead' } type - Type of the descriptor read event to listen for. 897 * @param { Callback<DescriptorReadReq> } callback - Callback used to listen for the descriptor read event. 898 * @syscap SystemCapability.Communication.Bluetooth.Core 899 * @since 7 900 * @deprecated since 9 901 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.off#event:descriptorRead 902 */ 903 off(type: 'descriptorRead', callback?: Callback<DescriptorReadReq>): void; 904 905 /** 906 * Subscribe descriptor write event. 907 * 908 * @permission ohos.permission.USE_BLUETOOTH 909 * @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for. 910 * @param { Callback<DescriptorWriteReq> } callback - Callback used to listen for the descriptor write event. 911 * @syscap SystemCapability.Communication.Bluetooth.Core 912 * @since 7 913 * @deprecated since 9 914 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.on#event:descriptorWrite 915 */ 916 on(type: 'descriptorWrite', callback: Callback<DescriptorWriteReq>): void; 917 918 /** 919 * Unsubscribe descriptor write event. 920 * 921 * @permission ohos.permission.USE_BLUETOOTH 922 * @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for. 923 * @param { Callback<DescriptorWriteReq> } callback - Callback used to listen for the descriptor write event. 924 * @syscap SystemCapability.Communication.Bluetooth.Core 925 * @since 7 926 * @deprecated since 9 927 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.off#event:descriptorWrite 928 */ 929 off(type: 'descriptorWrite', callback?: Callback<DescriptorWriteReq>): void; 930 931 /** 932 * Subscribe server connection state changed event. 933 * 934 * @permission ohos.permission.USE_BLUETOOTH 935 * @param { 'connectStateChange' } type - Type of the connection state changed event to listen for. 936 * @param { Callback<BLEConnectChangedState> } callback - Callback used to listen for the connection state changed event. 937 * @syscap SystemCapability.Communication.Bluetooth.Core 938 * @since 7 939 * @deprecated since 9 940 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.on#event:connectStateChange 941 */ 942 on(type: 'connectStateChange', callback: Callback<BLEConnectChangedState>): void; 943 944 /** 945 * Unsubscribe server connection state changed event. 946 * 947 * @permission ohos.permission.USE_BLUETOOTH 948 * @param { 'connectStateChange' } type - Type of the connection state changed event to listen for. 949 * @param { Callback<BLEConnectChangedState> } callback - Callback used to listen for the connection state changed event. 950 * @syscap SystemCapability.Communication.Bluetooth.Core 951 * @since 7 952 * @deprecated since 9 953 * @useinstead ohos.bluetoothManager/bluetoothManager.GattServer.off#event:connectStateChange 954 */ 955 off(type: 'connectStateChange', callback?: Callback<BLEConnectChangedState>): void; 956 } 957 958 /** 959 * Manages GATT client. Before calling an Gatt client method, you must use {@link createGattClientDevice} to create an GattClientDevice instance. 960 * 961 * @typedef GattClientDevice 962 * @syscap SystemCapability.Communication.Bluetooth.Core 963 * @since 7 964 * @deprecated since 9 965 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice 966 */ 967 interface GattClientDevice { 968 /** 969 * Connects to a BLE peripheral device. 970 * <p>The 'BLEConnectionStateChange' event is subscribed to return the connection state. 971 * 972 * @permission ohos.permission.USE_BLUETOOTH 973 * @returns { boolean } Returns {@code true} if the connection process starts; returns {@code false} otherwise. 974 * @syscap SystemCapability.Communication.Bluetooth.Core 975 * @since 7 976 * @deprecated since 9 977 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#connect 978 */ 979 connect(): boolean; 980 981 /** 982 * Disconnects from or stops an ongoing connection to a BLE peripheral device. 983 * 984 * @permission ohos.permission.USE_BLUETOOTH 985 * @returns { boolean } Returns {@code true} if the disconnection process starts; returns {@code false} otherwise. 986 * @syscap SystemCapability.Communication.Bluetooth.Core 987 * @since 7 988 * @deprecated since 9 989 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#disconnect 990 */ 991 disconnect(): boolean; 992 993 /** 994 * Disables a BLE peripheral device. 995 * <p> This method unregisters the device and clears the registered callbacks and handles. 996 * 997 * @permission ohos.permission.USE_BLUETOOTH 998 * @returns { boolean } Returns {@code true} if the the device is disabled; returns {@code false} otherwise. 999 * @syscap SystemCapability.Communication.Bluetooth.Core 1000 * @since 7 1001 * @deprecated since 9 1002 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#close 1003 */ 1004 close(): boolean; 1005 1006 /** 1007 * Obtains the name of BLE peripheral device. 1008 * 1009 * @permission ohos.permission.USE_BLUETOOTH 1010 * @param { AsyncCallback<string> } callback - Callback used to obtain the device name. 1011 * @syscap SystemCapability.Communication.Bluetooth.Core 1012 * @since 7 1013 * @deprecated since 9 1014 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getDeviceName 1015 */ 1016 getDeviceName(callback: AsyncCallback<string>): void; 1017 1018 /** 1019 * Obtains the name of BLE peripheral device. 1020 * 1021 * @permission ohos.permission.USE_BLUETOOTH 1022 * @returns { Promise<string> } Returns a string representation of the name if obtained; 1023 * returns {@code null} if the name fails to be obtained or the name does not exist. 1024 * @syscap SystemCapability.Communication.Bluetooth.Core 1025 * @since 7 1026 * @deprecated since 9 1027 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getDeviceName 1028 */ 1029 getDeviceName(): Promise<string>; 1030 1031 /** 1032 * Starts discovering services. 1033 * 1034 * @permission ohos.permission.USE_BLUETOOTH 1035 * @param { AsyncCallback<Array<GattService>> } callback - Callback used to catch the services. 1036 * @syscap SystemCapability.Communication.Bluetooth.Core 1037 * @since 7 1038 * @deprecated since 9 1039 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getServices 1040 */ 1041 getServices(callback: AsyncCallback<Array<GattService>>): void; 1042 1043 /** 1044 * Starts discovering services. 1045 * 1046 * @permission ohos.permission.USE_BLUETOOTH 1047 * @returns { Promise<Array<GattService>> } Returns the list of services {@link GattService} of the BLE peripheral device. 1048 * @syscap SystemCapability.Communication.Bluetooth.Core 1049 * @since 7 1050 * @deprecated since 9 1051 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getServices 1052 */ 1053 getServices(): Promise<Array<GattService>>; 1054 1055 /** 1056 * Reads the characteristic of a BLE peripheral device. 1057 * 1058 * @permission ohos.permission.USE_BLUETOOTH 1059 * @param { BLECharacteristic } characteristic - Indicates the characteristic to read. 1060 * @param { AsyncCallback<BLECharacteristic> } callback - Callback invoked to return the characteristic value read. 1061 * @syscap SystemCapability.Communication.Bluetooth.Core 1062 * @since 7 1063 * @deprecated since 9 1064 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#readCharacteristicValue 1065 */ 1066 readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; 1067 1068 /** 1069 * Reads the characteristic of a BLE peripheral device. 1070 * 1071 * @permission ohos.permission.USE_BLUETOOTH 1072 * @param { BLECharacteristic } characteristic - Indicates the characteristic to read. 1073 * @returns { Promise<BLECharacteristic> } - Promise used to return the characteristic value read. 1074 * @syscap SystemCapability.Communication.Bluetooth.Core 1075 * @since 7 1076 * @deprecated since 9 1077 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#readCharacteristicValue 1078 */ 1079 readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; 1080 1081 /** 1082 * Reads the descriptor of a BLE peripheral device. 1083 * 1084 * @permission ohos.permission.USE_BLUETOOTH 1085 * @param { BLEDescriptor } descriptor - Indicates the descriptor to read. 1086 * @param { AsyncCallback<BLEDescriptor> } callback - Callback invoked to return the descriptor read. 1087 * @syscap SystemCapability.Communication.Bluetooth.Core 1088 * @since 7 1089 * @deprecated since 9 1090 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#readDescriptorValue 1091 */ 1092 readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; 1093 1094 /** 1095 * Reads the descriptor of a BLE peripheral device. 1096 * 1097 * @permission ohos.permission.USE_BLUETOOTH 1098 * @param { BLEDescriptor } descriptor - Indicates the descriptor to read. 1099 * @returns { Promise<BLEDescriptor> } - Promise used to return the descriptor read. 1100 * @syscap SystemCapability.Communication.Bluetooth.Core 1101 * @since 7 1102 * @deprecated since 9 1103 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#readDescriptorValue 1104 */ 1105 readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; 1106 1107 /** 1108 * Writes the characteristic of a BLE peripheral device. 1109 * 1110 * @permission ohos.permission.USE_BLUETOOTH 1111 * @param { BLECharacteristic } characteristic - Indicates the characteristic to write. 1112 * @returns { boolean } Returns {@code true} if the characteristic is written successfully; returns {@code false} otherwise. 1113 * @syscap SystemCapability.Communication.Bluetooth.Core 1114 * @since 7 1115 * @deprecated since 9 1116 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#writeCharacteristicValue 1117 */ 1118 writeCharacteristicValue(characteristic: BLECharacteristic): boolean; 1119 1120 /** 1121 * Writes the descriptor of a BLE peripheral device. 1122 * 1123 * @permission ohos.permission.USE_BLUETOOTH 1124 * @param { BLEDescriptor } descriptor - Indicates the descriptor to write. 1125 * @returns { boolean } Returns {@code true} if the descriptor is written successfully; returns {@code false} otherwise. 1126 * @syscap SystemCapability.Communication.Bluetooth.Core 1127 * @since 7 1128 * @deprecated since 9 1129 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#writeDescriptorValue 1130 */ 1131 writeDescriptorValue(descriptor: BLEDescriptor): boolean; 1132 1133 /** 1134 * Get the RSSI value of this BLE peripheral device. 1135 * 1136 * @permission ohos.permission.USE_BLUETOOTH 1137 * @param { AsyncCallback<number> } callback - Callback invoked to return the RSSI, in dBm. 1138 * @syscap SystemCapability.Communication.Bluetooth.Core 1139 * @since 7 1140 * @deprecated since 9 1141 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getRssiValue 1142 */ 1143 getRssiValue(callback: AsyncCallback<number>): void; 1144 1145 /** 1146 * Get the RSSI value of this BLE peripheral device. 1147 * 1148 * @permission ohos.permission.USE_BLUETOOTH 1149 * @returns { Promise<number> } Returns the RSSI value. 1150 * @syscap SystemCapability.Communication.Bluetooth.Core 1151 * @since 7 1152 * @deprecated since 9 1153 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#getRssiValue 1154 */ 1155 getRssiValue(): Promise<number>; 1156 1157 /** 1158 * Set the mtu size of a BLE peripheral device. 1159 * 1160 * @permission ohos.permission.USE_BLUETOOTH 1161 * @param { number } mtu - The maximum transmission unit. 1162 * @returns { boolean } Returns {@code true} if the set mtu is successfully; returns {@code false} otherwise. 1163 * @syscap SystemCapability.Communication.Bluetooth.Core 1164 * @since 7 1165 * @deprecated since 9 1166 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#setBLEMtuSize 1167 */ 1168 setBLEMtuSize(mtu: number): boolean; 1169 1170 /** 1171 * Enables or disables notification of a characteristic when value changed. 1172 * 1173 * @permission ohos.permission.USE_BLUETOOTH 1174 * @param { BLECharacteristic } characteristic - BLE characteristic to listen for. 1175 * @param { boolean } enable - Specifies whether to enable notification of the characteristic. The value {@code true} indicates 1176 * that notification is enabled, and the value {@code false} indicates that notification is disabled. 1177 * @returns { boolean } Returns {@code true} if notification of the characteristic is enabled or disabled; 1178 * returns {@code false} otherwise. 1179 * @syscap SystemCapability.Communication.Bluetooth.Core 1180 * @since 7 1181 * @deprecated since 9 1182 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice#setNotifyCharacteristicChanged 1183 */ 1184 setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; 1185 1186 /** 1187 * Subscribe characteristic value changed event. 1188 * 1189 * @permission ohos.permission.USE_BLUETOOTH 1190 * @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for. 1191 * @param { Callback<BLECharacteristic> } callback - Callback used to listen for the characteristic value changed event. 1192 * @syscap SystemCapability.Communication.Bluetooth.Core 1193 * @since 7 1194 * @deprecated since 9 1195 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice.on#event:BLECharacteristicChange 1196 */ 1197 on(type: 'BLECharacteristicChange', callback: Callback<BLECharacteristic>): void; 1198 1199 /** 1200 * Unsubscribe characteristic value changed event. 1201 * 1202 * @permission ohos.permission.USE_BLUETOOTH 1203 * @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for. 1204 * @param { Callback<BLECharacteristic> } callback - Callback used to listen for the characteristic value changed event. 1205 * @syscap SystemCapability.Communication.Bluetooth.Core 1206 * @since 7 1207 * @deprecated since 9 1208 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice.off#event:BLECharacteristicChange 1209 */ 1210 off(type: 'BLECharacteristicChange', callback?: Callback<BLECharacteristic>): void; 1211 1212 /** 1213 * Subscribe client connection state changed event. 1214 * 1215 * @permission ohos.permission.USE_BLUETOOTH 1216 * @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for. 1217 * @param { Callback<BLEConnectChangedState> } callback - Callback used to listen for the connection state changed event. 1218 * @syscap SystemCapability.Communication.Bluetooth.Core 1219 * @since 7 1220 * @deprecated since 9 1221 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice.on#event:BLEConnectionStateChange 1222 */ 1223 on(type: 'BLEConnectionStateChange', callback: Callback<BLEConnectChangedState>): void; 1224 1225 /** 1226 * Unsubscribe client connection state changed event. 1227 * 1228 * @permission ohos.permission.USE_BLUETOOTH 1229 * @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for. 1230 * @param { Callback<BLEConnectChangedState> } callback - Callback used to listen for the connection state changed event. 1231 * @syscap SystemCapability.Communication.Bluetooth.Core 1232 * @since 7 1233 * @deprecated since 9 1234 * @useinstead ohos.bluetoothManager/bluetoothManager.GattClientDevice.off#event:BLEConnectionStateChange 1235 */ 1236 off(type: 'BLEConnectionStateChange', callback?: Callback<BLEConnectChangedState>): void; 1237 } 1238 1239 /** 1240 * Describes the Gatt service. 1241 * 1242 * @typedef GattService 1243 * @syscap SystemCapability.Communication.Bluetooth.Core 1244 * @since 7 1245 * @deprecated since 9 1246 * @useinstead ohos.bluetoothManager/bluetoothManager.GattService 1247 */ 1248 interface GattService { 1249 /** 1250 * The UUID of a GattService instance 1251 * 1252 * @syscap SystemCapability.Communication.Bluetooth.Core 1253 * @since 7 1254 * @deprecated since 9 1255 */ 1256 serviceUuid: string; 1257 /** 1258 * Indicates whether the GattService instance is primary or secondary. 1259 * 1260 * @syscap SystemCapability.Communication.Bluetooth.Core 1261 * @since 7 1262 * @deprecated since 9 1263 */ 1264 isPrimary: boolean; 1265 /** 1266 * The {@link BLECharacteristic} list belongs to this GattService instance 1267 * 1268 * @syscap SystemCapability.Communication.Bluetooth.Core 1269 * @since 7 1270 * @deprecated since 9 1271 */ 1272 characteristics: Array<BLECharacteristic>; 1273 /** 1274 * The list of GATT services contained in the service 1275 * 1276 * @syscap SystemCapability.Communication.Bluetooth.Core 1277 * @since 7 1278 * @deprecated since 9 1279 */ 1280 includeServices?: Array<GattService>; 1281 } 1282 1283 /** 1284 * Describes the Gatt characteristic. 1285 * 1286 * @typedef BLECharacteristic 1287 * @syscap SystemCapability.Communication.Bluetooth.Core 1288 * @since 7 1289 * @deprecated since 9 1290 * @useinstead ohos.bluetoothManager/bluetoothManager.BLECharacteristic 1291 */ 1292 interface BLECharacteristic { 1293 /** 1294 * The UUID of the {@link GattService} instance to which the characteristic belongs 1295 * 1296 * @syscap SystemCapability.Communication.Bluetooth.Core 1297 * @since 7 1298 * @deprecated since 9 1299 */ 1300 serviceUuid: string; 1301 /** 1302 * The UUID of a BLECharacteristic instance 1303 * 1304 * @syscap SystemCapability.Communication.Bluetooth.Core 1305 * @since 7 1306 * @deprecated since 9 1307 */ 1308 characteristicUuid: string; 1309 /** 1310 * The value of a BLECharacteristic instance 1311 * 1312 * @syscap SystemCapability.Communication.Bluetooth.Core 1313 * @since 7 1314 * @deprecated since 9 1315 */ 1316 characteristicValue: ArrayBuffer; 1317 /** 1318 * The list of {@link BLEDescriptor} contained in the characteristic 1319 * 1320 * @syscap SystemCapability.Communication.Bluetooth.Core 1321 * @since 7 1322 * @deprecated since 9 1323 */ 1324 descriptors: Array<BLEDescriptor>; 1325 } 1326 1327 /** 1328 * Describes the Gatt descriptor. 1329 * 1330 * @typedef BLEDescriptor 1331 * @syscap SystemCapability.Communication.Bluetooth.Core 1332 * @since 7 1333 * @deprecated since 9 1334 * @useinstead ohos.bluetoothManager/bluetoothManager.BLEDescriptor 1335 */ 1336 interface BLEDescriptor { 1337 /** 1338 * The UUID of the {@link GattService} instance to which the descriptor belongs 1339 * 1340 * @syscap SystemCapability.Communication.Bluetooth.Core 1341 * @since 7 1342 * @deprecated since 9 1343 */ 1344 serviceUuid: string; 1345 /** 1346 * The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs 1347 * 1348 * @syscap SystemCapability.Communication.Bluetooth.Core 1349 * @since 7 1350 * @deprecated since 9 1351 */ 1352 characteristicUuid: string; 1353 /** 1354 * The UUID of the BLEDescriptor instance 1355 * 1356 * @syscap SystemCapability.Communication.Bluetooth.Core 1357 * @since 7 1358 * @deprecated since 9 1359 */ 1360 descriptorUuid: string; 1361 /** 1362 * The value of the BLEDescriptor instance 1363 * 1364 * @syscap SystemCapability.Communication.Bluetooth.Core 1365 * @since 7 1366 * @deprecated since 9 1367 */ 1368 descriptorValue: ArrayBuffer; 1369 } 1370 1371 /** 1372 * Describes the value of the indication or notification sent by the Gatt server. 1373 * 1374 * @typedef NotifyCharacteristic 1375 * @syscap SystemCapability.Communication.Bluetooth.Core 1376 * @since 7 1377 * @deprecated since 9 1378 * @useinstead ohos.bluetoothManager/bluetoothManager.NotifyCharacteristic 1379 */ 1380 interface NotifyCharacteristic { 1381 /** 1382 * The UUID of the {@link GattService} instance to which the characteristic belongs 1383 * 1384 * @syscap SystemCapability.Communication.Bluetooth.Core 1385 * @since 7 1386 * @deprecated since 9 1387 */ 1388 serviceUuid: string; 1389 /** 1390 * The UUID of a NotifyCharacteristic instance 1391 * 1392 * @syscap SystemCapability.Communication.Bluetooth.Core 1393 * @since 7 1394 * @deprecated since 9 1395 */ 1396 characteristicUuid: string; 1397 /** 1398 * The value of a NotifyCharacteristic instance 1399 * 1400 * @syscap SystemCapability.Communication.Bluetooth.Core 1401 * @since 7 1402 * @deprecated since 9 1403 */ 1404 characteristicValue: ArrayBuffer; 1405 /** 1406 * Specifies whether to request confirmation from the BLE peripheral device (indication) or 1407 * send a notification. Value {@code true} indicates the former and {@code false} indicates the latter. 1408 * 1409 * @syscap SystemCapability.Communication.Bluetooth.Core 1410 * @since 7 1411 * @deprecated since 9 1412 */ 1413 confirm: boolean; 1414 } 1415 1416 /** 1417 * Describes the parameters of the Gatt client's characteristic read request. 1418 * 1419 * @typedef CharacteristicReadReq 1420 * @syscap SystemCapability.Communication.Bluetooth.Core 1421 * @since 7 1422 * @deprecated since 9 1423 * @useinstead ohos.bluetoothManager/bluetoothManager.CharacteristicReadRequest 1424 */ 1425 interface CharacteristicReadReq { 1426 /** 1427 * Indicates the address of the client that initiates the read request 1428 * 1429 * @syscap SystemCapability.Communication.Bluetooth.Core 1430 * @since 7 1431 * @deprecated since 9 1432 */ 1433 deviceId: string; 1434 /** 1435 * The Id of the read request 1436 * 1437 * @syscap SystemCapability.Communication.Bluetooth.Core 1438 * @since 7 1439 * @deprecated since 9 1440 */ 1441 transId: number; 1442 /** 1443 * Indicates the byte offset of the start position for reading characteristic value 1444 * 1445 * @syscap SystemCapability.Communication.Bluetooth.Core 1446 * @since 7 1447 * @deprecated since 9 1448 */ 1449 offset: number; 1450 /** 1451 * The UUID of a CharacteristicReadReq instance 1452 * 1453 * @syscap SystemCapability.Communication.Bluetooth.Core 1454 * @since 7 1455 * @deprecated since 9 1456 */ 1457 characteristicUuid: string; 1458 /** 1459 * The UUID of the service to which the characteristic belongs 1460 * 1461 * @syscap SystemCapability.Communication.Bluetooth.Core 1462 * @since 7 1463 * @deprecated since 9 1464 */ 1465 serviceUuid: string; 1466 } 1467 1468 /** 1469 * Describes the parameters of the of the Gatt client's characteristic write request. 1470 * 1471 * @typedef CharacteristicWriteReq 1472 * @syscap SystemCapability.Communication.Bluetooth.Core 1473 * @since 7 1474 * @deprecated since 9 1475 * @useinstead ohos.bluetoothManager/bluetoothManager.CharacteristicWriteRequest 1476 */ 1477 interface CharacteristicWriteReq { 1478 /** 1479 * Indicates the address of the client that initiates the write request 1480 * 1481 * @syscap SystemCapability.Communication.Bluetooth.Core 1482 * @since 7 1483 * @deprecated since 9 1484 */ 1485 deviceId: string; 1486 /** 1487 * The Id of the write request 1488 * 1489 * @syscap SystemCapability.Communication.Bluetooth.Core 1490 * @since 7 1491 * @deprecated since 9 1492 */ 1493 transId: number; 1494 /** 1495 * Indicates the byte offset of the start position for writing characteristic value 1496 * 1497 * @syscap SystemCapability.Communication.Bluetooth.Core 1498 * @since 7 1499 * @deprecated since 9 1500 */ 1501 offset: number; 1502 /** 1503 * Whether this request should be pending for later operation 1504 * 1505 * @syscap SystemCapability.Communication.Bluetooth.Core 1506 * @since 7 1507 * @deprecated since 9 1508 */ 1509 isPrep: boolean; 1510 /** 1511 * Whether the remote client need a response 1512 * 1513 * @syscap SystemCapability.Communication.Bluetooth.Core 1514 * @since 7 1515 * @deprecated since 9 1516 */ 1517 needRsp: boolean; 1518 /** 1519 * Indicates the value to be written 1520 * 1521 * @syscap SystemCapability.Communication.Bluetooth.Core 1522 * @since 7 1523 * @deprecated since 9 1524 */ 1525 value: ArrayBuffer; 1526 /** 1527 * The UUID of a CharacteristicWriteReq instance 1528 * 1529 * @syscap SystemCapability.Communication.Bluetooth.Core 1530 * @since 7 1531 * @deprecated since 9 1532 */ 1533 characteristicUuid: string; 1534 /** 1535 * The UUID of the service to which the characteristic belongs 1536 * 1537 * @syscap SystemCapability.Communication.Bluetooth.Core 1538 * @since 7 1539 * @deprecated since 9 1540 */ 1541 serviceUuid: string; 1542 } 1543 1544 /** 1545 * Describes the parameters of the Gatt client's descriptor read request. 1546 * 1547 * @typedef DescriptorReadReq 1548 * @syscap SystemCapability.Communication.Bluetooth.Core 1549 * @since 7 1550 * @deprecated since 9 1551 * @useinstead ohos.bluetoothManager/bluetoothManager.DescriptorReadRequest 1552 */ 1553 interface DescriptorReadReq { 1554 /** 1555 * Indicates the address of the client that initiates the read request 1556 * 1557 * @syscap SystemCapability.Communication.Bluetooth.Core 1558 * @since 7 1559 * @deprecated since 9 1560 */ 1561 deviceId: string; 1562 /** 1563 * The Id of the read request 1564 * 1565 * @syscap SystemCapability.Communication.Bluetooth.Core 1566 * @since 7 1567 * @deprecated since 9 1568 */ 1569 transId: number; 1570 /** 1571 * Indicates the byte offset of the start position for reading characteristic value 1572 * 1573 * @syscap SystemCapability.Communication.Bluetooth.Core 1574 * @since 7 1575 * @deprecated since 9 1576 */ 1577 offset: number; 1578 /** 1579 * The UUID of a DescriptorReadReq instance 1580 * 1581 * @syscap SystemCapability.Communication.Bluetooth.Core 1582 * @since 7 1583 * @deprecated since 9 1584 */ 1585 descriptorUuid: string; 1586 /** 1587 * The UUID of the characteristic to which the descriptor belongs 1588 * 1589 * @syscap SystemCapability.Communication.Bluetooth.Core 1590 * @since 7 1591 * @deprecated since 9 1592 */ 1593 characteristicUuid: string; 1594 /** 1595 * The UUID of the service to which the descriptor belongs 1596 * 1597 * @syscap SystemCapability.Communication.Bluetooth.Core 1598 * @since 7 1599 * @deprecated since 9 1600 */ 1601 serviceUuid: string; 1602 } 1603 1604 /** 1605 * Describes the parameters of the Gatt client's characteristic write request. 1606 * 1607 * @typedef DescriptorWriteReq 1608 * @syscap SystemCapability.Communication.Bluetooth.Core 1609 * @since 7 1610 * @deprecated since 9 1611 * @useinstead ohos.bluetoothManager/bluetoothManager.DescriptorWriteRequest 1612 */ 1613 interface DescriptorWriteReq { 1614 /** 1615 * Indicates the address of the client that initiates the write request 1616 * 1617 * @syscap SystemCapability.Communication.Bluetooth.Core 1618 * @since 7 1619 * @deprecated since 9 1620 */ 1621 deviceId: string; 1622 /** 1623 * The Id of the write request 1624 * 1625 * @syscap SystemCapability.Communication.Bluetooth.Core 1626 * @since 7 1627 * @deprecated since 9 1628 */ 1629 transId: number; 1630 /** 1631 * Indicates the byte offset of the start position for writing characteristic value 1632 * 1633 * @syscap SystemCapability.Communication.Bluetooth.Core 1634 * @since 7 1635 * @deprecated since 9 1636 */ 1637 offset: number; 1638 /** 1639 * Whether this request should be pending for later operation 1640 * 1641 * @syscap SystemCapability.Communication.Bluetooth.Core 1642 * @since 7 1643 * @deprecated since 9 1644 */ 1645 isPrep: boolean; 1646 /** 1647 * Whether the remote client need a response 1648 * 1649 * @syscap SystemCapability.Communication.Bluetooth.Core 1650 * @since 7 1651 * @deprecated since 9 1652 */ 1653 needRsp: boolean; 1654 /** 1655 * Indicates the value to be written 1656 * 1657 * @syscap SystemCapability.Communication.Bluetooth.Core 1658 * @since 7 1659 * @deprecated since 9 1660 */ 1661 value: ArrayBuffer; 1662 /** 1663 * The UUID of a DescriptorWriteReq instance 1664 * 1665 * @syscap SystemCapability.Communication.Bluetooth.Core 1666 * @since 7 1667 * @deprecated since 9 1668 */ 1669 descriptorUuid: string; 1670 /** 1671 * The UUID of the characteristic to which the descriptor belongs 1672 * 1673 * @syscap SystemCapability.Communication.Bluetooth.Core 1674 * @since 7 1675 * @deprecated since 9 1676 */ 1677 characteristicUuid: string; 1678 /** 1679 * The UUID of the service to which the descriptor belongs 1680 * 1681 * @syscap SystemCapability.Communication.Bluetooth.Core 1682 * @since 7 1683 * @deprecated since 9 1684 */ 1685 serviceUuid: string; 1686 } 1687 1688 /** 1689 * Describes the parameters of a response send by the server to a specified read or write request. 1690 * 1691 * @typedef ServerResponse 1692 * @syscap SystemCapability.Communication.Bluetooth.Core 1693 * @since 7 1694 * @deprecated since 9 1695 * @useinstead ohos.bluetoothManager/bluetoothManager.ServerResponse 1696 */ 1697 interface ServerResponse { 1698 /** 1699 * Indicates the address of the client to which to send the response 1700 * 1701 * @syscap SystemCapability.Communication.Bluetooth.Core 1702 * @since 7 1703 * @deprecated since 9 1704 */ 1705 deviceId: string; 1706 /** 1707 * The Id of the write request 1708 * 1709 * @syscap SystemCapability.Communication.Bluetooth.Core 1710 * @since 7 1711 * @deprecated since 9 1712 */ 1713 transId: number; 1714 /** 1715 * Indicates the status of the read or write request, set this parameter to '0' in normal cases 1716 * 1717 * @syscap SystemCapability.Communication.Bluetooth.Core 1718 * @since 7 1719 * @deprecated since 9 1720 */ 1721 status: number; 1722 /** 1723 * Indicates the byte offset of the start position for reading or writing operation 1724 * 1725 * @syscap SystemCapability.Communication.Bluetooth.Core 1726 * @since 7 1727 * @deprecated since 9 1728 */ 1729 offset: number; 1730 /** 1731 * Indicates the value to be sent 1732 * 1733 * @syscap SystemCapability.Communication.Bluetooth.Core 1734 * @since 7 1735 * @deprecated since 9 1736 */ 1737 value: ArrayBuffer; 1738 } 1739 1740 /** 1741 * Describes the Gatt profile connection state. 1742 * 1743 * @typedef BLEConnectChangedState 1744 * @syscap SystemCapability.Communication.Bluetooth.Core 1745 * @since 7 1746 * @deprecated since 9 1747 * @useinstead ohos.bluetoothManager/bluetoothManager.BLEConnectChangedState 1748 */ 1749 interface BLEConnectChangedState { 1750 /** 1751 * Indicates the peer device address 1752 * 1753 * @syscap SystemCapability.Communication.Bluetooth.Core 1754 * @since 7 1755 * @deprecated since 9 1756 */ 1757 deviceId: string; 1758 /** 1759 * Connection state of the Gatt profile 1760 * 1761 * @syscap SystemCapability.Communication.Bluetooth.Core 1762 * @since 7 1763 * @deprecated since 9 1764 */ 1765 state: ProfileConnectionState; 1766 } 1767 1768 /** 1769 * Describes the contents of the scan results. 1770 * 1771 * @typedef ScanResult 1772 * @syscap SystemCapability.Communication.Bluetooth.Core 1773 * @since 7 1774 * @deprecated since 9 1775 * @useinstead ohos.bluetoothManager/bluetoothManager.ScanResult 1776 */ 1777 interface ScanResult { 1778 /** 1779 * Address of the scanned device 1780 * 1781 * @syscap SystemCapability.Communication.Bluetooth.Core 1782 * @since 7 1783 * @deprecated since 9 1784 */ 1785 deviceId: string; 1786 /** 1787 * RSSI of the remote device 1788 * 1789 * @syscap SystemCapability.Communication.Bluetooth.Core 1790 * @since 7 1791 * @deprecated since 9 1792 */ 1793 rssi: number; 1794 /** 1795 * The raw data of broadcast packet 1796 * 1797 * @syscap SystemCapability.Communication.Bluetooth.Core 1798 * @since 7 1799 * @deprecated since 9 1800 */ 1801 data: ArrayBuffer; 1802 } 1803 1804 /** 1805 * Describes the settings for BLE advertising. 1806 * 1807 * @typedef AdvertiseSetting 1808 * @syscap SystemCapability.Communication.Bluetooth.Core 1809 * @since 7 1810 * @deprecated since 9 1811 * @useinstead ohos.bluetoothManager/bluetoothManager.AdvertiseSetting 1812 */ 1813 interface AdvertiseSetting { 1814 /** 1815 * Minimum slot value for the advertising interval, which is {@code 32} (20 ms) 1816 * Maximum slot value for the advertising interval, which is {@code 16777215} (10485.759375s) 1817 * Default slot value for the advertising interval, which is {@code 1600} (1s) 1818 * 1819 * @syscap SystemCapability.Communication.Bluetooth.Core 1820 * @since 7 1821 * @deprecated since 9 1822 */ 1823 interval?: number; 1824 /** 1825 * Minimum transmission power level for advertising, which is {@code -127} 1826 * Maximum transmission power level for advertising, which is {@code 1} 1827 * Default transmission power level for advertising, which is {@code -7} 1828 * 1829 * @syscap SystemCapability.Communication.Bluetooth.Core 1830 * @since 7 1831 * @deprecated since 9 1832 */ 1833 txPower?: number; 1834 /** 1835 * Indicates whether the BLE is connectable, default is {@code true} 1836 * 1837 * @syscap SystemCapability.Communication.Bluetooth.Core 1838 * @since 7 1839 * @deprecated since 9 1840 */ 1841 connectable?: boolean; 1842 } 1843 1844 /** 1845 * Describes the advertising data. 1846 * 1847 * @typedef AdvertiseData 1848 * @syscap SystemCapability.Communication.Bluetooth.Core 1849 * @since 7 1850 * @deprecated since 9 1851 * @useinstead ohos.bluetoothManager/bluetoothManager.AdvertiseData 1852 */ 1853 interface AdvertiseData { 1854 /** 1855 * The specified service UUID list to this advertisement 1856 * 1857 * @syscap SystemCapability.Communication.Bluetooth.Core 1858 * @since 7 1859 * @deprecated since 9 1860 */ 1861 serviceUuids: Array<string>; 1862 /** 1863 * The specified manufacturer data list to this advertisement 1864 * 1865 * @syscap SystemCapability.Communication.Bluetooth.Core 1866 * @since 7 1867 * @deprecated since 9 1868 */ 1869 manufactureData: Array<ManufactureData>; 1870 /** 1871 * The specified service data list to this advertisement 1872 * 1873 * @syscap SystemCapability.Communication.Bluetooth.Core 1874 * @since 7 1875 * @deprecated since 9 1876 */ 1877 serviceData: Array<ServiceData>; 1878 } 1879 1880 /** 1881 * Describes the manufacturer data. 1882 * 1883 * @typedef ManufactureData 1884 * @syscap SystemCapability.Communication.Bluetooth.Core 1885 * @since 7 1886 * @deprecated since 9 1887 * @useinstead ohos.bluetoothManager/bluetoothManager.ManufactureData 1888 */ 1889 interface ManufactureData { 1890 /** 1891 * Indicates the manufacturer ID assigned by Bluetooth SIG 1892 * 1893 * @syscap SystemCapability.Communication.Bluetooth.Core 1894 * @since 7 1895 * @deprecated since 9 1896 */ 1897 manufactureId: number; 1898 /** 1899 * Indicates the manufacturer data to add 1900 * 1901 * @syscap SystemCapability.Communication.Bluetooth.Core 1902 * @since 7 1903 * @deprecated since 9 1904 */ 1905 manufactureValue: ArrayBuffer; 1906 } 1907 1908 /** 1909 * Describes the service data. 1910 * 1911 * @typedef ServiceData 1912 * @syscap SystemCapability.Communication.Bluetooth.Core 1913 * @since 7 1914 * @deprecated since 9 1915 * @useinstead ohos.bluetoothManager/bluetoothManager.ServiceData 1916 */ 1917 interface ServiceData { 1918 /** 1919 * Indicates the UUID of the service data to add 1920 * 1921 * @syscap SystemCapability.Communication.Bluetooth.Core 1922 * @since 7 1923 * @deprecated since 9 1924 */ 1925 serviceUuid: string; 1926 /** 1927 * Indicates the service data to add 1928 * 1929 * @syscap SystemCapability.Communication.Bluetooth.Core 1930 * @since 7 1931 * @deprecated since 9 1932 */ 1933 serviceValue: ArrayBuffer; 1934 } 1935 1936 /** 1937 * Describes the criteria for filtering scanning results can be set. 1938 * 1939 * @typedef ScanFilter 1940 * @syscap SystemCapability.Communication.Bluetooth.Core 1941 * @since 7 1942 * @deprecated since 9 1943 * @useinstead ohos.bluetoothManager/bluetoothManager.ScanFilter 1944 */ 1945 interface ScanFilter { 1946 /** 1947 * The address of a BLE peripheral device 1948 * 1949 * @syscap SystemCapability.Communication.Bluetooth.Core 1950 * @since 7 1951 * @deprecated since 9 1952 */ 1953 deviceId?: string; 1954 /** 1955 * The name of a BLE peripheral device 1956 * 1957 * @syscap SystemCapability.Communication.Bluetooth.Core 1958 * @since 7 1959 * @deprecated since 9 1960 */ 1961 name?: string; 1962 /** 1963 * The service UUID of a BLE peripheral device 1964 * 1965 * @syscap SystemCapability.Communication.Bluetooth.Core 1966 * @since 7 1967 * @deprecated since 9 1968 */ 1969 serviceUuid?: string; 1970 } 1971 1972 /** 1973 * Describes the parameters for scan. 1974 * 1975 * @typedef ScanOptions 1976 * @syscap SystemCapability.Communication.Bluetooth.Core 1977 * @since 7 1978 * @deprecated since 9 1979 * @useinstead ohos.bluetoothManager/bluetoothManager.ScanOptions 1980 */ 1981 interface ScanOptions { 1982 /** 1983 * Time of delay for reporting the scan result 1984 * 1985 * @syscap SystemCapability.Communication.Bluetooth.Core 1986 * @since 7 1987 * @deprecated since 9 1988 */ 1989 interval?: number; 1990 /** 1991 * Bluetooth LE scan mode 1992 * 1993 * @syscap SystemCapability.Communication.Bluetooth.Core 1994 * @since 7 1995 * @deprecated since 9 1996 */ 1997 dutyMode?: ScanDuty; 1998 /** 1999 * Match mode for Bluetooth LE scan filters hardware match 2000 * 2001 * @syscap SystemCapability.Communication.Bluetooth.Core 2002 * @since 7 2003 * @deprecated since 9 2004 */ 2005 matchMode?: MatchMode; 2006 } 2007 2008 /** 2009 * Describes the spp parameters. 2010 * 2011 * @typedef SppOption 2012 * @syscap SystemCapability.Communication.Bluetooth.Core 2013 * @since 8 2014 * @deprecated since 9 2015 * @useinstead ohos.bluetoothManager/bluetoothManager.SppOption 2016 */ 2017 interface SppOption { 2018 /** 2019 * Indicates the UUID in the SDP record. 2020 * 2021 * @syscap SystemCapability.Communication.Bluetooth.Core 2022 * @since 8 2023 * @deprecated since 9 2024 */ 2025 uuid: string; 2026 /** 2027 * Indicates secure channel or not 2028 * 2029 * @syscap SystemCapability.Communication.Bluetooth.Core 2030 * @since 8 2031 * @deprecated since 9 2032 */ 2033 secure: boolean; 2034 /** 2035 * Spp link type {@link SppType} 2036 * 2037 * @syscap SystemCapability.Communication.Bluetooth.Core 2038 * @since 8 2039 * @deprecated since 9 2040 */ 2041 type: SppType; 2042 } 2043 2044 /** 2045 * Describes the bond key param. 2046 * 2047 * @typedef PinRequiredParam 2048 * @syscap SystemCapability.Communication.Bluetooth.Core 2049 * @since 8 2050 * @deprecated since 9 2051 * @useinstead ohos.bluetoothManager/bluetoothManager.PinRequiredParam 2052 */ 2053 interface PinRequiredParam { 2054 /** 2055 * ID of the device to pair. 2056 * 2057 * @syscap SystemCapability.Communication.Bluetooth.Core 2058 * @since 8 2059 * @deprecated since 9 2060 */ 2061 deviceId: string; 2062 /** 2063 * Key for the device pairing. 2064 * 2065 * @syscap SystemCapability.Communication.Bluetooth.Core 2066 * @since 8 2067 * @deprecated since 9 2068 */ 2069 pinCode: string; 2070 } 2071 2072 /** 2073 * Describes the class of a bluetooth device. 2074 * 2075 * @typedef DeviceClass 2076 * @syscap SystemCapability.Communication.Bluetooth.Core 2077 * @since 8 2078 * @deprecated since 9 2079 * @useinstead ohos.bluetoothManager/bluetoothManager.DeviceClass 2080 */ 2081 interface DeviceClass { 2082 /** 2083 * Major classes of Bluetooth devices. 2084 * 2085 * @syscap SystemCapability.Communication.Bluetooth.Core 2086 * @since 8 2087 * @deprecated since 9 2088 */ 2089 majorClass: MajorClass; 2090 /** 2091 * Major and minor classes of Bluetooth devices. 2092 * 2093 * @syscap SystemCapability.Communication.Bluetooth.Core 2094 * @since 8 2095 * @deprecated since 9 2096 */ 2097 majorMinorClass: MajorMinorClass; 2098 /** 2099 * Class of the device. 2100 * 2101 * @syscap SystemCapability.Communication.Bluetooth.Core 2102 * @since 8 2103 * @deprecated since 9 2104 */ 2105 classOfDevice: number; 2106 } 2107 2108 /** 2109 * Describes the class of a bluetooth device. 2110 * 2111 * @typedef BondStateParam 2112 * @syscap SystemCapability.Communication.Bluetooth.Core 2113 * @since 8 2114 * @deprecated since 9 2115 * @useinstead ohos.bluetoothManager/bluetoothManager.BondStateParam 2116 */ 2117 interface BondStateParam { 2118 /** 2119 * Address of a Bluetooth device. 2120 * 2121 * @syscap SystemCapability.Communication.Bluetooth.Core 2122 * @since 8 2123 * @deprecated since 9 2124 */ 2125 deviceId: string; 2126 /** 2127 * Profile connection state of the device. 2128 * 2129 * @syscap SystemCapability.Communication.Bluetooth.Core 2130 * @since 8 2131 * @deprecated since 9 2132 */ 2133 state: BondState; 2134 } 2135 2136 /** 2137 * The enum of scan duty. 2138 * 2139 * @enum { number } 2140 * @syscap SystemCapability.Communication.Bluetooth.Core 2141 * @since 7 2142 * @deprecated since 9 2143 * @useinstead ohos.bluetoothManager/bluetoothManager.ScanDuty 2144 */ 2145 enum ScanDuty { 2146 /** 2147 * low power mode 2148 * 2149 * @syscap SystemCapability.Communication.Bluetooth.Core 2150 * @since 7 2151 * @deprecated since 9 2152 */ 2153 SCAN_MODE_LOW_POWER = 0, 2154 /** 2155 * balanced power mode 2156 * 2157 * @syscap SystemCapability.Communication.Bluetooth.Core 2158 * @since 7 2159 * @deprecated since 9 2160 */ 2161 SCAN_MODE_BALANCED = 1, 2162 /** 2163 * Scan using highest duty cycle 2164 * 2165 * @syscap SystemCapability.Communication.Bluetooth.Core 2166 * @since 7 2167 * @deprecated since 9 2168 */ 2169 SCAN_MODE_LOW_LATENCY = 2 2170 } 2171 2172 /** 2173 * The enum of BLE match mode. 2174 * 2175 * @enum { number } 2176 * @syscap SystemCapability.Communication.Bluetooth.Core 2177 * @since 7 2178 * @deprecated since 9 2179 * @useinstead ohos.bluetoothManager/bluetoothManager.MatchMode 2180 */ 2181 enum MatchMode { 2182 /** 2183 * aggressive mode 2184 * 2185 * @syscap SystemCapability.Communication.Bluetooth.Core 2186 * @since 7 2187 * @deprecated since 9 2188 */ 2189 MATCH_MODE_AGGRESSIVE = 1, 2190 /** 2191 * sticky mode 2192 * 2193 * @syscap SystemCapability.Communication.Bluetooth.Core 2194 * @since 7 2195 * @deprecated since 9 2196 */ 2197 MATCH_MODE_STICKY = 2 2198 } 2199 2200 /** 2201 * The enum of profile connection state. 2202 * 2203 * @enum { number } 2204 * @syscap SystemCapability.Communication.Bluetooth.Core 2205 * @since 7 2206 * @deprecated since 9 2207 * @useinstead ohos.bluetoothManager/bluetoothManager.ProfileConnectionState 2208 */ 2209 enum ProfileConnectionState { 2210 /** 2211 * the current profile is disconnected 2212 * 2213 * @syscap SystemCapability.Communication.Bluetooth.Core 2214 * @since 7 2215 * @deprecated since 9 2216 */ 2217 STATE_DISCONNECTED = 0, 2218 /** 2219 * the current profile is being connected 2220 * 2221 * @syscap SystemCapability.Communication.Bluetooth.Core 2222 * @since 7 2223 * @deprecated since 9 2224 */ 2225 STATE_CONNECTING = 1, 2226 /** 2227 * the current profile is connected 2228 * 2229 * @syscap SystemCapability.Communication.Bluetooth.Core 2230 * @since 7 2231 * @deprecated since 9 2232 */ 2233 STATE_CONNECTED = 2, 2234 /** 2235 * the current profile is being disconnected 2236 * 2237 * @syscap SystemCapability.Communication.Bluetooth.Core 2238 * @since 7 2239 * @deprecated since 9 2240 */ 2241 STATE_DISCONNECTING = 3 2242 } 2243 2244 /** 2245 * The enum of bluetooth state. 2246 * 2247 * @enum { number } 2248 * @syscap SystemCapability.Communication.Bluetooth.Core 2249 * @since 7 2250 * @deprecated since 9 2251 * @useinstead ohos.bluetoothManager/bluetoothManager.BluetoothState 2252 */ 2253 enum BluetoothState { 2254 /** 2255 * Indicates the local Bluetooth is off 2256 * 2257 * @syscap SystemCapability.Communication.Bluetooth.Core 2258 * @since 7 2259 * @deprecated since 9 2260 */ 2261 STATE_OFF = 0, 2262 /** 2263 * Indicates the local Bluetooth is turning on 2264 * 2265 * @syscap SystemCapability.Communication.Bluetooth.Core 2266 * @since 7 2267 * @deprecated since 9 2268 */ 2269 STATE_TURNING_ON = 1, 2270 /** 2271 * Indicates the local Bluetooth is on, and ready for use 2272 * 2273 * @syscap SystemCapability.Communication.Bluetooth.Core 2274 * @since 7 2275 * @deprecated since 9 2276 */ 2277 STATE_ON = 2, 2278 /** 2279 * Indicates the local Bluetooth is turning off 2280 * 2281 * @syscap SystemCapability.Communication.Bluetooth.Core 2282 * @since 7 2283 * @deprecated since 9 2284 */ 2285 STATE_TURNING_OFF = 3, 2286 /** 2287 * Indicates the local Bluetooth is turning LE mode on 2288 * 2289 * @syscap SystemCapability.Communication.Bluetooth.Core 2290 * @since 7 2291 * @deprecated since 9 2292 */ 2293 STATE_BLE_TURNING_ON = 4, 2294 /** 2295 * Indicates the local Bluetooth is in LE only mode 2296 * 2297 * @syscap SystemCapability.Communication.Bluetooth.Core 2298 * @since 7 2299 * @deprecated since 9 2300 */ 2301 STATE_BLE_ON = 5, 2302 /** 2303 * Indicates the local Bluetooth is turning off LE only mode 2304 * 2305 * @syscap SystemCapability.Communication.Bluetooth.Core 2306 * @since 7 2307 * @deprecated since 9 2308 */ 2309 STATE_BLE_TURNING_OFF = 6 2310 } 2311 2312 /** 2313 * The enum of SPP type. 2314 * 2315 * @enum { number } 2316 * @syscap SystemCapability.Communication.Bluetooth.Core 2317 * @since 8 2318 * @deprecated since 9 2319 * @useinstead ohos.bluetoothManager/bluetoothManager.SppType 2320 */ 2321 enum SppType { 2322 /** 2323 * RFCOMM 2324 * 2325 * @syscap SystemCapability.Communication.Bluetooth.Core 2326 * @since 8 2327 * @deprecated since 9 2328 */ 2329 SPP_RFCOMM 2330 } 2331 2332 /** 2333 * The enum of BR scan mode. 2334 * 2335 * @enum { number } 2336 * @syscap SystemCapability.Communication.Bluetooth.Core 2337 * @since 8 2338 * @deprecated since 9 2339 * @useinstead ohos.bluetoothManager/bluetoothManager.ScanMode 2340 */ 2341 enum ScanMode { 2342 /** 2343 * Indicates the scan mode is none 2344 * 2345 * @syscap SystemCapability.Communication.Bluetooth.Core 2346 * @since 8 2347 * @deprecated since 9 2348 */ 2349 SCAN_MODE_NONE = 0, 2350 /** 2351 * Indicates the scan mode is connectable 2352 * 2353 * @syscap SystemCapability.Communication.Bluetooth.Core 2354 * @since 8 2355 * @deprecated since 9 2356 */ 2357 SCAN_MODE_CONNECTABLE = 1, 2358 /** 2359 * Indicates the scan mode is general discoverable 2360 * 2361 * @syscap SystemCapability.Communication.Bluetooth.Core 2362 * @since 8 2363 * @deprecated since 9 2364 */ 2365 SCAN_MODE_GENERAL_DISCOVERABLE = 2, 2366 /** 2367 * Indicates the scan mode is limited discoverable 2368 * 2369 * @syscap SystemCapability.Communication.Bluetooth.Core 2370 * @since 8 2371 * @deprecated since 9 2372 */ 2373 SCAN_MODE_LIMITED_DISCOVERABLE = 3, 2374 /** 2375 * Indicates the scan mode is connectable and general discoverable 2376 * 2377 * @syscap SystemCapability.Communication.Bluetooth.Core 2378 * @since 8 2379 * @deprecated since 9 2380 */ 2381 SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE = 4, 2382 /** 2383 * Indicates the scan mode is connectable and limited discoverable 2384 * 2385 * @syscap SystemCapability.Communication.Bluetooth.Core 2386 * @since 8 2387 * @deprecated since 9 2388 */ 2389 SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE = 5 2390 } 2391 2392 /** 2393 * The enum of bond state. 2394 * 2395 * @enum { number } 2396 * @syscap SystemCapability.Communication.Bluetooth.Core 2397 * @since 8 2398 * @deprecated since 9 2399 * @useinstead ohos.bluetoothManager/bluetoothManager.BondState 2400 */ 2401 enum BondState { 2402 /** 2403 * Indicate the bond state is invalid 2404 * 2405 * @syscap SystemCapability.Communication.Bluetooth.Core 2406 * @since 8 2407 * @deprecated since 9 2408 */ 2409 BOND_STATE_INVALID = 0, 2410 /** 2411 * Indicate the bond state is bonding 2412 * 2413 * @syscap SystemCapability.Communication.Bluetooth.Core 2414 * @since 8 2415 * @deprecated since 9 2416 */ 2417 BOND_STATE_BONDING = 1, 2418 /** 2419 * Indicate the bond state is bonded 2420 * 2421 * @syscap SystemCapability.Communication.Bluetooth.Core 2422 * @since 8 2423 * @deprecated since 9 2424 */ 2425 BOND_STATE_BONDED = 2 2426 } 2427 2428 /** 2429 * The enum of major class of a bluetooth device. 2430 * 2431 * @enum { number } 2432 * @syscap SystemCapability.Communication.Bluetooth.Core 2433 * @since 8 2434 * @deprecated since 9 2435 * @useinstead ohos.bluetoothManager/bluetoothManager.MajorClass 2436 */ 2437 enum MajorClass { 2438 /** 2439 * Miscellaneous device. 2440 * 2441 * @syscap SystemCapability.Communication.Bluetooth.Core 2442 * @since 8 2443 * @deprecated since 9 2444 */ 2445 MAJOR_MISC = 0x0000, 2446 /** 2447 * Computer. 2448 * 2449 * @syscap SystemCapability.Communication.Bluetooth.Core 2450 * @since 8 2451 * @deprecated since 9 2452 */ 2453 MAJOR_COMPUTER = 0x0100, 2454 /** 2455 * Mobile phone. 2456 * 2457 * @syscap SystemCapability.Communication.Bluetooth.Core 2458 * @since 8 2459 * @deprecated since 9 2460 */ 2461 MAJOR_PHONE = 0x0200, 2462 /** 2463 * Network device. 2464 * 2465 * @syscap SystemCapability.Communication.Bluetooth.Core 2466 * @since 8 2467 * @deprecated since 9 2468 */ 2469 MAJOR_NETWORKING = 0x0300, 2470 /** 2471 * Audio or video device. 2472 * 2473 * @syscap SystemCapability.Communication.Bluetooth.Core 2474 * @since 8 2475 * @deprecated since 9 2476 */ 2477 MAJOR_AUDIO_VIDEO = 0x0400, 2478 /** 2479 * Peripheral device. 2480 * 2481 * @syscap SystemCapability.Communication.Bluetooth.Core 2482 * @since 8 2483 * @deprecated since 9 2484 */ 2485 MAJOR_PERIPHERAL = 0x0500, 2486 /** 2487 * Imaging device. 2488 * 2489 * @syscap SystemCapability.Communication.Bluetooth.Core 2490 * @since 8 2491 * @deprecated since 9 2492 */ 2493 MAJOR_IMAGING = 0x0600, 2494 /** 2495 * Wearable device. 2496 * 2497 * @syscap SystemCapability.Communication.Bluetooth.Core 2498 * @since 8 2499 * @deprecated since 9 2500 */ 2501 MAJOR_WEARABLE = 0x0700, 2502 /** 2503 * Toy. 2504 * 2505 * @syscap SystemCapability.Communication.Bluetooth.Core 2506 * @since 8 2507 * @deprecated since 9 2508 */ 2509 MAJOR_TOY = 0x0800, 2510 /** 2511 * Health device. 2512 * 2513 * @syscap SystemCapability.Communication.Bluetooth.Core 2514 * @since 8 2515 * @deprecated since 9 2516 */ 2517 MAJOR_HEALTH = 0x0900, 2518 /** 2519 * Unclassified device. 2520 * 2521 * @syscap SystemCapability.Communication.Bluetooth.Core 2522 * @since 8 2523 * @deprecated since 9 2524 */ 2525 MAJOR_UNCATEGORIZED = 0x1F00 2526 } 2527 2528 /** 2529 * The enum of major minor class of a bluetooth device. 2530 * 2531 * @enum { number } 2532 * @syscap SystemCapability.Communication.Bluetooth.Core 2533 * @since 8 2534 * @deprecated since 9 2535 * @useinstead ohos.bluetoothManager/bluetoothManager.MajorMinorClass 2536 */ 2537 enum MajorMinorClass { 2538 /** 2539 * The Minor Device Class field 2540 * Computer Major Class 2541 * 2542 * @syscap SystemCapability.Communication.Bluetooth.Core 2543 * @since 8 2544 * @deprecated since 9 2545 */ 2546 COMPUTER_UNCATEGORIZED = 0x0100, 2547 /** 2548 * Desktop computer. 2549 * 2550 * @syscap SystemCapability.Communication.Bluetooth.Core 2551 * @since 8 2552 * @deprecated since 9 2553 */ 2554 COMPUTER_DESKTOP = 0x0104, 2555 /** 2556 * Server. 2557 * 2558 * @syscap SystemCapability.Communication.Bluetooth.Core 2559 * @since 8 2560 * @deprecated since 9 2561 */ 2562 COMPUTER_SERVER = 0x0108, 2563 /** 2564 * Laptop. 2565 * 2566 * @syscap SystemCapability.Communication.Bluetooth.Core 2567 * @since 8 2568 * @deprecated since 9 2569 */ 2570 COMPUTER_LAPTOP = 0x010C, 2571 /** 2572 * Hand-held computer. 2573 * 2574 * @syscap SystemCapability.Communication.Bluetooth.Core 2575 * @since 8 2576 * @deprecated since 9 2577 */ 2578 COMPUTER_HANDHELD_PC_PDA = 0x0110, 2579 /** 2580 * Palmtop computer. 2581 * 2582 * @syscap SystemCapability.Communication.Bluetooth.Core 2583 * @since 8 2584 * @deprecated since 9 2585 */ 2586 COMPUTER_PALM_SIZE_PC_PDA = 0x0114, 2587 /** 2588 * Wearable computer. 2589 * 2590 * @syscap SystemCapability.Communication.Bluetooth.Core 2591 * @since 8 2592 * @deprecated since 9 2593 */ 2594 COMPUTER_WEARABLE = 0x0118, 2595 /** 2596 * Tablet. 2597 * 2598 * @syscap SystemCapability.Communication.Bluetooth.Core 2599 * @since 8 2600 * @deprecated since 9 2601 */ 2602 COMPUTER_TABLET = 0x011C, 2603 2604 /** 2605 * Phone Major Class 2606 * 2607 * @syscap SystemCapability.Communication.Bluetooth.Core 2608 * @since 8 2609 * @deprecated since 9 2610 */ 2611 PHONE_UNCATEGORIZED = 0x0200, 2612 /** 2613 * Portable phone. 2614 * 2615 * @syscap SystemCapability.Communication.Bluetooth.Core 2616 * @since 8 2617 * @deprecated since 9 2618 */ 2619 PHONE_CELLULAR = 0x0204, 2620 /** 2621 * Cordless phone. 2622 * 2623 * @syscap SystemCapability.Communication.Bluetooth.Core 2624 * @since 8 2625 * @deprecated since 9 2626 */ 2627 PHONE_CORDLESS = 0x0208, 2628 /** 2629 * Smartphone. 2630 * 2631 * @syscap SystemCapability.Communication.Bluetooth.Core 2632 * @since 8 2633 * @deprecated since 9 2634 */ 2635 PHONE_SMART = 0x020C, 2636 /** 2637 * Modem or gateway phone. 2638 * 2639 * @syscap SystemCapability.Communication.Bluetooth.Core 2640 * @since 8 2641 * @deprecated since 9 2642 */ 2643 PHONE_MODEM_OR_GATEWAY = 0x0210, 2644 /** 2645 * ISDN phone. 2646 * 2647 * @syscap SystemCapability.Communication.Bluetooth.Core 2648 * @since 8 2649 * @deprecated since 9 2650 */ 2651 PHONE_ISDN = 0x0214, 2652 2653 /** 2654 * LAN/Network Access Point Major Class 2655 * 2656 * @syscap SystemCapability.Communication.Bluetooth.Core 2657 * @since 8 2658 * @deprecated since 9 2659 */ 2660 NETWORK_FULLY_AVAILABLE = 0x0300, 2661 /** 2662 * Device used on network 1 to 17. 2663 * 2664 * @syscap SystemCapability.Communication.Bluetooth.Core 2665 * @since 8 2666 * @deprecated since 9 2667 */ 2668 NETWORK_1_TO_17_UTILIZED = 0x0320, 2669 /** 2670 * Device used on network 17 to 33. 2671 * 2672 * @syscap SystemCapability.Communication.Bluetooth.Core 2673 * @since 8 2674 * @deprecated since 9 2675 */ 2676 NETWORK_17_TO_33_UTILIZED = 0x0340, 2677 /** 2678 * Device used on network 33 to 50. 2679 * 2680 * @syscap SystemCapability.Communication.Bluetooth.Core 2681 * @since 8 2682 * @deprecated since 9 2683 */ 2684 NETWORK_33_TO_50_UTILIZED = 0x0360, 2685 /** 2686 * Device used on network 60 to 67. 2687 * 2688 * @syscap SystemCapability.Communication.Bluetooth.Core 2689 * @since 8 2690 * @deprecated since 9 2691 */ 2692 NETWORK_60_TO_67_UTILIZED = 0x0380, 2693 /** 2694 * Device used on network 67 to 83. 2695 * 2696 * @syscap SystemCapability.Communication.Bluetooth.Core 2697 * @since 8 2698 * @deprecated since 9 2699 */ 2700 NETWORK_67_TO_83_UTILIZED = 0x03A0, 2701 /** 2702 * Device used on network 83 to 99. 2703 * 2704 * @syscap SystemCapability.Communication.Bluetooth.Core 2705 * @since 8 2706 * @deprecated since 9 2707 */ 2708 NETWORK_83_TO_99_UTILIZED = 0x03C0, 2709 /** 2710 * Device without network service. 2711 * 2712 * @syscap SystemCapability.Communication.Bluetooth.Core 2713 * @since 8 2714 * @deprecated since 9 2715 */ 2716 NETWORK_NO_SERVICE = 0x03E0, 2717 2718 /** 2719 * Unclassified audio or video device. 2720 * 2721 * @syscap SystemCapability.Communication.Bluetooth.Core 2722 * @since 8 2723 * @deprecated since 9 2724 */ 2725 AUDIO_VIDEO_UNCATEGORIZED = 0x0400, 2726 /** 2727 * Wearable audio or video headset. 2728 * 2729 * @syscap SystemCapability.Communication.Bluetooth.Core 2730 * @since 8 2731 * @deprecated since 9 2732 */ 2733 AUDIO_VIDEO_WEARABLE_HEADSET = 0x0404, 2734 /** 2735 * Hands-free audio or video device. 2736 * 2737 * @syscap SystemCapability.Communication.Bluetooth.Core 2738 * @since 8 2739 * @deprecated since 9 2740 */ 2741 AUDIO_VIDEO_HANDSFREE = 0x0408, 2742 /** 2743 * Audio or video microphone. 2744 * 2745 * @syscap SystemCapability.Communication.Bluetooth.Core 2746 * @since 8 2747 * @deprecated since 9 2748 */ 2749 AUDIO_VIDEO_MICROPHONE = 0x0410, 2750 /** 2751 * Audio or video loudspeaker. 2752 * 2753 * @syscap SystemCapability.Communication.Bluetooth.Core 2754 * @since 8 2755 * @deprecated since 9 2756 */ 2757 AUDIO_VIDEO_LOUDSPEAKER = 0x0414, 2758 /** 2759 * Audio or video headphones. 2760 * 2761 * @syscap SystemCapability.Communication.Bluetooth.Core 2762 * @since 8 2763 * @deprecated since 9 2764 */ 2765 AUDIO_VIDEO_HEADPHONES = 0x0418, 2766 /** 2767 * Portable audio or video device. 2768 * 2769 * @syscap SystemCapability.Communication.Bluetooth.Core 2770 * @since 8 2771 * @deprecated since 9 2772 */ 2773 AUDIO_VIDEO_PORTABLE_AUDIO = 0x041C, 2774 /** 2775 * In-vehicle audio or video device. 2776 * 2777 * @syscap SystemCapability.Communication.Bluetooth.Core 2778 * @since 8 2779 * @deprecated since 9 2780 */ 2781 AUDIO_VIDEO_CAR_AUDIO = 0x0420, 2782 /** 2783 * Audio or video STB device. 2784 * 2785 * @syscap SystemCapability.Communication.Bluetooth.Core 2786 * @since 8 2787 * @deprecated since 9 2788 */ 2789 AUDIO_VIDEO_SET_TOP_BOX = 0x0424, 2790 /** 2791 * High-fidelity speaker device. 2792 * 2793 * @syscap SystemCapability.Communication.Bluetooth.Core 2794 * @since 8 2795 * @deprecated since 9 2796 */ 2797 AUDIO_VIDEO_HIFI_AUDIO = 0x0428, 2798 /** 2799 * Video cassette recording (VCR) device. 2800 * 2801 * @syscap SystemCapability.Communication.Bluetooth.Core 2802 * @since 8 2803 * @deprecated since 9 2804 */ 2805 AUDIO_VIDEO_VCR = 0x042C, 2806 /** 2807 * Camera. 2808 * 2809 * @syscap SystemCapability.Communication.Bluetooth.Core 2810 * @since 8 2811 * @deprecated since 9 2812 */ 2813 AUDIO_VIDEO_VIDEO_CAMERA = 0x0430, 2814 /** 2815 * Camcorder. 2816 * 2817 * @syscap SystemCapability.Communication.Bluetooth.Core 2818 * @since 8 2819 * @deprecated since 9 2820 */ 2821 AUDIO_VIDEO_CAMCORDER = 0x0434, 2822 /** 2823 * Audio or video monitor. 2824 * 2825 * @syscap SystemCapability.Communication.Bluetooth.Core 2826 * @since 8 2827 * @deprecated since 9 2828 */ 2829 AUDIO_VIDEO_VIDEO_MONITOR = 0x0438, 2830 /** 2831 * Video display or loudspeaker. 2832 * 2833 * @syscap SystemCapability.Communication.Bluetooth.Core 2834 * @since 8 2835 * @deprecated since 9 2836 */ 2837 AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER = 0x043C, 2838 /** 2839 * Video conferencing device. 2840 * 2841 * @syscap SystemCapability.Communication.Bluetooth.Core 2842 * @since 8 2843 * @deprecated since 9 2844 */ 2845 AUDIO_VIDEO_VIDEO_CONFERENCING = 0x0440, 2846 /** 2847 * Audio or video gaming toy. 2848 * 2849 * @syscap SystemCapability.Communication.Bluetooth.Core 2850 * @since 8 2851 * @deprecated since 9 2852 */ 2853 AUDIO_VIDEO_VIDEO_GAMING_TOY = 0x0448, 2854 2855 /** 2856 * Peripheral Major Class 2857 * 2858 * @syscap SystemCapability.Communication.Bluetooth.Core 2859 * @since 8 2860 * @deprecated since 9 2861 */ 2862 PERIPHERAL_NON_KEYBOARD_NON_POINTING = 0x0500, 2863 /** 2864 * Keyboard device. 2865 * 2866 * @syscap SystemCapability.Communication.Bluetooth.Core 2867 * @since 8 2868 * @deprecated since 9 2869 */ 2870 PERIPHERAL_KEYBOARD = 0x0540, 2871 /** 2872 * Pointing peripheral device. 2873 * 2874 * @syscap SystemCapability.Communication.Bluetooth.Core 2875 * @since 8 2876 * @deprecated since 9 2877 */ 2878 PERIPHERAL_POINTING_DEVICE = 0x0580, 2879 /** 2880 * Keyboard pointing device. 2881 * 2882 * @syscap SystemCapability.Communication.Bluetooth.Core 2883 * @since 8 2884 * @deprecated since 9 2885 */ 2886 PERIPHERAL_KEYBOARD_POINTING = 0x05C0, 2887 /** 2888 * Unclassified peripheral device. 2889 * 2890 * @syscap SystemCapability.Communication.Bluetooth.Core 2891 * @since 8 2892 * @deprecated since 9 2893 */ 2894 PERIPHERAL_UNCATEGORIZED = 0x0500, 2895 /** 2896 * Peripheral joystick. 2897 * 2898 * @syscap SystemCapability.Communication.Bluetooth.Core 2899 * @since 8 2900 * @deprecated since 9 2901 */ 2902 PERIPHERAL_JOYSTICK = 0x0504, 2903 /** 2904 * Peripheral game pad. 2905 * 2906 * @syscap SystemCapability.Communication.Bluetooth.Core 2907 * @since 8 2908 * @deprecated since 9 2909 */ 2910 PERIPHERAL_GAMEPAD = 0x0508, 2911 /** 2912 * Peripheral remote control device. 2913 * 2914 * @syscap SystemCapability.Communication.Bluetooth.Core 2915 * @since 8 2916 * @deprecated since 9 2917 */ 2918 PERIPHERAL_REMOTE_CONTROL = 0x05C0, 2919 /** 2920 * Peripheral sensing device. 2921 * 2922 * @syscap SystemCapability.Communication.Bluetooth.Core 2923 * @since 8 2924 * @deprecated since 9 2925 */ 2926 PERIPHERAL_SENSING_DEVICE = 0x0510, 2927 /** 2928 * Peripheral digitizer tablet. 2929 * 2930 * @syscap SystemCapability.Communication.Bluetooth.Core 2931 * @since 8 2932 * @deprecated since 9 2933 */ 2934 PERIPHERAL_DIGITIZER_TABLET = 0x0514, 2935 /** 2936 * Peripheral card reader. 2937 * 2938 * @syscap SystemCapability.Communication.Bluetooth.Core 2939 * @since 8 2940 * @deprecated since 9 2941 */ 2942 PERIPHERAL_CARD_READER = 0x0518, 2943 /** 2944 * Peripheral digital pen. 2945 * 2946 * @syscap SystemCapability.Communication.Bluetooth.Core 2947 * @since 8 2948 * @deprecated since 9 2949 */ 2950 PERIPHERAL_DIGITAL_PEN = 0x051C, 2951 /** 2952 * Peripheral RFID scanner. 2953 * 2954 * @syscap SystemCapability.Communication.Bluetooth.Core 2955 * @since 8 2956 * @deprecated since 9 2957 */ 2958 PERIPHERAL_SCANNER_RFID = 0x0520, 2959 /** 2960 * Gesture input device. 2961 * 2962 * @syscap SystemCapability.Communication.Bluetooth.Core 2963 * @since 8 2964 * @deprecated since 9 2965 */ 2966 PERIPHERAL_GESTURAL_INPUT = 0x0522, 2967 2968 /** 2969 * Imaging Major Class 2970 * 2971 * @syscap SystemCapability.Communication.Bluetooth.Core 2972 * @since 8 2973 * @deprecated since 9 2974 */ 2975 IMAGING_UNCATEGORIZED = 0x0600, 2976 /** 2977 * Imaging display device. 2978 * 2979 * @syscap SystemCapability.Communication.Bluetooth.Core 2980 * @since 8 2981 * @deprecated since 9 2982 */ 2983 IMAGING_DISPLAY = 0x0610, 2984 /** 2985 * Imaging camera device. 2986 * 2987 * @syscap SystemCapability.Communication.Bluetooth.Core 2988 * @since 8 2989 * @deprecated since 9 2990 */ 2991 IMAGING_CAMERA = 0x0620, 2992 /** 2993 * Imaging scanner. 2994 * 2995 * @syscap SystemCapability.Communication.Bluetooth.Core 2996 * @since 8 2997 * @deprecated since 9 2998 */ 2999 IMAGING_SCANNER = 0x0640, 3000 /** 3001 * Imaging printer. 3002 * 3003 * @syscap SystemCapability.Communication.Bluetooth.Core 3004 * @since 8 3005 * @deprecated since 9 3006 */ 3007 IMAGING_PRINTER = 0x0680, 3008 3009 /** 3010 * Wearable Major Class 3011 * 3012 * @syscap SystemCapability.Communication.Bluetooth.Core 3013 * @since 8 3014 * @deprecated since 9 3015 */ 3016 WEARABLE_UNCATEGORIZED = 0x0700, 3017 /** 3018 * Smart watch. 3019 * 3020 * @syscap SystemCapability.Communication.Bluetooth.Core 3021 * @since 8 3022 * @deprecated since 9 3023 */ 3024 WEARABLE_WRIST_WATCH = 0x0704, 3025 /** 3026 * Wearable pager. 3027 * 3028 * @syscap SystemCapability.Communication.Bluetooth.Core 3029 * @since 8 3030 * @deprecated since 9 3031 */ 3032 WEARABLE_PAGER = 0x0708, 3033 /** 3034 * Smart jacket. 3035 * 3036 * @syscap SystemCapability.Communication.Bluetooth.Core 3037 * @since 8 3038 * @deprecated since 9 3039 */ 3040 WEARABLE_JACKET = 0x070C, 3041 /** 3042 * Wearable helmet. 3043 * 3044 * @syscap SystemCapability.Communication.Bluetooth.Core 3045 * @since 8 3046 * @deprecated since 9 3047 */ 3048 WEARABLE_HELMET = 0x0710, 3049 /** 3050 * Wearable glasses. 3051 * 3052 * @syscap SystemCapability.Communication.Bluetooth.Core 3053 * @since 8 3054 * @deprecated since 9 3055 */ 3056 WEARABLE_GLASSES = 0x0714, 3057 3058 /** 3059 * Minor Device Class field - Toy Major Class 3060 * 3061 * @syscap SystemCapability.Communication.Bluetooth.Core 3062 * @since 8 3063 * @deprecated since 9 3064 */ 3065 TOY_UNCATEGORIZED = 0x0800, 3066 /** 3067 * Toy robot. 3068 * 3069 * @syscap SystemCapability.Communication.Bluetooth.Core 3070 * @since 8 3071 * @deprecated since 9 3072 */ 3073 TOY_ROBOT = 0x0804, 3074 /** 3075 * Toy vehicle. 3076 * 3077 * @syscap SystemCapability.Communication.Bluetooth.Core 3078 * @since 8 3079 * @deprecated since 9 3080 */ 3081 TOY_VEHICLE = 0x0808, 3082 /** 3083 * Humanoid toy doll. 3084 * 3085 * @syscap SystemCapability.Communication.Bluetooth.Core 3086 * @since 8 3087 * @deprecated since 9 3088 */ 3089 TOY_DOLL_ACTION_FIGURE = 0x080C, 3090 /** 3091 * Toy controller. 3092 * 3093 * @syscap SystemCapability.Communication.Bluetooth.Core 3094 * @since 8 3095 * @deprecated since 9 3096 */ 3097 TOY_CONTROLLER = 0x0810, 3098 /** 3099 * Toy gaming device. 3100 * 3101 * @syscap SystemCapability.Communication.Bluetooth.Core 3102 * @since 8 3103 * @deprecated since 9 3104 */ 3105 TOY_GAME = 0x0814, 3106 3107 /** 3108 * Minor Device Class field - Health 3109 * 3110 * @syscap SystemCapability.Communication.Bluetooth.Core 3111 * @since 8 3112 * @deprecated since 9 3113 */ 3114 HEALTH_UNCATEGORIZED = 0x0900, 3115 /** 3116 * Blood pressure device. 3117 * 3118 * @syscap SystemCapability.Communication.Bluetooth.Core 3119 * @since 8 3120 * @deprecated since 9 3121 */ 3122 HEALTH_BLOOD_PRESSURE = 0x0904, 3123 /** 3124 * Thermometer. 3125 * 3126 * @syscap SystemCapability.Communication.Bluetooth.Core 3127 * @since 8 3128 * @deprecated since 9 3129 */ 3130 HEALTH_THERMOMETER = 0x0908, 3131 /** 3132 * Body scale. 3133 * 3134 * @syscap SystemCapability.Communication.Bluetooth.Core 3135 * @since 8 3136 * @deprecated since 9 3137 */ 3138 HEALTH_WEIGHING = 0x090C, 3139 /** 3140 * Blood glucose monitor. 3141 * 3142 * @syscap SystemCapability.Communication.Bluetooth.Core 3143 * @since 8 3144 * @deprecated since 9 3145 */ 3146 HEALTH_GLUCOSE = 0x0910, 3147 /** 3148 * Pulse oximeter. 3149 * 3150 * @syscap SystemCapability.Communication.Bluetooth.Core 3151 * @since 8 3152 * @deprecated since 9 3153 */ 3154 HEALTH_PULSE_OXIMETER = 0x0914, 3155 /** 3156 * Heart rate monitor. 3157 * 3158 * @syscap SystemCapability.Communication.Bluetooth.Core 3159 * @since 8 3160 * @deprecated since 9 3161 */ 3162 HEALTH_PULSE_RATE = 0x0918, 3163 /** 3164 * Health data display. 3165 * 3166 * @syscap SystemCapability.Communication.Bluetooth.Core 3167 * @since 8 3168 * @deprecated since 9 3169 */ 3170 HEALTH_DATA_DISPLAY = 0x091C, 3171 /** 3172 * Step counter. 3173 * 3174 * @syscap SystemCapability.Communication.Bluetooth.Core 3175 * @since 8 3176 * @deprecated since 9 3177 */ 3178 HEALTH_STEP_COUNTER = 0x0920, 3179 /** 3180 * Body composition analyzer. 3181 * 3182 * @syscap SystemCapability.Communication.Bluetooth.Core 3183 * @since 8 3184 * @deprecated since 9 3185 */ 3186 HEALTH_BODY_COMPOSITION_ANALYZER = 0x0924, 3187 /** 3188 * Hygrometer. 3189 * 3190 * @syscap SystemCapability.Communication.Bluetooth.Core 3191 * @since 8 3192 * @deprecated since 9 3193 */ 3194 HEALTH_PEAK_FLOW_MOITOR = 0x0928, 3195 /** 3196 * Medication monitor. 3197 * 3198 * @syscap SystemCapability.Communication.Bluetooth.Core 3199 * @since 8 3200 * @deprecated since 9 3201 */ 3202 HEALTH_MEDICATION_MONITOR = 0x092C, 3203 /** 3204 * Prosthetic knee. 3205 * 3206 * @syscap SystemCapability.Communication.Bluetooth.Core 3207 * @since 8 3208 * @deprecated since 9 3209 */ 3210 HEALTH_KNEE_PROSTHESIS = 0x0930, 3211 /** 3212 * Prosthetic ankle. 3213 * 3214 * @syscap SystemCapability.Communication.Bluetooth.Core 3215 * @since 8 3216 * @deprecated since 9 3217 */ 3218 HEALTH_ANKLE_PROSTHESIS = 0x0934, 3219 /** 3220 * Generic health management device. 3221 * 3222 * @syscap SystemCapability.Communication.Bluetooth.Core 3223 * @since 8 3224 * @deprecated since 9 3225 */ 3226 HEALTH_GENERIC_HEALTH_MANAGER = 0x0938, 3227 /** 3228 * Personal mobility device. 3229 * 3230 * @syscap SystemCapability.Communication.Bluetooth.Core 3231 * @since 8 3232 * @deprecated since 9 3233 */ 3234 HEALTH_PERSONAL_MOBILITY_DEVICE = 0x093C 3235 } 3236 3237 /** 3238 * Profile state change parameters. 3239 * 3240 * @typedef StateChangeParam 3241 * @syscap SystemCapability.Communication.Bluetooth.Core 3242 * @since 8 3243 * @deprecated since 9 3244 * @useinstead ohos.bluetoothManager/bluetoothManager.StateChangeParam 3245 */ 3246 interface StateChangeParam { 3247 /** 3248 * The address of device 3249 * 3250 * @syscap SystemCapability.Communication.Bluetooth.Core 3251 * @since 8 3252 * @deprecated since 9 3253 */ 3254 deviceId: string; 3255 3256 /** 3257 * Profile state value 3258 * 3259 * @syscap SystemCapability.Communication.Bluetooth.Core 3260 * @since 8 3261 * @deprecated since 9 3262 */ 3263 state: ProfileConnectionState; 3264 } 3265 3266 /** 3267 * The enum of a2dp playing state. 3268 * 3269 * @enum { number } 3270 * @syscap SystemCapability.Communication.Bluetooth.Core 3271 * @since 8 3272 * @deprecated since 9 3273 * @useinstead ohos.bluetoothManager/bluetoothManager.PlayingState 3274 */ 3275 enum PlayingState { 3276 /** 3277 * Not playing. 3278 * 3279 * @syscap SystemCapability.Communication.Bluetooth.Core 3280 * @since 8 3281 * @deprecated since 9 3282 */ 3283 STATE_NOT_PLAYING, 3284 /** 3285 * Playing. 3286 * 3287 * @syscap SystemCapability.Communication.Bluetooth.Core 3288 * @since 8 3289 * @deprecated since 9 3290 */ 3291 STATE_PLAYING 3292 } 3293 3294 /** 3295 * The enum of profile id. 3296 * 3297 * @enum { number } 3298 * @syscap SystemCapability.Communication.Bluetooth.Core 3299 * @since 7 3300 * @deprecated since 9 3301 * @useinstead ohos.bluetoothManager/bluetoothManager.ProfileId 3302 */ 3303 enum ProfileId { 3304 /** 3305 * A2DP profile. 3306 * 3307 * @syscap SystemCapability.Communication.Bluetooth.Core 3308 * @since 8 3309 * @deprecated since 9 3310 */ 3311 PROFILE_A2DP_SOURCE = 1, 3312 3313 /** 3314 * HFP profile. 3315 * 3316 * @syscap SystemCapability.Communication.Bluetooth.Core 3317 * @since 8 3318 * @deprecated since 9 3319 */ 3320 PROFILE_HANDS_FREE_AUDIO_GATEWAY = 4 3321 } 3322} 3323 3324export default bluetooth; 3325