@ovok/native/next/bluetooth

Bluetooth for `@ovok/native/next`, in layers: the framework-free `BluetoothRuntime` and its ports, device drivers,

  • Stable unknown
  • Release candidate not available
  • Development not available

Bluetooth for @ovok/native/next, in layers: the framework-free BluetoothRuntime and its ports, device drivers, the react-native-ble-plx and React Native adapters, React hooks over the runtime, and optional UI built only from those hooks.

Import from @ovok/native/next/bluetooth.

Components

BluetoothDevicePicker()

function BluetoothDevicePicker(__namedParameters): Element;

A bottom sheet listing the found devices; picking one connects to it. Built only from public hooks.

Parameters

ParameterType
__namedParametersBluetoothDevicePickerProps

Returns

Element


BluetoothProvider()

function BluetoothProvider(__namedParameters): Element;

Gives the Bluetooth hooks below it a runtime.

Parameters

ParameterType
__namedParametersBluetoothProviderProps

Returns

Element

Hooks

useBluetooth()

function useBluetooth(): BluetoothRuntime;

The runtime of the enclosing BluetoothProvider: every Bluetooth action is a call on it.

Returns

BluetoothRuntime

Throws

When rendered outside BluetoothProvider.


useBluetoothPermission()

function useBluetoothPermission(): "unknown" | BluetoothPermission;

The Bluetooth permission, re-checked whenever the app returns to the foreground; unknown until first checked.

Returns

"unknown" | BluetoothPermission


useBluetoothState()

function useBluetoothState(): AdapterState;

The Bluetooth adapter state.

Returns

AdapterState


useMeasurements()

function useMeasurements(): readonly DeviceReading[];

The recent readings, oldest first, each with its save state.

Returns

readonly DeviceReading[]


useNearbyDevice()

function useNearbyDevice(deviceId): NearbyDevice | null;

One found device, or null until the scan finds it.

Parameters

ParameterType
deviceIdstring

Returns

NearbyDevice | null


useNearbyDevices()

function useNearbyDevices(): readonly NearbyDevice[];

The supported devices the scan found, each with its connection state.

Returns

readonly NearbyDevice[]


usePairedDevices()

function usePairedDevices(): readonly string[];

IDs of the paired devices.

Returns

readonly string[]


useScanning()

function useScanning(): boolean;

Whether a scan is requested.

Returns

boolean

Classes

BluetoothError

Every failure the Bluetooth runtime reports; cause holds the underlying error, when any.

Extends

  • Error

Constructors

Constructor
new BluetoothError(
   code,
   message,
   cause?
): BluetoothError;
Parameters
ParameterTypeDescription
codeBluetoothErrorCodeWhy it failed.
messagestring-
cause?unknown-
Returns

BluetoothError

Overrides

Error.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverrides
codepublic readonlyBluetoothErrorCodeundefinedWhy it failed.-
namepublic readonly"BluetoothError""BluetoothError"Always "BluetoothError".Error.name

BluetoothRuntime

Scans for supported devices, connects to them, collects their readings and saves each one. Framework-free: React hooks and components sit on top of it. Every failure is a BluetoothError. Call dispose() when done.

Constructors

Constructor
new BluetoothRuntime(options): BluetoothRuntime;
Parameters
ParameterType
optionsBluetoothRuntimeOptions
Returns

BluetoothRuntime

Methods

checkPermission()
checkPermission(): Promise<BluetoothPermission>;

Reads the permission without prompting.

Returns

Promise<BluetoothPermission>

connect()
connect(deviceId): Promise<void>;

Connects to a found device for this session; resolves once connected.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

Throws

BluetoothError device-not-found, connection-failed or the driver's failure.

disconnect()
disconnect(deviceId): Promise<void>;

Disconnects a device; a paired one stays disconnected until connect or pair is called again.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

dispose()
dispose(): Promise<void>;

Stops scanning and disconnects every device; resolves once they have disconnected, after which nothing changes.

Returns

Promise<void>

forget()
forget(deviceId): Promise<void>;

Forgets a paired device and disconnects it.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

getSnapshot()
getSnapshot(): BluetoothSnapshot;

