This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2640R2F: how to connect automatically two peripherals to central ?

Part Number: CC2640R2F

Tool/software: Code Composer Studio

hi,

I am working cc2640r2f board my project is to connect automatically peripherals to central  ,

how to connect automatically two peripherals to central ?

  • Hi Sony,

    Could you please tell a little bit more about what you mean by automatically - are you wanting to create a central that when it finds peripherals with a particular name or characteristic will initiate a connection? And also, are you going to have a few CC2640R2 boards one as the central and 2 as the peripherals, or are you communicating with a different device where you do not control the code on one side of this (either central or peripheral)?

    Regards,
    Katie
  • thank you for your reply ,

    i want to connect the 2 peripherals to central automatically without pressing any keys one after one peripherals should connect
    i have used ifdef FPGA_AUTO_CONNECT but it is first device connection but i want to connect 2 peripherals one after one automatically without pressing any keys could suggest me
  • Hi Sony,

    The simple_central example already filters for simple_peripheral devices when it is scanning, and then these are the ones that it prints to the terminal to be the options for the user to select. It does this by looking at the Service UUID that is being advertised. You could theoretically instead have it just automatically connect to whatever peripheral is providing a particular Service UUID instead of requiring user input, or you could go off of the device BT Addr, or the Advertising name, or something else. Instead of waiting for the button selections, modify the code to just connect to the first one it finds, then to continue scanning and connect to another one (this could also mean modifying the supported number of connections - there are other threads on this if you search).

    Now, one thing to be aware of - depending on the method you use, just blindly connecting to a device may be a security risk if someone can just make a peripheral that advertises with the same service UUID or advertising name etc. But maybe that is not a concern for your application.

    Another option might be if there is user input required the first time, but you enable pairing and bonding between the devices, and then have the central auto-reconnect for any subsequent time if it sees a device that it is already bonded with. I think this would mean 1 time pairing bonding setup requiring some interaction, but then auto-reconnecting if it sees that device in the future.

    Regards,
    Katie