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

Is there a supported version of is_uuid_present?

I'm trying to connect two nRF5 devices together, Central and Peripheral, and use a custom BLE service that I have written that has a custom 128 bit UUID.

I'm in the process of writing the code for a BLE Central. During the GAP Scanning process, this BLE Central needs to narrow down the Peripherals it considers connecting to by whether or not those peripherals provide my custom BLE Service (with the custom UUID). All other BLE devices that are scanned are irrelevant.

So I went looking through the SDK for a function that, given a ble_uuid_t and a ble_gap_evt_adv_report_t would answer the question "Is this UUID in this Advertising Report?".

I imagine that this will be an incredibly common use case. I think that the majority of people that write a custom BLE Service will want this.

However, when I searched, I found nothing in the SDK that had this functionality. That was a surprise.

So I looked at what the example code and found two similar methods.

The first was find_adv_uuid. This method is okay if you want to filter down a 16-bit UUID from the ble_gap_evt_adv_report_t. But it does not handle 128-bit UUIDs at all.

Then I discovered is_uuid_present.

This method is only hidden in one example inside: examples/ble_central/ble_app_uart_c/main.c. But it is exactly what I needed.

It handles 16-bit, 32-bit and 128-bit UUID searching. It's brilliant. But, unfortunately, because it's just in the examples, I have to copy-paste it into my code.

So my question is as follows:

  1. Is there an API method in the nRF5 SDK that should be used instead of is_uuid_present? (I searched in SDK 14.2.0 and could not find one)
  2. If not, could somebody from Nordic Semiconductor please promote is_uuid_present into an SDK supported method? Or at-least into some kind of nordic-semi-extras library if you don't want to put it directly in core. (Actually, what is the policy with utility methods in the nRF5 SDK? You have app_util.h, which is super useful, but not much else.)

Thanks for your time!

P.S. Where do I go to report bugs directly to Nordic Semiconductor?

Related