pc_ble_driver_py and discovery of 128-bit UUIDs

I write a HIL (Hardware in the Loop) test and connect with the pc_ble_driver_py to a nRF52840 in our product. The server offers the following handles (output from Wireshark):

Handle  UUID                              UUID-Name
0x0001  1801                              Generic Attribute Profile
0x0002  1800                              Generic Access Profile
0x0003  2803                              GATT Characteristic Declaration
0x0004  2a00                              Device Name
0x0005  2803                              GATT Characteristic Declaration
0x0006  2a01                              Appearance
0x0007  2803                              GATT Characteristic Declaration
0x0008  2a04                              Peripheral Preferred Connection Parameters
0x0009  87290102-3c51-43b1-a1a9-11b9dc38478b  Unknown
0x000a  2803                              GATT Characteristic Declaration
0x000b  6aa50001-6352-4d57-a7b4-003a416fbb0b  Unknown
0x000c  2803                              GATT Characteristic Declaration
0x000d  6aa50002-6352-4d57-a7b4-003a416fbb0b  Unknown
0x000e  2803                              GATT Characteristic Declaration
0x000f  6aa50003-6352-4d57-a7b4-003a416fbb0b  Unknown
0x0010  2803                              GATT Characteristic Declaration
0x0011  6aa50005-6352-4d57-a7b4-003a416fbb0b  Unknown
0x0012  2803                              GATT Characteristic Declaration
0x0013  6aa50006-6352-4d57-a7b4-003a416fbb0b  Unknown
0x0014  2803                              GATT Characteristic Declaration
0x0015  6aa50007-6352-4d57-a7b4-003a416fbb0b  Unknown
0x0016  2803                              GATT Characteristic Declaration
0x0017  6aa50008-6352-4d57-a7b4-003a416fbb0b  Unknown
0x0018  2803                              GATT Characteristic Declaration
0x0019  6aa50009-6352-4d57-a7b4-003a416fbb0b  Unknown
0x001a  2803                              GATT Characteristic Declaration
0x001b  6aa5000a-6352-4d57-a7b4-003a416fbb0b  Unknown
0x001c  180f                              Battery Service
0x001d  2803                              GATT Characteristic Declaration
0x001e  2a19                              Battery Level
0x001f  2902                              Client Characteristic Configuration
0x0020  180a                              Device Information
0x0021  2803                              GATT Characteristic Declaration
0x0022  2a24                              Model Number String
0x0023  2803                              GATT Characteristic Declaration
0x0024  2a29                              Manufacturer Name String
0x0025  2803                              GATT Characteristic Declaration
0x0026  2a50                              PnP ID
0x0027  fd44                              Apple Inc.
0x0028  2803                              GATT Characteristic Declaration
0x0029  4f860001-943b-49ef-bed4-2f730304427a  Unknown
0x002a  2902                              Client Characteristic Configuration
0x002b  2803                              GATT Characteristic Declaration
0x002c  4f860002-943b-49ef-bed4-2f730304427a  Unknown
0x002d  2902                              Client Characteristic Configuration
0x002e  2803                              GATT Characteristic Declaration
0x002f  4f860003-943b-49ef-bed4-2f730304427a  Unknown
0x0030  2902                              Client Characteristic Configuration
0x0031  2803                              GATT Characteristic Declaration
0x0032  4f860004-943b-49ef-bed4-2f730304427a  Unknown
0x0033  2902                              Client Characteristic Configuration
0x0034  180d                              Heart Rate
0x0035  2803                              GATT Characteristic Declaration
0x0036  2a37                              Heart Rate Measurement
0x0037  2902                              Client Characteristic Configuration
0x0038  2803                              GATT Characteristic Declaration
0x0039  2a38                              Body Sensor Location
0x003a  2803                              GATT Characteristic Declaration
0x003b  2a39                              Heart Rate Control Point
0x003c  1804                              Tx Power
0x003d  2803                              GATT Characteristic Declaration
0x003e  2a07                              Tx Power Level

During service discovery I do not get any 128-bit UUIDs in the characteristics with the pc_ble_driver_py (e.g. handle 0x0b, 0x0d etc.).

If I set a breakpoint in the following line: ble_adapter.py:368 then I get the following debug output:

This does not correspond to the value from my server handle table.

Reading vendor specific service with 128-bit UUID (handle: 0x09) works, but characteristics do not. With the nRF Connect for Mobile app, all 128-bit UUIDs are read correctly.

Any hints on what I could do?

  • Hi,

    It looks like you point to the UUID of 0x2A00, which is the Device Name UUID, which should be found under the Generic Access Service (UUID 0x1800). Are you sure that you have stopped execution at the point where you read the custom 128 bit characteristic UUID?

    In general, the way 128 bit UUIDs are stored in nRF5 SDK (and therefore also in pc-ble-driver) is that you have a base UUID and a 16 bit UUID. In order to get a full 128 bit UUID, you combine the base UUID with the 16 bit UUID (by placing the 16 bit UUID at the byte 12 and 13 positions of the base UUID.) There is an array of base UUIDs, and the data structure holding 128 bit UUIDs hold an index into that table as well as a 16 bit UUID, so that when you combine them you get the full UUID. For more on this subject, please have a look at Bluetooth low energy Services, a beginner's tutorial, and in particular the section of that tutorial under the heading Universally Unique ID (UUID).

    Regards,
    Terje

Related