You’ve got advertising, scanning, and a connection that moves data working. The next question is how the device should behave over time. Should it stay connected whenever it can, or connect only when there’s something to exchange?
There’s no default answer, and staying connected is rarely as free as it looks. Two devices that sleep to save power, drift in and out of...