Skip to main content

BluetoothRemoteGATTDescriptor

BFChainInterfaceBluetoothRemoteGATTDescriptorLess than 1 minute

The description interface of a certain service characteristic of the Bluetooth device; the instance of this interface can only be obtained through BluetoothRemoteGATTCharacteristic.getDescriptor()

Property

  • characteristic

    The current description belongs to the characteristic; the attribute value is a BluetoothRemoteGATTCharacteristic object;

  • uuid

    The current feature describes the descriptor of the feature to which the object belongs;
    The attribute value is a string

Method

Event

  • none

Example

  import { bluetoothPlugin } from "@plaoc/plugins";

  bluetoothPlugin
  .open()
  .then(res => {
    if(res.success){
      const options = {
        acceptAllDevices: true,
        optionalServices: ["00003802-0000-1000-8000-00805f9b34fb"],
      }
      return bluetoothPlugin.requestAndConnectDevice(options)
    }
  })
  .then(res => {
    if(res.success){
      // 成功的查询和连接了蓝牙设备;
      const bluetoothRemoteGATTServer = res.data;
      return bluetoothRemoteGATTServer
      .getPrimaryService("00003802-0000-1000-8000-00805f9b34fb")
    }
  })
  .then(res => {
    if(res.success){
      const bluetoothRemoteGATTService = res.data;
      bluetoothRemoteGATTService.getCharacteristic("00004a02-0000-1000-8000-00805f9b34fb")
    }
  })
  .then(res => {
    if(res.success){
      const bluetoothRemoteGATTCharacteristic = res.data;
      return bluetoothRemoteGATTCharacteristic.getDescriptor()
      // 获取了 特征的 标识符;
    }
  })
  .catch(err => console.error(err))

Platform Compatibility

Property/Method/EventAndroidIOSDesktop-DevDesktop
characteristicX
uuidX
readValueX
writeValueX

BluetoothPlugin

BluetoothRemoteGATTService;

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.15.7