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.

CC2640R2F: two-way communication

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, CC2564, LAUNCHXL-CC2640R2

I am considering using two CC2640 or CC2564's for a project which requires two way BLE communication. Pressing a button on one end should cause an event on the other, and vice versa. Can I do this using these chips? It's an extremely simple application requiring minimal processing. Focus is on size and battery life. Thanks in advance for any helpful responses.

  • Hi Jorge,

    Thanks for posting! As with many things in BLE, there are several different ways to accomplish this goal, the trick is going to be figuring out what makes most sense for your care-abouts. I think you could have one device be the BLE central and the other be the BLE peripheral, where the BLE peripheral can use notifications to tell the central when a button has been pressed and the central can use a characteristic write to the peripheral when a button has been pressed. Or you could have both devices be both central and peripheral roles, where they both use notifications to tell each other about button presses (effectively you'd have two connections between the same devices, but with roles flipped in the two connections). There's probably a lot more options than this as well. 

    If you are new to BLE, I would recommend first getting a couple of LAUNCHXL-CC2640R2 launchpad boards and going through the SimpleLink Academy modules on BLE Fundamentals, Scanning and Advertising, and Connections. These labs will help you to understand the different types of BLE roles so you can start to get an idea of what roles you want your 2 devices to use for your application. The ProjectZero code used in these labs includes a "button service" that is very similar to what you are talking about doing - it shows the peripheral device using notify to tell the central that a button has been pressed.

    If you decide to make both devices very similar and have them both be peripherals to send button notifications, and also both be centrals to receive button notifications, then you will also want to look at the multi-role example because this will show more how to integrate both roles into one project. The advantage of this approach is that the code on both devices could be exactly the same. If you instead go with an approach where one of the devices is always the central, and the other is the peripheral, you will need two different projects - you could model these after the simple central and simple peripheral example projects. 

    I hope that this can help you to get started!

    Regards,

    Katie

  • You couldn't have given me a better answer, thank you!