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

How can i connect to multiple peripherals with different device names?

Hi,

My central device should scan and should get DIS of one peripheral and store in central and central should pass this information to other peripheral .

or

Central should scan and connect to one peripheral  and get DIS and store in central disconnect with that peripheral and again scan and connect to other peripheral and pass this information.but when i scan again i am losing previous data.

Please suggest how can i do it?

Parents
  • Hi,

    To get the device information you will need to connect to the peer, and for instance include the Device Information Service Client, similar to what is done in:
    \nRF5_SDK_15.0.0_a53641a\examples\ble_central\ble_app_rscs_c 

    On connect event you need to run a database discovery by calling ble_db_discovery_start(), thereby when the database discovery is complete the ble_dis_c_evt_handler() will be called, where all the device information can be handled. You can then copy the device information to a global variable to use for later.

     

Reply
  • Hi,

    To get the device information you will need to connect to the peer, and for instance include the Device Information Service Client, similar to what is done in:
    \nRF5_SDK_15.0.0_a53641a\examples\ble_central\ble_app_rscs_c 

    On connect event you need to run a database discovery by calling ble_db_discovery_start(), thereby when the database discovery is complete the ble_dis_c_evt_handler() will be called, where all the device information can be handled. You can then copy the device information to a global variable to use for later.

     

Children
  • Firstly Thanks for your reply,

    Ya i connected one peripheral and retrieved all Device Information Service characteristic values and stored in global variable.Now i need to pass model number(which i retrieved from Device Information Service) to another peripheral.

    when i disconnect and connect to another peripheral my previous data is lost how can i do it?

  • HI,

    I have connected to one peripheral from my central and retrieved all the services(For example i need Device Information Service, got all the characteristic values) and stored in global variables.

    Now i need to connect another peripheral and pass the information(Earlier which i got connected from peripheral Device Information Service values) using Nordic Uart Service(NUS).

     

    After disconnecting from one peripheral and trying to connect other peripheral my previous global variable data is being lost.how can i do it?

    How multilink peripheral_central will work for connecting different device names?

Related