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

sd_ble_gattc_read during service discovery process

Hi,

I have a problem with (128 bit) custom service discovery... I have following setup; nrf51 with s130 in central role and Thingy with default FW.

In function on_primary_srv_discovery_rsp, I added check if discovered uuid.type is unknown then I add it with calling sd_ble_uuid_vs_add (I hardcoded Thingy 128bit uuid) and everything works fine...

Instead of hardcoding, because we don't know what custom services will our customer have - I would like to perform readout from start handle to get uuid. And when I get BLE_GATTC_EVT_READ_RSP event, I call sd_ble_uuid_vs_add with uuid which is the same as I hardcoded before... But after that I don't reach on_srv_disc_completion anymore... Any suggestion?

  • You can always live without provisioning of proprietary 128-bit UUID bases to the SoftDevice. Simply read the characteristic's or service handle and you will get full 128-bit UUID. The price you pay is one more GATT round-trip during discovery (because unfortunately - as far as I know - Nordic stack don't provide access to full 128-bit value if base is not provisioned even it must know it). More about it in this old Q&A.

Related