The current state.

Returns

BluetoothSnapshot

openPermissionSettings()
openPermissionSettings(): Promise<void>;

Opens the app's system settings, where a blocked permission can be granted.

Returns

Promise<void>

pair()
pair(deviceId): Promise<void>;

Remembers a device, so it connects whenever the scan finds it, and connects to it now.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

requestPermission()
requestPermission(): Promise<BluetoothPermission>;

Prompts for the permission when the OS still can.

Returns

Promise<BluetoothPermission>

retrySaves()
retrySaves(): Promise<void>;

Saves the readings whose save failed again, and the readings the sink queued offline.

Returns

Promise<void>

startScan()
startScan(): Promise<void>;

Asks for permission when needed, then scans whenever the adapter is on, until stopScan.

Returns

Promise<void>

Throws

BluetoothError permission-denied when permission is not granted; runtime-disposed after dispose.

stopRecording()
stopRecording(deviceId): Promise<void>;

Stops the recording a connected recorder holds open, for instance once the user confirms it while its recording.leadOffSince is set. The stored recording then arrives as a reading.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

Throws

BluetoothError no-open-recording when the device holds none; runtime-disposed after dispose.

stopScan()
stopScan(): void;

Stops scanning; connected devices stay connected.

Returns

void

subscribe()
subscribe(listener): () => void;

Calls listener after every state change; returns the unsubscribe.

Parameters
ParameterType
listener() => void
Returns

() => void

subscribeWaveform()
subscribeWaveform(listener): () => void;

Calls listener with the live ECG samples of recording devices, for display; returns the unsubscribe.

Parameters
ParameterType
listener(waveform) => void
Returns

() => void

syncHistory()
syncHistory(deviceId): Promise<void>;

Reads the records a device stored, connecting it first when it is not connected. One that readsHistoryOnRequest reads them over its connection, even while it measures; any other is reconnected, since it reads them each time it connects.

Parameters
ParameterType
deviceIdstring
Returns

Promise<void>

Throws

BluetoothError as connect does; runtime-disposed after dispose.

Functions

acceptedMemorySlots()

function acceptedMemorySlots(slots): ResultPolicy;

Keeps the readings of the device users in slots (a multi-user device reports its user as memorySlot, starting at 1), and drops the others. A reading that names no device user is kept.

Parameters

ParameterType
slotsreadonly number[]

Returns

ResultPolicy


bleManagerScanner()

function bleManagerScanner(bleManager): BluetoothScanner;

A scanner over a react-native-ble-plx BleManager.

Parameters

ParameterType
bleManagerBleManager

Returns

BluetoothScanner


builtInDevices()

function builtInDevices(accepted, __namedParameters?): DeviceSupport;

Support for the SDK's integrated devices and defineCustomDevice declarations, over react-native-ble-plx.

Parameters

ParameterType
acceptedreadonly AcceptedDevice[]
__namedParameters?BuiltInDevicesOptions

Returns

DeviceSupport


createBluetoothRuntime()

function createBluetoothRuntime(__namedParameters): BluetoothRuntime;

A BluetoothRuntime wired for React Native: BLE through bleManager, OS permissions, saving through client.

Parameters

ParameterType
__namedParametersCreateBluetoothRuntimeOptions

Returns

BluetoothRuntime


defineDevice()

function defineDevice(__namedParameters): DeviceSupport;

Support for one device a third party defines with its own protocol.

Parameters

ParameterType
__namedParametersDeviceDefinition

Returns

DeviceSupport


keepReadings()

function keepReadings(events, policy): AsyncIterable<DeviceEvent>;

A driver's events minus the readings policy drops.

Parameters

ParameterType
eventsAsyncIterable<DeviceEvent>
policyResultPolicy

Returns

AsyncIterable<DeviceEvent>


osBluetoothPermissions()

function osBluetoothPermissions(): BluetoothPermissions;

The platform's Bluetooth permissions through react-native-permissions.

Returns

BluetoothPermissions


ovokReadingSink()

function ovokReadingSink(client): ReadingSink;

Saves readings for the signed-in account through the Ovok measurements API.

Parameters

