Skip to main content

BluetoothRemoteGATTServer

BFChainInterfaceBluetoothRemoteGATTServerLess than 1 minute

The BluetoothRemoteGATTServer interface is used to describe the server object provided by the connected Bluetooth device;

Property

  • device

    The attribute value is an object of type BluetoothDevice;

  • connected

    Whether the server of the Bluetooth device is connected;
    The attribute value is boolean; the attribute value is true means that the service of the current Bluetooth device has been connected
    If the attribute value is false, it means that the service of the current Bluetooth device is not connected;

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;
    }
  })
  .catch(err => console.error(err))

Platform Compatibility

Property/Method/EventAndroidIOSDesktop-DevDesktop
deviceX
connectedX
connectX
disconnectX
getPrimaryServiceX

BluetoothPlugin

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