'how to know device's service uuid and characteristic uuid when connecting to bluetooth

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.



Solution 1:[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.

Solution 2:[2]

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

Solution 3:[3]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Naimul Kabir
Solution 2 Rebirth Bloods
Solution 3 Michael Kotzjan