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

Service UUID Discovery before connectivity

Hey All -

My team is new to Bluetooth development and so this may be a naïve question. Pardon us for this, if so.

We are trying to create an Android App that would scan for the current advertising BT devices and identify the one with our custom service UUID for pairing and connecting. Is this possible? In summary, my question is that does BT as a technology support the query of Service UUIDs from peripheral devices when it hasn't paired before and hence is not currently connected to those devices.

Parents
  • You can't "query" a device that you are not connected to for it's service UUIDs. However, you have a couple of options. One is to embed your service UUID in the advertising packet which is allowed by the spec and Nordic's API. Second is to create a manufacturer specific data section in the advertising packet that you can trigger off of.

    We do the latter on our product. We registered with the SIG to get a manufacturer id and we key off of that in the advertising packet to know a device is "ours". We also embedded information such as a serial number in the manufacturers specific data so our customers can know what specific device they are seeing before attempting to connect to it.

  • Thank you John for your insightful response. Looking into our current implementation, we are already embedding the service UUID in the advertising packet as scan response through the ble_advdata_set() API, if that is what you are referring to. So, it seem like we are already doing your Option #1, right?

    In such a case, we should be able to get the service UUID without connecting to the device. I guess we need to dig deeper into the Android APIs to see if it provides affordances for the apps to get this advertisement/scan response data. Currently our device name is 9 characters and the custom UUID is 16 bytes and so I hope it is well within the limits (62 bytes) that Jan is referring to in the comment below.

Reply
  • Thank you John for your insightful response. Looking into our current implementation, we are already embedding the service UUID in the advertising packet as scan response through the ble_advdata_set() API, if that is what you are referring to. So, it seem like we are already doing your Option #1, right?

    In such a case, we should be able to get the service UUID without connecting to the device. I guess we need to dig deeper into the Android APIs to see if it provides affordances for the apps to get this advertisement/scan response data. Currently our device name is 9 characters and the custom UUID is 16 bytes and so I hope it is well within the limits (62 bytes) that Jan is referring to in the comment below.

Children
No Data
Related