I'm using python code based on the heart_rate_collector.py example in pc-ble-driver-py to scan for devices and connect to a peripheral device.
This all works fine, except that when I try to enable notifications on a particular (known to exist) characteristic, that produces an exception NordicSemiException('CCCD not found').
I'd like to look at the UUIDs that are actually found during discovery of the device in question and compare them with the UUID I'm passing to see why the CCCD is not found.
How do I access the *full* UUIDs in python code?
I wrote the following code (inserted in the connect_and_discover() function):
self.adapter.service_discovery(new_conn) for s in self.adapter.db_conns[0L].services: print "Service UUID=", s.uuid, s.uuid.value for c in s.chars: print " Char UUID=", c.uuid, c.uuid.value for d in c.descs: print " Desc UUID=", d.uuid, d.uuid.value
This produces:
New connection: 0
Service UUID= 0x1800 6144
Char UUID= 0x2A00 10752
Desc UUID= 0x2A00 10752
Char UUID= 0x2A01 10753
Desc UUID= 0x2A01 10753
Char UUID= 0x2A04 10756
Desc UUID= 0x2A04 10756
Service UUID= 0x1801 6145
Service UUID= 0x00 (Standard.unknown) Standard.unknown
Char UUID= 0x00 (Standard.unknown) Standard.unknown
Desc UUID= 0x2A00 10752
Desc UUID= 0x2902 (Standard.cccd) Standard.cccd
Char UUID= 0x00 (Standard.unknown) Standard.unknown
Desc UUID= 0x2902 (Standard.cccd) Standard.cccd
The enumeration works fine (these are the right number of services etc) but the UUIDs all print as 0x00. I'd like to show the UUIDs either as byte arrays or formatted the way UUIDs usually are.
I think it would be great if there was a python example that connects to a device and displays all the discovery information.
P.S. My environment is Ubuntu 16.04LTS, pc-ble-driver-py v0.11.4 (installed from pip) and nRD51 DK.