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

stop the advertising S130

I try to stop the advertising by using ble_advertising_start(BLE_ADV_MODE_IDLE) when the advertising is ongoing. It fails.

Please tell me how to stop advertising when the advertise is on going. I don't want to use advertising timeout because for my application the user press button to stop the advertise.

Parents
  • I have use below code, and the program is hanged at err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);

                     if(m_conn_handle!=BLE_CONN_HANDLE_INVALID)
                        {
                          err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                          APP_ERROR_CHECK(err_code);
                        }
                          err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);
                        APP_ERROR_CHECK(err_code);
                        sd_ble_gap_adv_stop();
    
Reply
  • I have use below code, and the program is hanged at err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);

                     if(m_conn_handle!=BLE_CONN_HANDLE_INVALID)
                        {
                          err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                          APP_ERROR_CHECK(err_code);
                        }
                          err_code = ble_advertising_start(BLE_ADV_MODE_IDLE);
                        APP_ERROR_CHECK(err_code);
                        sd_ble_gap_adv_stop();
    
Children
No Data
Related