Err_code=ble_nus_data_send(.......);,showing fatal error abd error 5.what to do
Err_code=ble_nus_data_send(.......);,showing fatal error abd error 5.what to do
Check out the answer Given by Edvin in this ticket:
"The explanation is using the unmodified ble_app_uart example:
The connection handle is, during the startup of the ble_app_uart example, set to BLE_CONN_HANDLE_INVALID (= 0xFFFF).
In the BLE_GAP_EVT_CONNECTED event in ble_evt_handler in main.c, the conn_handle, m_conn_handle is set to the conn_handle of the connection event, and it remains unchanged until the disconnected-event.
If you look in the same example, in the uart_event_handle() in main.c, which is the only place using the ble_nus_data_send() function, you can see that it ignores returns from ble_nus_data_send if the err_code = NRF_ERROR_INVALID_STATE, NRF_ERROR_BUSY or NRF_ERROR_NOT_FOUND."
Best regards,
Simon
Check out the answer Given by Edvin in this ticket:
"The explanation is using the unmodified ble_app_uart example:
The connection handle is, during the startup of the ble_app_uart example, set to BLE_CONN_HANDLE_INVALID (= 0xFFFF).
In the BLE_GAP_EVT_CONNECTED event in ble_evt_handler in main.c, the conn_handle, m_conn_handle is set to the conn_handle of the connection event, and it remains unchanged until the disconnected-event.
If you look in the same example, in the uart_event_handle() in main.c, which is the only place using the ble_nus_data_send() function, you can see that it ignores returns from ble_nus_data_send if the err_code = NRF_ERROR_INVALID_STATE, NRF_ERROR_BUSY or NRF_ERROR_NOT_FOUND."
Best regards,
Simon