npm.io
0.0.1 • Published 6 years ago

use-bluetooth-notifications

Licence
MIT
Version
0.0.1
Deps
1
Size
147 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

use-bluetooth-notifications

A react hook to easily use and listen to bluetooth notifications from a specified service and characteristic

Usage

const { device, status, stream, startStream, stopStream } = useBluetoothNotifications({
  serviceUuid = "health_thermometer",
  characteristicUuid = "temperature_measurement",
  notificationHandler = (parsedValue) => { ... },
});

<button onClick={startStream}>Start</button>
<button onClick={stopStream}>Stop</button>