This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

service data advertisement and 128 uuid

Hi,

I searched through the devzone but I cannot find a answer on this question but the question has been asked before. Some background. I have a working solution from another vendor and I want to switch to Nordic. In this solution I use service data to advertise our product including some data about the product. I am now looking in the SDK to see how I can implement this with Nordic. Ok, so the ble_advdata_service_data_t structure needs a uint16_t for de uuid. I use 128 bits uuid's. I can add them with sd_ble_uuid_vs_add. This returns a UUID type. Now the question is. How do I match the UUID type return from sd_ble_uuid_vs_add to the service_uuid field in ble_advdata_service_data_t structure.

Cheers, Marcel

Parents
  • Please have a look at experimental_ble_app_uart, it includes a 128 bit UUID in the scan response.

    It is not included in the advertising packet, because it would become to big with both a device name and a 128 bit UUID in it.

    However, you can easily remove the device name (use BLE_ADVDATA_NO_NAME), and add the UUID to the advertising packet by replacing:

    scanrsp.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    scanrsp.uuids_complete.p_uuids  = adv_uuids;
    

    with:

    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = adv_uuids;
    
Reply
  • Please have a look at experimental_ble_app_uart, it includes a 128 bit UUID in the scan response.

    It is not included in the advertising packet, because it would become to big with both a device name and a 128 bit UUID in it.

    However, you can easily remove the device name (use BLE_ADVDATA_NO_NAME), and add the UUID to the advertising packet by replacing:

    scanrsp.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    scanrsp.uuids_complete.p_uuids  = adv_uuids;
    

    with:

    advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    advdata.uuids_complete.p_uuids  = adv_uuids;
    
Children
Related