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

BLE-UART Non connectable Advertising

Hi,

I am using BLE-UART example in my project and to start advertising I am using below piece of code.

sd_ble_gap_adv_stop(m_advertising.adv_handle);
advertising_init();
ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);

By default in the sdk (ble_advertising.c) the advertising type is set to Connectable.

p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED

However, I want to advertise as non connectable at certain point in my project. 
Setting p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED is not reflecting the advertisement as the type is getting over ridden in sdk function ble_advertising_start() -> set_adv_mode_fast()
My intention is not to change the sdk functions. Can you please guide me how can I make advertisement NONCONNECTABLE in my case?
Thanks,
Justin
Related