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

Attaching Custom 128 bit Characteristic UUIDS to Custom 128 bit Service UUID where the base does not match

Hi,

I am trying to emulate a vendor's tool, whose BLE properties are configured as follows:

Custom 128 bit Service UUID like XXXXXXXX-0000-XXXX-XXXX-XXXXXXXXXXXX

Custom 128 bit Characteristic UUID like XXXXXXXX-0001-XXXX-XXXX-XXXXXXXXXXXX

There are five more characteristics like this. 

With the nrf5 SDK, it appears that I can add a characteristic to a service with a base UUID, but it will modify the 12th and 13th octet. In other words, when I try to add the characteristic to the service, I end up with a UUID that looks like this: XXXX0001-XXXX-XXXX--XXXX-XXXXXXXXXXXX

This is not what I want. 

Is there a way to add a characteristic with a completely different 128 bit UUID base to a service, without having to add a new service to the gatt table?
I don't want to create 6 different services just so I can have a characteristic with a different base UUID.

Thanks.

Parents
  • Hi,

    Thank you. Your suggestion worked. I can now see all my 6 characteristics attached to the same service.

    Chiz

  • I do have one more question:

    My application has three services, including battery service and device information service.
    In my main.c file, I try to add the services, along with my custom service for advertising. However, this causes a crash.
    This is the piece of code that adds my service uuid. How do I make my custom service advertise its UUID? 

    // YOUR_JOB: Use UUIDs for service(s) used in your application.
    static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
    {
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
        {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
        {BLE_UUID_VECTOR_PUMP, BLE_UUID_TYPE_VENDOR_BEGIN}
    };
    
Reply
  • I do have one more question:

    My application has three services, including battery service and device information service.
    In my main.c file, I try to add the services, along with my custom service for advertising. However, this causes a crash.
    This is the piece of code that adds my service uuid. How do I make my custom service advertise its UUID? 

    // YOUR_JOB: Use UUIDs for service(s) used in your application.
    static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
    {
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
        {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
        {BLE_UUID_VECTOR_PUMP, BLE_UUID_TYPE_VENDOR_BEGIN}
    };
    
Children
Related