Skip to main content

Bluetooth management

The Bluetooth module connects an app to medical peripherals over BLE. It is integration-agnostic: the app chooses which devices to accept, when to connect, where to save readings, and whether to deliver them to a backend.

Public entry points​

  • BTProvider owns a React scan flow.
  • BTManager is the direct imperative API.
  • SUPPORTED_DEVICES is the catalog of ready-to-use declarations and localized display metadata.
  • defineCustomDevice validates a declarative protocol for hardware not built into the SDK.
  • useBluetoothState, useNearbyDevices, usePairedDevices, useDeviceConnection, useMeasurements, useBackgroundSync, and useBTDevice are opt-in Bluetooth runtime hooks.
  • useHealthImport and useHealthAuthorization are exported by @ovok/native/data-sync.
  • createFakeBleManager and recorded-frame helpers support deterministic tests.

Event model​

Discovery calls onDeviceFound. The app may connect that device. A successful connection and measurement produce status/result callbacks; failures use the typed Bluetooth error envelope. The SDK does not add account, patient, upload, or clinical policy to those events.

Platform responsibilities​

The host app must configure the native BLE permissions, keep its manager alive for the required flow, and follow iOS/Android background-execution rules. Use the Bluetooth integration guide and background sync guide for the platform setup.

What is not public​

Internal device classes, parser state, scan implementations, and protocol-specific sequencers are not application contracts. Use the exported factory or declaration for a device; do not copy an internal class from the source tree.