ParameterType
clientPick<Ovok, "measurements">

Returns

ReadingSink


policyByKind()

function policyByKind(policies, fallback?): ResultPolicy;

Applies a policy per measurement type, and fallback to the other types.

Parameters

ParameterTypeDefault value
policiesPartial<Record<MeasurementTypeKey, ResultPolicy>>undefined
fallback?ResultPolicyeveryReading

Returns

ResultPolicy

Interfaces

BluetoothDevicePickerProps

Props of BluetoothDevicePicker.

Extends

Properties

PropertyTypeDescriptionInherited from
dismissLabel?stringDismiss button label; defaults to "Not now".-
getDeviceImage?(device) => string | undefinedReturns an image URI for a device, shown in its default row.-
labelForDevice?(device) => stringReturns the display name of a device; defaults to its advertised name.-
onDismiss?() => voidCalled when the user dismisses the picker; the dismiss button only renders when provided.-
onSelect?(device) => voidCalled with the picked device once the connection starts; its outcome shows on device.connection.-
renderRow?(device, actions) => ReactNodeRenders a custom row; return undefined to fall back to the default row.-
slots?Partial<OvokUiSlots>Replace individual primitives without forking an SDK component.OvokUiProps.slots
testID?stringTest identifier of the modal; the backdrop gets the -backdrop suffix.-
theme?OvokThemeOverrideA partial theme is merged with the active react-native-paper theme.OvokUiProps.theme
title?stringHeading text; defaults to "Choose a device".-
visiblebooleanWhether the picker is shown.-

BluetoothPermissions

The OS permission prompts Bluetooth needs.

Methods

check()
check(): Promise<BluetoothPermission>;

The current permission, without prompting.

Returns

Promise<BluetoothPermission>

openSettings()
openSettings(): Promise<void>;

Opens the app's system settings, where a blocked permission can be granted.

Returns

Promise<void>

request()
request(): Promise<BluetoothPermission>;

Prompts for the permission when the OS still can, and resolves to the outcome.

Returns

Promise<BluetoothPermission>


BluetoothScanner

The BLE adapter as the runtime uses it: its state and scanning.

Extended by

Methods

scan()
scan(onFound, onError): () => void;

Reports peripherals until the returned stop is called; onError may be called before scan returns.

Parameters
ParameterType
onFound(peripheral) => void
onError(error) => void
Returns

() => void

watchState()
watchState(listener): () => void;

Reports the adapter state now and on every change; returns the unsubscribe.

Parameters
ParameterType
listener(state) => void
Returns

() => void


DeviceSupport

Recognises peripherals by their advertisement.

Methods

match()
match(advertisement): DeviceMatch | undefined;

The match for a peripheral this support handles, or undefined.

Parameters
ParameterType
advertisementAdvertisement
Returns

DeviceMatch | undefined


ReadingSink

Where readings are saved.

Methods

flushQueued()
flushQueued(): Promise<readonly string[]>;

Retries the queued readings; resolves to the queue IDs now saved.

Returns

Promise<readonly string[]>

save()
save(reading): Promise<SaveResult>;

Saves one reading, or queues it offline; the same reading may be saved again after a failure.

Parameters
ParameterType
readingDeviceReading
Returns

Promise<SaveResult>

Type Aliases

AdapterState

type AdapterState = "unknown" | "on" | "off" | "unauthorized" | "unsupported";

Bluetooth adapter state; unknown until the platform reports it.


type Advertisement = object;

What a scanned peripheral advertises.

Properties

manufacturerData
manufacturerData: string | null;

Advertised manufacturer data, base64 encoded, or null.

name
name: string;

Advertised name, or the iOS local name when the name is not known yet; empty when neither is.

serviceUUIDs
serviceUUIDs: readonly string[];

Advertised service UUIDs.


BluetoothErrorCode

type BluetoothErrorCode =
  | "permission-denied"
  | "powered-off"
  | "unsupported"
  | "scan-failed"
  | "connection-failed"
  | "pairing-required"
  | "discovery-failed"
  | "device-error"
  | "frame-invalid"
  | "measurement-failed"
  | "device-not-found"
  | "no-open-recording"
  | "runtime-disposed"
  | "save-failed"
  | "unknown";

