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

Is 32 bit service UUID supported?

I'm trying to use a 32 bit service UUID, but it doesn't seem to be supported by SDK 10 or SDK 12

Looking in the HRS it has this code

BLE_UUID_HEART_RATE_SERVICE,         BLE_UUID_TYPE_BLE

which is passed to

ble_advertising_init

But BLE_UUID_TYPE_BLE is a 16 bit UUID and I can't see 32 bit defined in the list that ble_advertising_init uses

#define BLE_UUID_TYPE_UNKNOWN       0x00 /**< Invalid UUID type. */
#define BLE_UUID_TYPE_BLE           0x01 /**< Bluetooth SIG UUID (16-bit). */
#define BLE_UUID_TYPE_VENDOR_BEGIN  0x02 /**< Vendor UUID types start at this index (128-bit). */

I can see 32 bit listed in gap.h

#define BLE_GAP_AD_TYPE_32BIT_SERVICE_UUID_COMPLETE         0x05 

Is it possible to use 32 bit service uuids and use ble_advertising_init or to use 32 bit UUID's do i need to do this some other way

Or is 32 bit not supported ?

Parents
  • 16 bit and 32 bit UUIDs shall only be used if they are assigned by the Bluetooth SIG, companies should not randomly use them.

    If you have been assigned a 16 bit or 32 bit UUID you can use these in the advertising packet. You can of course use a 32 bit UUID in a prototype as well.

    When used in GATT the 32 bit UUID can't be used, it shall be converted to a 128 bit UUID.

    ble_advdata_set(), which encodes data in the advertising and scan response data format does not support 32 bit UUIDs. You can however modify it to support 32 bit UUIDs, or do the encoding manually yourself for your advertising packet.

Reply
  • 16 bit and 32 bit UUIDs shall only be used if they are assigned by the Bluetooth SIG, companies should not randomly use them.

    If you have been assigned a 16 bit or 32 bit UUID you can use these in the advertising packet. You can of course use a 32 bit UUID in a prototype as well.

    When used in GATT the 32 bit UUID can't be used, it shall be converted to a 128 bit UUID.

    ble_advdata_set(), which encodes data in the advertising and scan response data format does not support 32 bit UUIDs. You can however modify it to support 32 bit UUIDs, or do the encoding manually yourself for your advertising packet.

Children
  • Thanks Petter

    I know in theory that 16 and 32 bit UUIDs are allocated by Bluetooth SIG, but in practice I have seen many devices using random numbers for 16 bit service IDs on their products.

    Anyway, from what you have written , it sounds like 128 bit Service UUIDs are not issued by Bluetooth SIG, so any random 128 bit UUID would be valid.

    And we can live with only 8 bytes of Manufacturer data in the advertising.

    If we need more data, it sounds like we'd need to create the advertising packet in our code, so I'll need to read the API docs to see how to pass a advertising packet to the API

Related