Skip to content

useBluetooth ​

Category
Browser

Hook for getting information about bluetooth

typescript
import { useBluetooth } from '@siberiacancode/reactuse';

Usage ​

typescript
const { supported, connected, device, requestDevice, server } = useBluetooth(options);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
options.acceptAllDevices?booleanfalseThe options to request all Bluetooth devices
options.filters?Array<BluetoothLEScanFilter>-Array of filters to apply when scanning Bluetooth devices
options.optionalServices?Array<BluetoothServiceUUID>-Array of optional services that the application can use

Contributors ​

Source • Demo