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

Updating advertising data (manuf. spec. data) in SDK15

Hello guys! And girls Slight smile

My project is working as expected in SDK14.2.
I'm updating adv data (manuf. spec. data) without any problem with this function



But in SDK15 the function ble_advdata_set() has been deprecated.
The migration guide is says to use ble_advdata_encode() and sd_ble_gap_adv_set_configure() instead.

So I changed it to something like this



And of course... it's not working. :)
I'm getting a very strange error at sd_ble_gap_adv_set_configure() --> app: ERROR 12801 [Unknown error code]

Any idea why?
What I'm doing wrong?
What I have to change to get this working like in the SDK14.2?

Parents
  • Try this code:

  • I also tried this, and recieve error 12, with a ble_advdata_encode(). May be we should encode data directly to m_advertising.enc_advdata? like when we initialize advertising?

  • From BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST docs:
    "Use of Whitelist not permitted with discoverable advertising."

    The code you've posted earlier has this line in advertising init:

    init.config.ble_adv_whitelist_enabled      = true;

    It should be false, or else you need to use the 

    BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED flag instead of BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE.

  • I realized that and I already change to BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
    But the main problem with your (and parallelko) code remain - as I said above.

    I qoute myself: "When I do a disconnect, every single time this my p_manuf_specific_data byte return to the default value defined in advertising_init(), no matter what it was before with an update of adv data."

  • You need to chase the logic of your application. I'm guessing there is a call to advertising_start() or some similar function name whenever a BLE_GAP_EVT_DISCONNECTED is sent to the application. I guess that this function points to the original advertisement data currently set in the m_advertisment instance in main.c 

  • , nope.
    My BLE_GAP_EVT_DISCONNECT is completely empty of any advertising_start() or similar function.



    advertising_start() is called only at the beginning.


    How could I find out what could possibly point to the original advertisement data?

  • Hmm. Send me a PM with your application and I'll take a look at it. 

Reply Children
No Data