Why a Bluetooth operation failed.


BluetoothPermission

type BluetoothPermission = "granted" | "denied" | "blocked";

Whether the app may use Bluetooth; blocked means only the system settings can grant it.


BluetoothProviderProps

type BluetoothProviderProps = React.PropsWithChildren<{
  androidForegroundService?: AndroidBluetoothForegroundServiceOptions;
  onForegroundServiceError?: (error) => void;
  runtime: BluetoothRuntime;
}>;

Props of BluetoothProvider.


BluetoothRuntimeOptions

type BluetoothRuntimeOptions = object;

What a BluetoothRuntime is built from.

Properties

devices
devices: readonly DeviceSupport[];

The devices to look for; the first support that matches a peripheral handles it.

pairedStorage?
pairedStorage?: OvokStorage;

Where the paired device IDs persist; without it pairing lasts until the runtime is disposed.

permissions
permissions: BluetoothPermissions;

The OS permission prompts.

resultPolicy?
resultPolicy?: ResultPolicy;

Which readings of a connection to keep; defaults to every reading.

scanner
scanner: BluetoothScanner;

The BLE adapter.

sink
sink: ReadingSink;

Where readings are saved.


BluetoothSnapshot

type BluetoothSnapshot = object;

Everything the runtime knows, replaced (never mutated) on each change.

Properties

adapter
adapter: AdapterState;

Bluetooth adapter state.

devices
devices: readonly NearbyDevice[];

Supported peripherals found, in discovery order.

paired
paired: readonly string[];

IDs of the paired devices, which connect whenever the scan finds them.

permission
permission: BluetoothPermission | "unknown";

Bluetooth permission; unknown until first checked.

readings
readings: readonly DeviceReading[];

Recent readings, oldest first.

scanError
scanError: BluetoothError | null;

The last scan error, or null; cleared when a scan starts.

scanning
scanning: boolean;

Whether a scan is requested; it runs whenever the adapter is on.


BuiltInDevicesOptions

type BuiltInDevicesOptions = object;

Options for builtInDevices.

Properties

recordCursorStorage?
recordCursorStorage?: OvokStorage;

Where a device that hands over its stored records remembers which it already handed over, so the next connection reads only the others, such as the stored files of a Viatom ER1 or BP2 whose readings were saved or queued. Without it every connection reads them all.


ConnectionState

type ConnectionState =
  | "idle"
  | "connecting"
  | "connected"
  | "measuring"
  | "disconnected"
  | "failed";

Where a device's connection stands.


CreateBluetoothRuntimeOptions

type CreateBluetoothRuntimeOptions = object;

What createBluetoothRuntime needs.

Properties

bleManager
bleManager: BleManager;

The app's react-native-ble-plx manager.

client
client: Ovok;

Saves the readings and keeps the paired devices in its secure storage.

devices
devices: readonly DeviceSupport[];

The devices to look for.

resultPolicy?
resultPolicy?: ResultPolicy;

Which readings of a connection to keep; defaults to every reading.


DeviceDefinition

type DeviceDefinition = object;

A device a third party adds: how to recognise it and the protocol that reads it.

Properties

key
key: string;

Device key reported on its readings; unique among the devices a runtime supports.

matches
matches: (advertisement) => boolean;

Whether an advertisement is this device.

Parameters
ParameterType
advertisementAdvertisement
Returns

boolean

protocol
protocol: DeviceProtocol;

The conversation that turns the device's bytes into readings; give each stored reading its recordedAt.


DeviceEvent

type DeviceEvent =
  | {
  kind: "status";
  status: "connected" | "measuring" | "disconnected";
}
  | {
  information: DeviceInformation;
  kind: "information";
}
  | {
  delivered?: () => void;
  id: string | null;
  kind: "reading";
  reading: Measurement;
}
  | {
  kind: "recording";
  recording: DeviceRecording | null;
  stop: () => Promise<void>;
}
  | {
  kind: "history";
  sync: () => Promise<void>;
}
  | {
  kind: "waveform";
  waveform: Omit<DeviceWaveform, "deviceId">;
}
  | {
  error: BluetoothError;
  kind: "error";
};

