0

I am developing a react native app that connect health device via bluetooth using the library

https://github.com/dotintent/react-native-ble-plx

but after connecting I try to get service by calling device.service() but then there are an error saying no services discovered.

Now I am confused how I get service uuid and characteristic uuid to read data from bluetooth device. The device is glucose meter.

James Westgate
  • 11,306
  • 8
  • 61
  • 68

3 Answers3

1

In case there is no documentation available for a device one could use a BLE scanner app to scan for nearby devices and simply obtain the UUIDs that way.

There are multiple such apps available for both iOS and Android such as nRF Connect and LightBlue.

These can not only scan for BLE devices but can also be used to test them using simple read, write and notify operations.

Michael Kotzjan
  • 2,093
  • 2
  • 14
  • 23
0

sorry, i already got the answer service uuid of my device is 1808

i search it in here https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf

i confirm it by log the device that show uuid of 00001808-0000-1000-8000-00805f9b34fb

then base of this answer How can I convert a Bluetooth 16 bit service UUID into a 128 bit UUID?

i know how to read that 16bit uuid to 4 digit like this

Or, to put it more simply, the 16-bit Attribute UUID replaces the x’s in the follow- ing:

0000xxxx-0000-1000-8000-00805F9B34FB In addition, the 32-bit Attribute UUID replaces the x's in the following:

xxxxxxxx-0000-1000-8000-00805F9B34FB

then the characteristic uuid i think by documentation refer to 2A18 for the same name or description

-1

As mentioned in the documentation of this library Since Android 6 to scan the app needs to have ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION runtime permission. Since Android 10 only ACCESS_FINE_LOCATION is accepted by the OS.. You need to handle Android Runtime permissions.

Naimul Kabir
  • 434
  • 6
  • 13
  • 1
    already did that bro, after that i can connect but like library react-native-ble-plx documentation mentioned for function device.monitorCharacteristicForService(serviceUUID, characteristicUUID, listener) need param of uuid service and character, from here i dont know where i can get this uuid for my device – Rebirth Bloods Jan 26 '22 at 09:35