How to use BLE scanforservice block?

Dear forum members,

I am working with the newest public version of the BLE extension (version 20200828). I have a bunch of BLE capable boards that all advertise the same standard service with a 16-bit UUID (180F).

The idea is that all these boards advertise the charge level of their batteries once a while to a nearby android phone without making a connection and the phone would notify the user when any of the boards would need some charge.

As i do not want any other BLE devices to show up while the phone is scanning i am trying to use the ScanForService block to filter the devices to be found during the scan. My problem is that i can not make it to work. Have been trying both the 16-bit and 128-bit versions of the UUID as field serviceUuid for the block in question, but neither seem to do the trick.

Interestingly enough the AdvertisementData block does work with 128-bit UUID even if the boards advertise the 16-bit version to allow for useful data within the 32 byte maximal advertisement payload. See the last block in my example. However i could not come up with a filtering function based on the AdvertisementData block.

Does anyone know how to achieve what i am looking for?

Using nRF Connect it turns out the board firmware did not contain the service list inside the scanresponse. After adding that, the above blocks seem to work.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.