This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to manually choose device to connect with same service UUID?

Hi all,

I am now using nrf52840DK and llpm example in nrf connect sdk 1.7.1.

Now I have three nrf52840DK, one as master ,and the others are slaves, they both use Latency Service UUID.

So, by this function" bt_scan_filter_add() " in  scanning module, Master will automatically select one slave with the same UUID to connect.    

What I want to is print out the device name("Slave1" , "Slave2") in PUTTY and let user select which slave to connect, Is there any suggestion to do this, plz help,thanks.

Best Regards,

Hao. 

Parents Reply Children
  • thanks a lot, do you mean using other UART approach to connect to broad ?

    Currently I use serial port to connect to broad, can I add  bt_conn_le_create()  in scan_filter_match part after I set  

    .connect_if_match = false(In other's post, I see this approach which seems easier for me as beginner)

    What I am going to do is

    1.using uuid filter to list all the devices with the same uuid and different device name

    2.list all the devices' name on putty

    3.let user input device name and connect to that device

    If I can do by this approach, plz give me some hint using bt_conn_le_create() ,thanks a lot!!

    I will also try the approach you suggest me.

    Best regards,

    Hao

  • Feel free to modify this as you best see fit, my previous reply should provide some guideance on where you can find code that you can use for reference.

    Kenneth

  • Got it ,really thanks for your help.

    Now,I complete using bt_data_parse() in  scan_filter_match() to print out device names with same uuid,

    I originally want to add bt_conn_le_creat() to connect specific device, but this approach can't work because scan_filter_match() keep looping, could you give me some way to do this?

    Best regards

    Hao

  • Likely you will need to make a buffer/array to put the device names into, and only print to the user when a new device name is found.

    Kenneth

  • Hi, Kenneth

    Could you give me more details about what part of the answer you mentioned above should I use?

    I don't understand why I have to use UART in my implementation, thanks!!!!

    Hao

Related