@ovok/native/bluetooth/web
The same Bluetooth API in browsers, over Web Bluetooth; nothing here loads `react-native-ble-plx` or
- Stable unknown
- Release candidate not available
- Development since 1.17.0-dev.2305+58d9b20
The same Bluetooth API in browsers, over Web Bluetooth; nothing here loads react-native-ble-plx or
react-native-permissions. Import from @ovok/native/bluetooth/web.
Functions
createWebBluetooth()
function createWebBluetooth(__namedParameters): Bluetooth;Bluetooth in a browser, over Web Bluetooth, saving readings to Ovok; loads no React Native module.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | CreateWebBluetoothOptions |
Returns
webBluetoothCentral()
function webBluetoothCentral(bluetooth): BleCentral;Bluetooth LE in a browser: a scan reports the devices the site may already use, then the device the user picks in the browser's chooser, which shows only the filter's models and opens only when the filter has entries.
Parameters
| Parameter | Type |
|---|---|
bluetooth | WebBluetooth | undefined |
Returns
Type Aliases
CreateWebBluetoothOptions
type CreateWebBluetoothOptions = object & Partial<BluetoothOptions>;What createWebBluetooth needs; every port can be swapped, for tests or a custom store or sink.
Type Declaration
| Name | Type | Description |
|---|---|---|
ovok | OvokSinkClient | The Ovok client readings are saved through. |
savesFor? | SavesFor | The patient readings are saved for when the person measuring isn't the patient, such as a clinician; see SavesFor. |
storage | OvokStorage | Where paired devices are kept between visits. |
WebBluetooth
type WebBluetooth = object;The part of navigator.bluetooth this adapter uses.
Methods
addEventListener()
addEventListener(type, listener): void;Calls listener when the radio is switched on or off.
Parameters
| Parameter | Type |
|---|---|
type | "availabilitychanged" |
listener | (event) => void |
Returns
void
getAvailability()
getAvailability(): Promise<boolean>;Whether the browser has a Bluetooth radio it can use.
Returns
Promise<boolean>
getDevices()?
getDevices?(): Promise<WebDevice[]>;The devices the user already granted; missing in browsers that do not remember grants.
Returns
Promise<WebDevice[]>
removeEventListener()
removeEventListener(type, listener): void;Stops those calls.
Parameters
| Parameter | Type |
|---|---|
type | "availabilitychanged" |
listener | (event) => void |
Returns
void
requestDevice()
requestDevice(options): Promise<WebDevice>;Opens the browser's chooser and resolves with the device the user picks.
Parameters
| Parameter | Type |
|---|---|
options | object |
Returns
Promise<WebDevice>
References
AdapterSnapshot
Re-exports AdapterSnapshot
AdapterState
Re-exports AdapterState
AdvertisementTest
Re-exports AdvertisementTest
AppLifecycle
Re-exports AppLifecycle
AppVisibility
Re-exports AppVisibility
Battery
Re-exports Battery
BleCentral
Re-exports BleCentral
Bluetooth
Re-exports Bluetooth
BluetoothOptions
Re-exports BluetoothOptions
BluetoothPermission
Re-exports BluetoothPermission
BluetoothPermissions
Re-exports BluetoothPermissions
BluetoothProvider
Re-exports BluetoothProvider
BluetoothProviderProps
Re-exports BluetoothProviderProps
BUILT_IN_MODELS
Re-exports BUILT_IN_MODELS
BUILT_IN_PROTOCOLS
Re-exports BUILT_IN_PROTOCOLS
Catalog
Re-exports Catalog
ConnectionState
Re-exports ConnectionState
Device
Re-exports Device
DeviceAction
Re-exports DeviceAction
DeviceChange
Re-exports DeviceChange
DeviceError
Re-exports DeviceError
DeviceErrorCode
Re-exports DeviceErrorCode
DeviceEvent
Re-exports DeviceEvent
DeviceFlag
Re-exports DeviceFlag
DeviceIdentity
Re-exports DeviceIdentity
DeviceModel
Re-exports DeviceModel
DeviceProtocol
Re-exports DeviceProtocol
DeviceSecret
Re-exports DeviceSecret
DeviceSelector
Re-exports DeviceSelector
DeviceSettings
Re-exports DeviceSettings
DeviceSnapshot
Re-exports DeviceSnapshot
DeviceState
Re-exports DeviceState
DiscoverOptions
Re-exports DiscoverOptions
Discovery
Re-exports Discovery
DiscoverySnapshot
Re-exports DiscoverySnapshot
EarSide
Re-exports EarSide
EarState
Re-exports EarState
FactoryReset
Re-exports FactoryReset
Found
Re-exports Found
GattLink
Re-exports GattLink
HearingAidChange
Re-exports HearingAidChange
HearingAidMode
Re-exports HearingAidMode
HearingAidState
Re-exports HearingAidState
HistoryRecord
Re-exports HistoryRecord
HOLD
Re-exports HOLD
Identification
Re-exports Identification
InEarDetectionChange
Re-exports InEarDetectionChange
KeepAlive
Re-exports KeepAlive
LinkOption
Re-exports LinkOption
LiveFrame
Re-exports LiveFrame
LiveResult
Re-exports LiveResult
LiveSpan
Re-exports LiveSpan
LiveValues
Re-exports LiveValues
Logger
Re-exports Logger
MatchRule
Re-exports MatchRule
MeasurementType
Re-exports MeasurementType
MetricCode
Re-exports MetricCode
MicrophoneChange
Re-exports MicrophoneChange
MicrophoneDirection
Re-exports MicrophoneDirection
ModeChange
Re-exports ModeChange
NoiseReductionChange
Re-exports NoiseReductionChange
NoiseScene
Re-exports NoiseScene
OutboxView
Re-exports OutboxView
OutboxWatch
Re-exports OutboxWatch
ovokOutboxWatch
Re-exports ovokOutboxWatch
ovokReadingSink
Re-exports ovokReadingSink
OvokSinkClient
Re-exports OvokSinkClient
PairedDevice
Re-exports PairedDevice
PairedDeviceStore
Re-exports PairedDeviceStore
Pin
Re-exports Pin
PromptLanguage
Re-exports PromptLanguage
PromptLanguageChange
Re-exports PromptLanguageChange
ProtocolContext
Re-exports ProtocolContext
Quantity
Re-exports Quantity
Reading
Re-exports Reading
ReadingSink
Re-exports ReadingSink
ReadingSource
Re-exports ReadingSource
ReceivedReading
Re-exports ReceivedReading
RecordInfo
Re-exports RecordInfo
SaveOutcome
Re-exports SaveOutcome
SaveReceipt
Re-exports SaveReceipt
SavesFor
Re-exports SavesFor
SaveState
Re-exports SaveState
ScanFilter
Re-exports ScanFilter
ScanHandlers
Re-exports ScanHandlers
Series
Re-exports Series
storagePairedDevices
Re-exports storagePairedDevices
SyncSummary
Re-exports SyncSummary
Transport
Re-exports Transport
useBluetooth
Re-exports useBluetooth
useBluetoothAdapter
Re-exports useBluetoothAdapter
useCatalog
Re-exports useCatalog
useDevice
Re-exports useDevice
useDiscovery
Re-exports useDiscovery
useLiveValues
Re-exports useLiveValues
usePairedDevices
Re-exports usePairedDevices
useReadings
Re-exports useReadings
useWaveform
Re-exports useWaveform
Vendor
Re-exports Vendor
VolumeChange
Re-exports VolumeChange
VolumeStep
Re-exports VolumeStep
Waveform
Re-exports Waveform
WaveformBuffer
Re-exports WaveformBuffer
Last updated on