Hello
I am using sdk v17.0.2.
I found a problem with Bluetooth connection while using 'ble_nus_data_send()'.
the system will stop if disconnect the Bluetooth while transferring data using NUS UART.
int main(void)
{
int a;
char b[100];
.
.
.
for (;;)
{
idle_state_handle();
//test
a++;
sprintf(b, "%d", a);
uint16_t length = strlen(b);
err_code = ble_nus_data_send(&m_nus, &b, &length, m_conn_handle);
if ((err_code != NRF_ERROR_INVALID_STATE) &&
(err_code != NRF_ERROR_RESOURCES) &&
(err_code != NRF_ERROR_NOT_FOUND) &&
(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING))
{
APP_ERROR_CHECK(err_code); //error when disconnted bluetooth?
}
nrf_delay_ms(2000);
}
}
An error is output from 'APP_ERROR_CHECK(err_code)' in ble_nus_data_send()
Disconnected <error> app: ERROR 12290 [Unknown error code] at C:\Users\Administrator\Desktop\project\examples\ble_peripheral\test\main.c:1327 PC at: 0x0002D395 <error> app: End of error report
Can I know the cause and solution of this?
Thank you.