Issue with multiple connections in throughput example

Hi support team

I have been modifying the throughput example (nRF5 SDK v17) to connect the receiving unit (AMT client) to more than one device. I am running this on the nRF52840 DK.

The AMT client connects successfully to multiple devices, but as soon as I connect to a new one the amtc_evt_handler on the client side stops triggering on events from any previous connections and only reacts to the most recent connection. The transmitter (AMT server) however still sends data like before and the receiver also seems to recognize that the connection is maintained.

How can I make sure that amtc_evt_handler triggers on all the connections and not only the most recent one? Do I need to do something like instantiating AMTC multiple times on the client/receiving side? Thank you for any input you can give.

Best,

Oskar

Parents
  • Hello,

    So you say that the AMT client only receives events from the device that connected last? Did you develop the AMT client as well as the peripheral? 

    In general, a peripheral doesn't really bother how many devices the central is connected to, so I suspect that the issue is somewhere in the FW on the AMT. 

    The AMT:
    - Do you have access to the source code for that application?

    - Is it an nRF device?

    - How does it handle the BLE events?

    Best regards,

    Edvin

  • Hi,

    I managed to solve it but I'll still explain a bit,

    The AMT is amtc.c and amts.c (amtc for client and amts for server supposedly..?) from the throughput example (\examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput). I am running this on three different nRF52840 DK units, two for transmitting and one for receiving. 

    The problem was that when on_hvx() in amtc.c was triggered in the receiver, it would do the check below where the p_ctx->conn_handle would be incremented for each connection but p_ble_evt->evt.gattc_evt.conn_handle would correspond to the actual connection handle of the incoming transmission. So, the check was only true when receiving from the most recent connection.   

    static void on_hvx(nrf_ble_amtc_t * p_ctx, ble_evt_t const * p_ble_evt)
    {
        // Check if the event if on the link for this instance
        if (p_ctx->conn_handle != p_ble_evt->evt.gattc_evt.conn_handle)
        {
            return;
        }
        
        ... etc ...
        
    }

Reply
  • Hi,

    I managed to solve it but I'll still explain a bit,

    The AMT is amtc.c and amts.c (amtc for client and amts for server supposedly..?) from the throughput example (\examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput). I am running this on three different nRF52840 DK units, two for transmitting and one for receiving. 

    The problem was that when on_hvx() in amtc.c was triggered in the receiver, it would do the check below where the p_ctx->conn_handle would be incremented for each connection but p_ble_evt->evt.gattc_evt.conn_handle would correspond to the actual connection handle of the incoming transmission. So, the check was only true when receiving from the most recent connection.   

    static void on_hvx(nrf_ble_amtc_t * p_ctx, ble_evt_t const * p_ble_evt)
    {
        // Check if the event if on the link for this instance
        if (p_ctx->conn_handle != p_ble_evt->evt.gattc_evt.conn_handle)
        {
            return;
        }
        
        ... etc ...
        
    }

Children
No Data
Related