Hi,
My project is combined 'Multi-link Central Example' and 'ble_app_uart', so that it is a central that can be connected to multiple peripherals and a peripheral that can be connected to a single central.
When I disconnect from the central which is mobile phone, it immediately restarts advertising.
(This is BLE_GAP_EVT_DISCONNECTED case in ble_advertising_on_ble_evt function.)
static void on_disconnected(ble_advertising_t * const p_advertising, ble_evt_t const * p_ble_evt) { uint32_t ret; p_advertising->whitelist_temporarily_disabled = false; if (p_ble_evt->evt.gap_evt.conn_handle == p_advertising->current_slave_link_conn_handle && p_advertising->adv_modes_config.ble_adv_on_disconnect_disabled == false) { ret = ble_advertising_start(p_advertising, BLE_ADV_MODE_DIRECTED_HIGH_DUTY); if ((ret != NRF_SUCCESS) && (p_advertising->error_handler != NULL)) { p_advertising->error_handler(ret); } } }
1. my question is, what is meaning of
" if (p_ble_evt->evt.gap_evt.conn_handle == p_advertising->current_slave_link_conn_handle &&
p_advertising->adv_modes_config.ble_adv_on_disconnect_disabled == false) "
and why it restart advertising?
And, when it restarts advertising because of above code part, BLE_GAP_EVT_DISCONNECTED case in the ble_evt_handler is not triggered.
(but it triggered well if I erase restart advertising code part..)
2. Does this mean that it didn't disconnected properly? Why this problem happening?
BR,
lyrics