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

sd_ble_gap_disconnect error

Hello,

I have read a lot posts which has the same title unfortunately I am still unable to solve my problem. I am using pca10028, s110, SDK 6. Code is based on BLE_app_uart exapmle. This is my main function:

int main(void)
{
    timers_init();    	
	gpio_config();
	ble_stack_init();
	gap_params_init(); 		/*Generic Access Profile lowest layer of BlueTotth stack*/
	services_init();   		/*Add services*/
	advertising_init();		/*Advertising congif*/
	conn_params_init();   /*connection param config*/
	sec_params_init();    /*security param config*/
	/*BlueTooth done*/
	advertising_start();  
	
	while(1)
			{  
		 
				 if( m_conn_handle != BLE_CONN_HANDLE_INVALID ) // BLE is connected. Do service routine.
					{

						while (ble_tx_complete != 1)						
						{
							nrf_gpio_pin_write(GPIO_TOGGLE_CHECK_EVENT, 0);
							sprintf(send_string,"TEST");
							ble_nus_send_string(&m_nus,send_string,5);
						}												
						
						err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
							 if (err_code != NRF_SUCCESS)
								 {
								 return err_code;
								 }

		                        }
                power_manage();     	
               }
}

When I use break point at return err_code; I get result err_code = 0x00000008. NRF_UART does not show that it was disconnected to board. I do not know how to proceed further. Could anyone suggest what should I do next?

Thank you in advance.

Parents Reply Children
No Data
Related