this is my code: this is BLE_peripheral UART and i added these lines to main(): my soft device is S130 V2 alpha
// Initialize.
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
uart_init();
buttons_leds_init(&erase_bonds);
ble_stack_init();
gap_params_init();
services_init();
advertising_init();
conn_params_init();
printf("%s",start_string);
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
// Enter main loop.
for (;;)
{
int i = 0;
for(i=0;i<95000000;i++);//delay
NRF_RADIO->TASKS_DISABLE = 1;
NRF_RADIO->TASKS_STOP = 1;
NVIC_DisableIRQ(RTC1_IRQn);
err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF);
NRF_RADIO->POWER = 0;
sd_ble_gap_rssi_stop(m_conn_handle);
printf("A");
sd_ble_gap_adv_stop();
for(i=0;i<95000000;i++);//delay
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
printf("b");
power_manage();
}
it stops advertising but not disconnect from central and I can send or receive data
I want to turn off BLE and turn it on when I want but I don't know how?