Skip to main content

Bluetooth services and protocols

Application code normally does not construct a device driver. Use BTProvider for the session and choose a declaration from IntegratedDevices or SUPPORTED_DEVICES. For a protocol that is not in the catalog, use defineCustomDevice when its wire format fits the declarative model.

App-facing boundary​

  • BTProvider owns permission checks, manager wiring, scanning, runtime events, and teardown.
  • BTManager is public for integrations that must own the session lifecycle directly. It does not request permissions or provide the React provider context.
  • BTManagedDevice instances are received from the manager's discovery callback; apps should not create them directly.
  • AcceptedDevice is a built-in key or a validated custom declaration.
  • BluetoothError and BluetoothErrorCode describe normalized Bluetooth failures.

The module barrel also exports protocol factories and helpers for specific standard and vendor formats. Treat those as protocol-level APIs; for ordinary app flows, the curated device catalog is the safer pairing of name match, decoder, and measurement types.

Custom protocol boundary​

The declarative API supports fixed GATT declarations, framed notifications, checksums, measurement fields, repeated history records, and static write commands. The special lepu declaration handles the supported Lepu/Viatom framed protocol.

A device that requires protocol steps not expressible by these declarations needs a driver in the SDK. Do not solve that by starting a second native scan loop or by depending on private parser state.

See Bluetooth device types, custom devices, advanced usage, and the Bluetooth guide.