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

Issues in ble_advertising - BLE_ADV_MODE_IDLE not set as current advertising mode on connection

There are a number of issues in ble_advertising that relate to changing the status of advertising in response to events. Specifically the current adv mode is not changed on connection and is left as the mode when the connection is made. This causes errors later if the current advertising mode is used for decisions.

Likewise the code for uint32_t ble_advertising_start, which seemingly takes as parameter BLE_ADV_MODE_IDLE doesn't stop any ongoing advertising, which results in errors later if advertising is restarted.

Parents
  • Hi,

    Which SDK version are you referring to?

    Referring to SDK 16 it is correct that the advertising model is not changed when connected. However, it is set when restarting advertising for some reason, depending on the reason and the configuration. For instance, on disconnect, advertising is always started with BLE_ADV_MODE_DIRECTED_HIGH_DUTY (though it will only be used if enabled, as there is a ladder in the advertising module). Different events are handled differently though. For instance, If there is a timeout event, then the same model is used again. Also, If the user starts advertising with a call to ble_advertising_start(), then the mode is always provided, so it is up to you.

    Can you elaborate on in which situation you would want the advertising module to behave differently, and how it should behave instead?

Reply
  • Hi,

    Which SDK version are you referring to?

    Referring to SDK 16 it is correct that the advertising model is not changed when connected. However, it is set when restarting advertising for some reason, depending on the reason and the configuration. For instance, on disconnect, advertising is always started with BLE_ADV_MODE_DIRECTED_HIGH_DUTY (though it will only be used if enabled, as there is a ladder in the advertising module). Different events are handled differently though. For instance, If there is a timeout event, then the same model is used again. Also, If the user starts advertising with a call to ble_advertising_start(), then the mode is always provided, so it is up to you.

    Can you elaborate on in which situation you would want the advertising module to behave differently, and how it should behave instead?

Children
No Data
Related