Skip to main content

Bluetooth management

The Bluetooth module is the runtime and protocol layer behind BLE discovery and measurement delivery. Its public React entry point is BTProvider; its SDK subpath is @ovok/native/bt-management.

Choose an entry point​

NeedAPI
Start a BLE sessionBTProvider with a stable BleManager and an acceptedDevices tuple
Respond to discovery and readingsonDeviceFound, onDeviceStatusChanged, onConnectionEvent, onResult, and onError
Ask users to choose among discoveriesautoConnect, onDeviceSelectionRequired, and BluetoothDevicePicker
Inspect runtime state in a componentuseNearbyDevices, useDeviceConnection, useMeasurements, useScanControl, and useRuntimeEvent
Remember pairingsusePairedDevices with app-provided key-value storage
Use an SDK protocolIntegratedDevices or an entry from SUPPORTED_DEVICES
Add a new protocoldefineCustomDevice and a custom device declaration
Deliver readings while backgroundedbackgroundSync configuration and native setup

Runtime lifecycle​

BTProvider requests permissions and displays a permission fallback when access is missing. Once access is granted and acceptedDevices is non-empty, the provider creates BTManager, installs its callbacks, and begins scanning. The manager is destroyed when the provider unmounts or its core configuration changes.

Keep both the BleManager and acceptedDevices stable. Recreating either during render can restart a session. The provider owns scanning and managed device subscriptions; application code owns the manager object, result persistence, patient association, and application-specific UI.

Component and API reference​

For an end-to-end flow, start with the Bluetooth guide.