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

Advertising Manufacturer data wrong after connect->disconnect

I implemented  manufacturer specific advertising to transmit important data without having to connect to the ble peripheral. These data can change over time so I need to be able to update them.

I adapted advertising_init. I also programmed a function to update the advertising data: the latter stops advertising, calls ble_advdata_set and then restarts advertising

All of this works fine until I connect to the peripheral using nrf-connect. After I disconnect, the manufacturer specific part of the advertising packet is wrong.

Shall I call ble_advdata_set again after disconnect and if so where is the best place to do it ?

I am using sdk 14.2 and the softdevice 132

Thanks in advance,

Christian

Parents
  • Hi.

    Sorry for the delay.

    When you want to update the advertising data (both advertisement packet and/or scan response packet) without stopping the advertisement, you are correct in using the ble_advdata_set() function.
    This will in turn call the sd_ble_gap_adv_data_set() to pass encoded advertising data to the stack.

    When it comes to disable whitelist, you can take a look at this function; ble_advertising_restart_without_whitelist()
    Note that this will restart the advertisment.

    If you have any problems using these functions, you could try debugging your application to find out more exactly what going wrong.
    If you can't find the answer to your issue by searching around devzone, you are more than welcome to post follow-up questions here, and I'll do my best to help you solve them.
    Posting your code might help shed som light on what the issue might be.

    Best regards,
    Joakim.

     

Reply
  • Hi.

    Sorry for the delay.

    When you want to update the advertising data (both advertisement packet and/or scan response packet) without stopping the advertisement, you are correct in using the ble_advdata_set() function.
    This will in turn call the sd_ble_gap_adv_data_set() to pass encoded advertising data to the stack.

    When it comes to disable whitelist, you can take a look at this function; ble_advertising_restart_without_whitelist()
    Note that this will restart the advertisment.

    If you have any problems using these functions, you could try debugging your application to find out more exactly what going wrong.
    If you can't find the answer to your issue by searching around devzone, you are more than welcome to post follow-up questions here, and I'll do my best to help you solve them.
    Posting your code might help shed som light on what the issue might be.

    Best regards,
    Joakim.

     

Children
No Data
Related