This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Having trouble reading the values of Services and getting full UUID of custom peripheral device

I am using an nRF52 DK and running a modified version of the heart rate collector example from the pc-ble-driver-py repository.

My modified program scans for connectable BLE devices in the vicinity connects to them, does a service discovery, prints out the GATT Table, then disconnects before connecting and repeating with a new connectable device in the area.

I am printing out the GATT Table by doing the following:

#print out the device's GATT Table
for s in self.adapter.db_conns[new_conn].services:
    print("Service UUID =", str(s.uuid), " ", str(s.uuid.value))
    for c in s.chars:
        print("--Characteristic UUID =", str(c.uuid), " ", str(c.uuid.value))
        for d in c.descs:
            print("----Description UUID =", str(d.uuid), " ", str(d.uuid.value))

The above code results in the following output:

Service UUID = 0x1801 6145
--Characteristic UUID = 0x2A05 10757
----Description UUID = 0x2A05 10757
Service UUID = 0x1800 6144
--Characteristic UUID = 0x2A00 10752
----Description UUID = 0x2A00 10752
--Characteristic UUID = 0x2A01 10753
----Description UUID = 0x2A01 10753
--Characteristic UUID = 0x2AA6 10918
----Description UUID = 0x2AA6 10918
Service UUID = 0x9999 39321
--Characteristic UUID = 0x9997 39319
----Description UUID = 0x9997 39319
--Characteristic UUID = 0x9996 39318
----Description UUID = 0x9996 39318
----Description UUID = 0x2902 (Standard.cccd) Standard.cccd
----Description UUID = 0x2901 10497

The general frame of the GATT Table is accurate (accurate number of services, characteristics, and descriptors). However, it is not showing the full UUID (showing 0x9999 instead of d0611e78-bbb4-4591-a5f8-487910ae4366).

How do I go about printing out the full UUID? Note that I am using the nRF52 DK as a central device that connects to any connectable peripheral in the area (the peripheral device can be of any make, model, or type of BLE device like a fitness watch, smartphone, earphones, etc).

I know that this should be possible since the nRF Connect Desktop application does this exact thing. But I can't seem to get it to work via python execution. Any help would be greatly appreciated.

Parents Reply Children
No Data
Related