Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

How to get notified from multiple characteristics on a service? #3

Description

@github0013

It looks this hook only takes one characteristic UUID on a service.

const { device, status, startStream, stopStream } = useBluetoothNotifications({
  serviceUuid = "health_thermometer",
  characteristicUuid = "temperature_measurement",
});

If, for an example, I wanted to use "environmental_sensing" service, which has several characteristics, and wanted to get temperature and humidity, how do I do it?

I tried to use useBluetoothNotifications in 2 different components (one for temp, the other for humidity), but

  • I had to startStream on each component and pair on the same device twice
  • Stopping one and the other one after another gave me an error like below

DOMException: Failed to execute 'stopNotifications' on 'BluetoothRemoteGATTCharacteristic': GATT Server is disconnected. Cannot perform GATT operations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions