Electronic – How to discover a custom Bluetooth LE device

bluetoothbluetooth low energy

I have a custom circuit board which is using a Bluetooth LE chip from Nordic Semiconductor. I'll be talking to this device with an iOS app and am new to BTLE and somewhat confused by the whole discovery/pairing flow. Our device simply sends out ASCII text which is a custom data format.

The EE who developed this board hasn't given me a lot of guidance on how to connect to it. When I use the LightBlue iOS app I can see the device and it's UUIDs. The UUIDs I see are exactly the same as the UUIDs in the Nordic nRF UART App.

My main questions are:

  • What UUIDs will my boards need to use? There will be more than just one board, so it seems like each one will have it's own UUID?
  • Does my device need to get some "special" UUID from bluetooth.org?

I know there are different UUIDs for both the service and the characteristics…my questions apply to all of these.

Best Answer

No, the UUID should be the same for all of your boards. I know why you may think this is odd, but it is the services that looks and act the same, the boards don't have to. But, if your boards will do different tasks, then maybe you could add different, more specific, services to each of them. To identify which is one and who's the other, you should change the device's name. A common way of doing this is searching for the same UUID from iOS, and then get a list of device names that are broadcasting this specific UUID. If you are using an nRF51822 device, tell your EE that he can have unique names instead of unique UUID's by changing this line in is main.c to easier identify your different boards.

#define DEVICE_NAME                          "Device_name" // <<-- this line

// In gap_params_init
sd_ble_gap_device_name_set(&sec_mode,(const uint8_t *)DEVICE_NAME, strlen(DEVICE_NAME));

If your device is going to advertise a Bluetooth SIG (Special Interest Group) type of service, the UUID needs to be a 16 bit standardised value from the SIG. These can be found here. When you are using a chip from Nordic Semiconductor, you'll see that in their libraries, all the service and characteristics definitions are already defined.

Excerpt from these documentation pages:

#define BLE_UUID_ALERT_NOTIFICATION_SERVICE                      0x1811     /**< Alert Notification service UUID. */
#define BLE_UUID_BATTERY_SERVICE                                 0x180F     /**< Battery service UUID. */

On the other hand, the Nordic UART service is a custom service. To use a custom service, you need to generate a 128 bit random UUID and add this to the service your self. Since your EE has already done that, there is no problem just switching it out.