/webbluetooth

Node.js implementation of the Web Bluetooth Specification

Primary LanguageTypeScriptMIT LicenseMIT

Node Web Bluetooth

Node.js implementation of the Web Bluetooth Specification

Circle CI npm Licence MIT

Prerequisites

Node.js > v8.14.0, which includes npm.

Installation

$ npm install webbluetooth

Getting Started

See the examples or view the API documentation at:

https://thegecko.github.io/webbluetooth/

Specification

The Web Bluetooth specification can be found here:

https://webbluetoothcg.github.io/web-bluetooth/

Implementation Status

bluetooth

  • referringDevice - specification unstable
  • getAvailability() - specification unstable
  • requestDevice()
  • getDevices()
  • RequestDeviceOptions.name
  • RequestDeviceOptions.namePrefix
  • RequestDeviceOptions.services
  • RequestDeviceOptions.optionalServices
  • RequestDeviceOptions.acceptAllDevices
  • RequestDeviceOptions.manufacturerData - specification unstable
  • RequestDeviceOptions.serviceData - specification unstable

BluetoothDevice

  • id
  • name
  • gatt
  • watchingAdvertisements - specification unstable
  • watchAdvertisements() - specification unstable
  • unwatchAdvertisements() - specification unstable

BluetoothRemoteGATTServer

  • connected
  • device
  • connect()
  • disconnect()
  • getPrimaryService()
  • getPrimaryServices()

BluetoothRemoteGATTService

  • device
  • uuid
  • isPrimary
  • getCharacteristic()
  • getCharacteristics()
  • getIncludedService()
  • getIncludedServices()

BluetoothRemoteGATTCharacteristic

  • service
  • uuid
  • properties
  • value
  • getDescriptor()
  • getDescriptors()
  • readValue()
  • writeValue()
  • writeValueWithResponse()
  • writeValueWithoutResponse()
  • startNotifications()
  • stopNotifications()

BluetoothRemoteGATTDescriptor

  • characteristic
  • uuid
  • value
  • readValue()
  • writeValue()

Events

Bluetooth

  • availabilitychanged

Bluetooth Device

  • gattserverdisconnected
  • advertisementreceived - specification unstable

Bluetooth Service

  • serviceadded
  • servicechanged - unsupported in noble
  • serviceremoved - unsupported in noble

Bluetooth Characteristic

  • characteristicvaluechanged

Other

  • Device selector hook
  • Lookups for known services, characteristics and descriptors
  • Canonical UUID helper
  • Examples
  • API Documentation