This would be a continuation from a previous discussion on the topic of Bonding information and the process of bonding between the peripheral aka headset and central device aka gateway. I have read through the previous one and have a couple of more questions to understand how to handshaking process happens between two devices.
So far we know that the connection is initiated by the peripheral by advertising type ADV_IND and the central accepts the connection for the connection to be esrtablished. After the first successful connection, the random ID generated by the central is stored by the peripheral. This ID is somehow retained by the peripheral throughout any reboots/resets and is used to connect to the cental using ADV_DIRECT_IND advertisement type.
Looking at the code and debug logs for the unicast_server example, the peripheral always try to establish a directed advertisement to connect to the known gateway and if that fails, it will resort back to open connection advertisement.
- Is the above understanding true?
- How is the ID retained in the peripheral?
- Is it possible to setup a static ID for the central and let the perihperal always try connecting to it? If so, how?