What a driver reports while it runs.

Union Members

Type Literal
{
  kind: "status";
  status: "connected" | "measuring" | "disconnected";
}
NameTypeDescription
kind"status"The connection moved on.
status"connected" | "measuring" | "disconnected"Where it stands now.

Type Literal
{
  information: DeviceInformation;
  kind: "information";
}
NameTypeDescription
informationDeviceInformationWhat it reported.
kind"information"The device reported who made it, which model it is and its serial number.

Type Literal
{
  delivered?: () => void;
  id: string | null;
  kind: "reading";
  reading: Measurement;
}
NameTypeDescription
delivered()?() => voidCalled once the reading is saved or queued, so a device can skip the stored record it came from.
idstring | nullNames the reading so a resend is recognised; null when it has none, and then it is never deduplicated.
kind"reading"The device sent a reading.
readingMeasurementThe decoded reading.

Type Literal
{
  kind: "recording";
  recording: DeviceRecording | null;
  stop: () => Promise<void>;
}
NameTypeDescription
kind"recording"The recording the device holds open changed.
recordingDeviceRecording | nullThe open recording, or null once it has closed.
stop()() => Promise<void>Stops the open recording.

Type Literal
{
  kind: "history";
  sync: () => Promise<void>;
}
NameTypeDescription
kind"history"The device keeps the records it stored until asked for them, so connecting does not read them.
sync()() => Promise<void>Reads the records the device stored.

Type Literal
{
  kind: "waveform";
  waveform: Omit<DeviceWaveform, "deviceId">;
}
NameTypeDescription
kind"waveform"The device sent live ECG samples while recording; for display only.
waveformOmit<DeviceWaveform, "deviceId">The samples, without the device, which the runtime adds.

Type Literal
{
  error: BluetoothError;
  kind: "error";
}
NameTypeDescription
errorBluetoothErrorThe error.
kind"error"The device or its protocol reported an error; the connection may continue.

DeviceInformation

type DeviceInformation = object;

What a device's Device Information service reports about it; a field is absent when the device leaves it out.

Properties

manufacturerName?
manufacturerName?: string;

Manufacturer Name String.

model?
model?: string;

Model Number String.

serialNumber?
serialNumber?: string;

Serial Number String.


DeviceMatch

type DeviceMatch = object;

A peripheral a support recognised: the device key its readings carry and the driver that runs it.

Properties

driver
driver: Driver;

The driver that talks to it.

key
key: string;

Device key reported on its readings.


DeviceProtocol

type DeviceProtocol = (link) => AsyncIterable<Measurement>;

One device's conversation over a link, as the readings it produces.

Parameters

ParameterType
linkLink

Returns

AsyncIterable<Measurement>


DeviceReading

type DeviceReading = object;

A reading a device sent, and whether it has been saved.

Properties

device
device: Pick<NearbyDevice, "id" | "key" | "name" | "information">;

The device that sent it.

id
id: string;

Unique; the same for every resend of a stored reading that carries its time.

measurement
measurement: Measurement;

The decoded measurement.

receivedAt
receivedAt: Date;

When the app received it.

save
save: SaveState;

Where saving it stands.


DeviceRecording

type DeviceRecording = object;

A recording a recorder holds open, as its last realtime answer reported it.

Properties

leadOffSince?
leadOffSince?: Date;

When the electrodes lost contact, while they have none; the recording stays open until it is stopped. An app can offer stopRecording once this is old enough, as the vendor app does.

seconds
seconds: number;

Seconds recorded so far, as of the last change.

storesOnStop
storesOnStop: boolean;

Stopping now stores the recording; a shorter one is discarded by the device.


DeviceWaveform

type DeviceWaveform = object;

The ECG samples a recording device sent in one realtime answer, for drawing a live trace; never saved.

Properties

at
at: Date;

When the answer carrying them arrived.

deviceId
deviceId: string;

Platform identifier of the device.

millivoltsPerCount
millivoltsPerCount: number;

Millivolts per sample count.

sampleRateHz
sampleRateHz: number;

Samples per second.

