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

Modify the "NUS_SERVICE_UUID_TYPE"

I modified the FW "ble_app_uart" using the example "Nordic-SDK\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\en_app_uart\".

The UUID set in the project is declared "vendor specific" (see below).

#define NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_VENDOR_BEGIN /**< UUID type for the Nordic UART Service (vendor specific). */

/** @defgroup BLE_UUID_TYPES Types of UUID
 * @{ */
#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). */
/** @} */

What does it mean ?
In my application can I use the define of the example project ?
Which numbers can you set its three define ?

Thank you.

BR

Demetrio Magrin

  • Hi,

    From our tutorial Bluetooth low energy Services, a beginner's tutorial

    "A UUID is an abbreviation you will see a lot in the BLE world. It is a unique number used to identify services, characteristics and descriptors, also known as attributes. These IDs are transmitted over the air so that e.g. a peripheral can inform a central what services it provides. To save transmitting air time and memory space in your nRF52 there are two kinds of UUIDs:

    The first type is a short 16-bit UUID. The predefined Heart rate service, e.g., has the UUID 0x180D and one of its enclosed characteristics, the Heart Rate Measurement characteristic, has the UUID 0x2A37. The 16-bit UUID is energy and memory efficient, but since it only provides a relatively limited number of unique IDs there is a rule; you can only transmit the predefined Bluetooth SIG UUIDs directly over the air. Hence there is a need for a second type of UUID so you can transmit your own custom UUIDs as well.

    The second type is a 128-bit UUID, sometimes referred to as a vendor specific UUID. This is the type of UUID you need to use when you are making your own custom services and characteristics. It looks something like this: 4A98xxxx-1CC4-E7C1-C757-F1267DD021E8 and is called the “base UUID”. The four x’s represent a field where you will insert your own 16-bit IDs for your custom services and characteristics and use them just like a predefined UUID. This way you can store the base UUID once in memory, forget about it, and work with 16-bit IDs as normal."

    Best regards

    Jared 

  • Hi,

    I want to use a 128-bit UUID as described by you.
    What should I do to get this UUID ?
    For example, is it possible to acquire this number for free from the "">www.uuidgenerator.net/version4" link ?
    If for example the generated UUID is "3503cbc1-3346-49db-99c3-e89aa2cbdbd5" can I use the basic UUID for free, which is worth 3503xxxx-3346-49db-99c3-e89aa2cbdbd5 " ?
    Is it possible to do this without having to register this basic UUID ?
    Thank you very much for your support.

    BR

    Demetrio Magrin

  • Hi,

    Yes, you can use a custom Base UUID without registering it.

    Best regards

    Jared

  • What should I do to get this UUID

    That is also explained in the Tutorial which already mentioned to you:

    "A little fun fact about UUIDs: There is no database ensuring that no one in the world is sharing the same UUID, but if you generate two random 128-bit UUIDs there is only a ~3e-39 chance that you will end up with two identical IDs (that is ~1/340,000,000,000,000,000,000,000,000,000,000,000,000)."

    and

    "I have also used nRFgo Studio to create and define a 128-bit base UUID"

  • Hi,

    In my example for "UART Service" I have this UUID:

    Base UUID: 6E400001-B5A3-F393-­E0A9-­E50E24DCCA9E.
    This service simulates a basic UART connection over two lines, TXD and RXD.
    It is based on a proprietary UART service specification by Nordic Semiconductors.
    Data sent to and from this service can be viewed using the nRFUART apps from Nordic  for Android and iOS.

    I tried to change this base UUID and "Nordic_UART" is no longer recognized by my BLE client.
    Is it not possible to modify the "Base UUID"  for UART Service ?

    Thanks.

    BR

    Demetrio Magrin

Related