I have a development environment using Zephyr; setup and working from the documentation I found for the nRF Connect SDK. I am using SES and am able to debug the provided examples. How do I alter the build options for the examples? Right clicking the project only has a greyed out "Options". I am attempting to alter the UART Central example to connect to multiple peripheral devices. I can't find any good documentation doesn't seem to touch on this subject at all. Starting a scan after the first device connects leads to that device immediately trying to connect again. It appears like it reconnects automatically. Ideally I would like to catch it during the scan phase and not enter the connection phase if I am already connected? Also, having the scan running during UART data transmission gives me a ENOTCONN error. Anyone try to do something similar?
Take a look at this link to get started. Take a look at section 2.2 Create a light intensity controller. Regarding Zephyr with BLE, we recommend to use the standard nRF5 SDK. However, if you really want to use NCS for BLE, you can do this. I will get back to you on connecting to multiple devices, as a colleague of mine has done exactly this.
You should be able to add the following code to the relevant zephyr code in the prj.conf file: CONFIG_BT_MAX_CONN=n, where you change n to be the number of connections you have. In the LTE Gateway example, we show how you can connect the 52840 via BLE to a Nordic Thingy:52.
I'll double check that but I think this was already updated. I'll be working on this more this week to see if I can make some headway thank you.
Okay so for now I have decided to take a step back and test out just the standard central uart sample given. Just trying to get a single peripheral device to connect and reconnect on power cycle. This does not appear to work out of the box. The first time I connect it works fine but after a power cycle of the peripheral, the peripheral keeps reconnecting over and over again and doing rediscovery.
It seems that maybe this is the whole point of this example. From the testing procedure here, it seems that this may be done on purpose.