I attempted to create bluetooth central and peripheral apps using two nRF52840 boards that connect to each other and no one else using the device name. I had limited success, but often the firmware would not connect and I would have to restart it. So I added logic to retry the connection when it dropped, and now it connects an even smaller percentage of the time, and when it does, it ends up dropping the connection as soon as it gets it. I believe that it is due to not stopping the scan once I have a connection, but even though I have logic in the central code to stop scanning, it seems to still restart the scan. But that's an added problem. I've put many days into trying to sort this out, and am hoping someone may be able to set me and the code straight.
The code is zipped in the attached file, with the central in one folder and the peripheral in another. 3252.Firmware.zip