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

multi link central uart with multiple peripheral

hi...

I have modified the multi link central to multi link central uart , i can able to connect with 8 peripherals . One central getting connected with multiple peripheral, data are getting transfer between them. Now i want to differentiate the multiple peripherals to central , by using different uuid or name , product address . so that i can able to send the data to particular peripheral device from central .

how can i input the different uuid or name for multiple peripheral ?  i need some sample 

for example i am having central1 , peripherals (A,B,C,D) suppose A want to send message to D how can it send ? is it possible to transfer the data between the peripheral

suggest me a good one 

Thanks in advance 

  • i am not familiar that much in programming . can you explain me with sample code , i want to send to data by using connection handle . i want to put all connected devices in an array so i can able to transmit the data to particular device 

    Thank you 

  • Hi

    If you are using the multi link central example there is actually an array provided for you already, to keep track of the services of each of the connected devices:

    BLE_LBS_C_ARRAY_DEF(m_lbs_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT);  

    Essentially you will get an array called m_lbs_c, of type ble_lbs_c_s (defined on line 146 of ble_lbs_c.h). 

    Since the connection handle starts at 0 and increments by 1 for each connected device, the connection handle is used as an index into the array. The first connected device will update m_lbs_c[0], the second device m_lbs_c[1] and so forth. 

    By default the conn_handle field in the m_lbs_c elements will be initialized to BLE_CONN_HANDLE_INVALID (0xFFFF), but once they are connected the conn_handle will be updated to represent the conn_handle of the connection. 

    If you want you could extend this struct to contain more information on the device, such as a device name or similar that you want to use to address individual devices. 

    When sending data over a link you will send a pointer to the m_lbs_c element, such as you can see in the led status send function: 

    uint32_t ble_lbs_led_status_send(ble_lbs_c_t * p_ble_lbs_c, uint8_t status);

    Best regards
    Torbjørn

  • Hi, Torbjorn 

    actually i am trying to do a task ,

    1.peripherals want to talk to each other (like chating) ,using termite . 

    2. peripheral can't send the data to other peripheral , in case of that i want to use the central as intermediate in between the peripherals . 

    3. here  many peripherals are present , if one want to send the data to particular peripheral  device .

    i have some suggestion 

    can i send the data using mac address or connection handle ?

    EXAMPLE  if peripheral A wants to send the data to peripheral C , then peripheral A pass the data to central using mac address or connection handle and it should tell to central to convey this data to peripheral C and peripheral C will receive and so on .can we do this ? these things to be achieved without changing the code often . 

    once the peripherals got connected to central , whoever in connection they should communicate with all of peripherals(using mac address or connection handle )  in termite .

    Thanks in advance

  • Hi

    Yes, this is possible. 

    On the central side you have to identify the different peripherals by the different items in the m_lbs_c array, where the connection handle of the device corresponds to the index in the array (as I explained in my previous reply). 

    If you want to use the BLE address to identify the device on the terminal side this is also possible, but then the central will have to do the translation between BLE address and connection handle when receiving messages. 

    In other words you will need to store a map in memory that maps between BLE address and connection handle. 

    Best regards
    Torbjørn

  • Thankyou Torbjorn , but how to do that , how the messages will passed from one to another .

Related