useBluetooth ​
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
Name | Type | Default | Note |
---|---|---|---|
options.acceptAllDevices? | boolean | false | The 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 |