samples
samples: readonly number[];

Raw sample counts, oldest first.


Driver

type Driver = (peripheral, signal) => AsyncIterable<DeviceEvent>;

Connects to a peripheral and reports what happens until it disconnects or signal aborts.

Parameters

ParameterType
peripheralPeripheral
signalAbortSignal

Returns

AsyncIterable<DeviceEvent>


type Link = object;

An open GATT connection: bytes in, bytes out, no knowledge of any device.

Methods

close()
close(): Promise<void>;

Ends every subscription and disconnects.

Returns

Promise<void>

subscribe()
subscribe(service, characteristic): AsyncIterable<Uint8Array<ArrayBufferLike>>;

Notified or indicated values until the connection drops.

Parameters
ParameterType
servicestring
characteristicstring
Returns

AsyncIterable<Uint8Array<ArrayBufferLike>>

write()
write(
   service,
   characteristic,
   bytes
): Promise<void>;

Writes bytes to a characteristic, with response.

Parameters
ParameterType
servicestring
characteristicstring
bytesUint8Array
Returns

Promise<void>

Properties

deviceInformation?
readonly deviceInformation?: DeviceInformation;

What the device reported about itself when the link opened; absent when the link did not read it.


NearbyDevice

type NearbyDevice = object;

A supported peripheral the scan found.

Properties

connection
connection: ConnectionState;

Its connection state.

error
error: BluetoothError | null;

The last error its connection reported, or null.

id
id: string;

Platform identifier of the peripheral.

information?
information?: DeviceInformation;

What the device reported about itself on its last connection; absent until it has connected.

key
key: string;

Device key its support identified it as.

name
name: string;

Name it advertised.

readsHistoryOnRequest?
readsHistoryOnRequest?: boolean;

True once connected for a device that reads the records it stored only on syncHistory, which it may do while it measures; any other reads them each time it connects.

recording?
recording?: DeviceRecording;

The recording the device holds open, for recorders that report one; absent when none is open.


Peripheral

type Peripheral = object;

A peripheral a scan found, and the way to open a connection to it.

Methods

openLink(signal): Promise<Link>;

Connects and discovers its services; aborting signal closes the link.

Parameters
ParameterType
signalAbortSignal
Returns

Promise<Link>

Properties

advertisement: Advertisement;

What it advertised.

id
id: string;

Platform identifier of the peripheral.


ResultPolicy

type ResultPolicy = () => (reading) => boolean;

Makes, for each connection, the test of which readings to keep.

Returns

(reading) => boolean


SaveResult

type SaveResult =
  | {
  status: "saved";
}
  | {
  queueId: string;
  status: "queued";
};

How a sink took a reading.

Union Members

Type Literal
{
  status: "saved";
}
NameTypeDescription
status"saved"Saved.

Type Literal
{
  queueId: string;
  status: "queued";
}
NameTypeDescription
queueIdstringNames the reading in the queue.
status"queued"Kept offline until flushQueued saves it.

SaveState

type SaveState =
  | {
  status: "saving";
}
  | {
  status: "saved";
}
  | {
  queueId: string;
  status: "queued";
}
  | {
  error: BluetoothError;
  status: "failed";
};

Where saving a reading stands.

Union Members

Type Literal
{
  status: "saving";
}
NameTypeDescription
status"saving"The sink has not answered yet.

Type Literal
{
  status: "saved";
}
NameTypeDescription
status"saved"Saved.

Type Literal
{
  queueId: string;
  status: "queued";
}
NameTypeDescription
queueIdstringNames the queued reading in the sink's queue.
status"queued"Kept offline by the sink until a flush saves it.

Type Literal
{
  error: BluetoothError;
  status: "failed";
}
NameTypeDescription
errorBluetoothErrorWhy, with code save-failed.
status"failed"The sink could not save or queue it; retrySaves tries again.

Variables

dailyTotalsOnly

const dailyTotalsOnly: ResultPolicy;

Activity totals count only once their day has closed, and each day only once.


everyReading

const everyReading: ResultPolicy;

Keeps every reading.


firstReadingPerKind

const firstReadingPerKind: ResultPolicy;

