Hello
I am testing sending the value to the app through the ble_app_uart of SDK v17.
I know roughly that I need to use 'ble_nus_data_send', but it is not printed from the nRF Connect app.
int main(void)
{
bool erase_bonds;
// Initialize.
uart_init();
log_init();
timers_init();
buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
// Start execution.
printf("\r\nUART started.\r\n");
NRF_LOG_INFO("Debug logging for UART over RTT started.");
advertising_start();
// Enter main loop.
for (;;)
{
idle_state_handle();
char data_string1[] = {"TEST"}; //string data1
uint16_t length1 = sizeof(data_string1); //data length
//send data to app (OK)
ble_nus_data_send(&m_nus, data_string1, &length1, m_conn_handle);
}
}
I've only added the part about text transfer in the example ble_app_uart.
Is there anything I should do wrong or add?
And if I run this example and connect with the app, the connection will be lost in about 30 seconds, so can you tell me why?
Thank you.




