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

How to send and recive data to mutiple peripheral devices

Dear

The BLE Multi-link example (ble_app_multilink_central and ble_app_multilink_peripheral) shows how one central device can connect to multiple peripheral devices.

But, I don't know how to send and recive data to mutiple peripheral devices

Is there an example code?

Regards,

sjkim

Parents
  • The Softdevice will assign a connection handle for every bluetooth connection. You can get this connection handle in the BLE_GAP_EVT_CONNECTED event:

    p_gap_evt->conn_handle
    

    So if you are connected to multiple devices you will have multiple connection handles, one for each connection.

    If you take a look at ble_gattc.h you can see that all calls take conn_handle as a parameter.

    So you can choose which devices to interact with by supplying the appropriate connection handle.

Reply
  • The Softdevice will assign a connection handle for every bluetooth connection. You can get this connection handle in the BLE_GAP_EVT_CONNECTED event:

    p_gap_evt->conn_handle
    

    So if you are connected to multiple devices you will have multiple connection handles, one for each connection.

    If you take a look at ble_gattc.h you can see that all calls take conn_handle as a parameter.

    So you can choose which devices to interact with by supplying the appropriate connection handle.

Children
No Data
Related