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

BLE_NUS_C_EVT_NUS_TX_EVT has handle of 0xffff

I have following problem:

I am using a multilink NUS Central. With one peripheral connection everything works fine. But when make a second connection I sometimes get an error when I try to send data back in received event.

In ble_nus_c_evt_handler event with event type BLE_NUS_C_EVT_NUS_TX_EVT the p_ble_nus_c sometimes has an invalid connection handle (0xFFFF).

If I try to send data back I get following warning: <warning> ble_nus_c: Connection handle invalid.

How is this possible? I am assigning the handles with  ble_nus_c_handles_assign on discovery complete.

Does anyone know about this issue?

Parents Reply
  • Please check out this ticket with a similar question. I attached a project in this ticket that works in SDK15.2.0. If you need to use SDK15.0.0, then you must do some debugging.

    Can you please set a breakpoint in on_hvx() in the ble_nus_c.c file? What is the  conn_handle if you check:

    ble_nus_c_evt.conn_handle = p_ble_evt->evt.gattc_evt.conn_handle; ?

    NB: gattc_evt, not gap_evt, which I wrote in an earlier answer (corrected now).

    Best regards,

    Edvin

Children
Related