Keeps the first reading of each measurement type per connection.


SIG_PROTOCOLS

const SIG_PROTOCOLS: ReadonlyMap<string, DeviceProtocol>;

By the ids the SDK catalog gives the Bluetooth SIG profiles.

References

AcceptedDevice

Re-exports AcceptedDevice


IntegratedDevices

Re-exports IntegratedDevices

Last updated on

On this page

ComponentsBluetoothDevicePicker()ParametersReturnsBluetoothProvider()ParametersReturnsHooksuseBluetooth()ReturnsThrowsuseBluetoothPermission()ReturnsuseBluetoothState()ReturnsuseMeasurements()ReturnsuseNearbyDevice()ParametersReturnsuseNearbyDevices()ReturnsusePairedDevices()ReturnsuseScanning()ReturnsClassesBluetoothErrorExtendsConstructorsConstructorParametersReturnsOverridesPropertiesBluetoothRuntimeConstructorsConstructorParametersReturnsMethodscheckPermission()Returnsconnect()ParametersReturnsThrowsdisconnect()ParametersReturnsdispose()Returnsforget()ParametersReturnsgetSnapshot()ReturnsopenPermissionSettings()Returnspair()ParametersReturnsrequestPermission()ReturnsretrySaves()ReturnsstartScan()ReturnsThrowsstopRecording()ParametersReturnsThrowsstopScan()Returnssubscribe()ParametersReturnssubscribeWaveform()ParametersReturnssyncHistory()ParametersReturnsThrowsFunctionsacceptedMemorySlots()ParametersReturnsbleManagerScanner()ParametersReturnsbuiltInDevices()ParametersReturnscreateBluetoothRuntime()ParametersReturnsdefineDevice()ParametersReturnskeepReadings()ParametersReturnsosBluetoothPermissions()ReturnsovokReadingSink()ParametersReturnspolicyByKind()ParametersReturnsInterfacesBluetoothDevicePickerPropsExtendsPropertiesBluetoothPermissionsMethodscheck()ReturnsopenSettings()Returnsrequest()ReturnsBluetoothScannerExtended byMethodsscan()ParametersReturnswatchState()ParametersReturnsDeviceSupportMethodsmatch()ParametersReturnsReadingSinkMethodsflushQueued()Returnssave()ParametersReturnsType AliasesAdapterStateAdvertisementPropertiesmanufacturerDatanameserviceUUIDsBluetoothErrorCodeBluetoothPermissionBluetoothProviderPropsBluetoothRuntimeOptionsPropertiesdevicespairedStorage?permissionsresultPolicy?scannersinkBluetoothSnapshotPropertiesadapterdevicespairedpermissionreadingsscanErrorscanningBuiltInDevicesOptionsPropertiesrecordCursorStorage?ConnectionStateCreateBluetoothRuntimeOptionsPropertiesbleManagerclientdevicesresultPolicy?DeviceDefinitionPropertieskeymatchesParametersReturnsprotocolDeviceEventUnion MembersType LiteralType LiteralType LiteralType LiteralType LiteralType LiteralType LiteralDeviceInformationPropertiesmanufacturerName?model?serialNumber?DeviceMatchPropertiesdriverkeyDeviceProtocolParametersReturnsDeviceReadingPropertiesdeviceidmeasurementreceivedAtsaveDeviceRecordingPropertiesleadOffSince?secondsstoresOnStopDeviceWaveformPropertiesatdeviceIdmillivoltsPerCountsampleRateHzsamplesDriverParametersReturnsLinkMethodsclose()Returnssubscribe()ParametersReturnswrite()ParametersReturnsPropertiesdeviceInformation?NearbyDevicePropertiesconnectionerroridinformation?keynamereadsHistoryOnRequest?recording?PeripheralMethodsopenLink()ParametersReturnsPropertiesadvertisementidResultPolicyReturnsSaveResultUnion MembersType LiteralType LiteralSaveStateUnion MembersType LiteralType LiteralType LiteralType LiteralVariablesdailyTotalsOnlyeveryReadingfirstReadingPerKindSIG_PROTOCOLSReferencesAcceptedDeviceIntegratedDevices