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

I want to conditionally switch the advertised UUID to another UUID.

Hello.
It is developed using nrf52832 (S132 v7.0.1, SDK v17.0.0) as a peripheral device.

I want to conditionally switch the advertised UUID to another UUID.
There is "sd_ble_uuid_vs_add" as an API to set the advertisement UUID, but I don't know how to change the advertised UUID once set. Is there a way to change it?

Best regards.

  • Hello,

    sdi_kei said:
    I'm using sd_ble_uuid_vs_add to add a UUID to the SoftDevice table.
    However, there is other data in the SoftDevice table, so if you do not specify the added number correctly, you will refer to other data.
    The definition indicating the number is "BLE_UUID_TYPE_VENDOR_BEGIN".
    In my case, it was off by 18, so I was able to correctly set the UUID of the SoftDevice table in the advertisement payload by doing "BLE_UUID_TYPE_VENDOR_BEGIN + 18".

    Hm.. I am not entirely sure that I follow.. How did you find these offsets?
    The UUID type field is indeed the index relative to BLE_UUID_TYPE_VENDOR_BEGIN like described in the sd_ble_uuid_vs_add API Reference documentation, and it will depend on how many UUID's and other information you have populated the SoftDevice table with already.

    sdi_kei said:
    Thank you. Before adding the UUID, I would like to use it to remove the previously added UUID.

    Great! This should keep your memory from overflowing.

    sdi_kei said:
    You can't enable or disable the whitelist at the same time.
    It is possible to disable it with "ble_advertising_restart_without_whitelist", but is there an API to enable it?

    No, you can not advertise both with and without whitelist - this would effectively mean without whitelist.
    It is also correct that there is no specific function to enable whitelist, instead you can enable whitelist in the advertising configuration p_advertising->adv_modes_config.ble_adv_whitelist_enabled and then restart without whitelist or temporarily disable whitelist if needed.

    Best regards,
    Karl

  • Hello.

    How did you find these offsets?

    I referred to this ticket for the setting method.
    Since "BLE_UUID_TYPE_VENDOR_BEGIN + 1" is set for the second advertisement, I interpreted it as being used in a staggered manner.

    ble_adv_whitelist_enabled and then restart without whitelist or temporarily disable whitelist if needed.

    It was said that the whitelist could not be set, so as you told me, I took the method of stopping it, resetting it, and then starting advertising.

    Best regards.

  • sdi_kei said:
    I referred to this ticket for the setting method.
    Since "BLE_UUID_TYPE_VENDOR_BEGIN + 1" is set for the second advertisement, I interpreted it as being used in a staggered manner.

    Aha, I see - thank you for clarifying.

    sdi_kei said:
    It was said that the whitelist could not be set, so as you told me, I took the method of stopping it, resetting it, and then starting advertising.

    Alright, great - I am glad to hear that this is working as intended now!

    Best regards,
    Karl

Related