Disconnected BLE [NRF_ERROR_INVALID_STATE]

Hi, 
I have an application that enable BLE (advertise and connectable) then disable BLE (disconnecte and stop advertising) every 10 second.
My application worked when have no any central connected to my nRF. When I checked on Nordict for Mobile to scan my nRF it show off device name of device and disapear after 10s
But when I try to connect to my nRF when it's advertising and after 10s advertising_stop was called it throwed this error


Here is my code
All above configuration I followed by ble_app_uart example

static void advertising_start(void) {
  NRF_LOG_INFO("call advertising start");
  uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_SLOW);
  APP_ERROR_CHECK(err_code);
}

static void advertising_stop(void) {
  NRF_LOG_INFO("call advertising stop");
  sd_ble_gap_disconnect(m_conn_handle,
      BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
  uint32_t err_code = sd_ble_gap_adv_stop(m_advertising.adv_handle);
  APP_ERROR_CHECK(err_code);
}

int main(){
for (;;) {
    nrf_delay_ms(10000);
    advertising_stop();
    nrf_delay_ms(10000);
    advertising_start();
}

Related