If the device is bonded there is will be no need to re-do the pairing process as the keys will be stored.
So enabling bonding in your project and storing the bonded data will help.
Below project can be a place to get started on bonding
Thank you for the response. I have been looking at that example. I think what is unclear to me is the bonding process.
My module is set up for security mode 1 with unauthenticated encryption and the bonding option is selected.
I can connect to the cypress dongle and pair and when I look at the dongle information it contains the bonding information and keys so it seems to have bonded OK and everything works fine.
If, from the dongle, I break the connection and reconnect, if I try to read the characteristics, I get the message:
“Read characteristic value failed. Insufficient encryption”
I then have to pair again, at which point I can read the information. Should the connection not automatically recognize the dongle?
If I remove power from the my device and connect again, when I connect the dongle to my device, I cannot access the characteristic, but also I cannot pair. I have to remove the whitelist in the dongle before I can pair.
So, in my implementation, I have not yet stored any of the configuration data into EEPROM so I would nearly expect an error here.
However in case 1, as the system has not been reset, I would have expected it still to be there – why do I have to pair again.
Thanks for the help
In case -1 If the link has to be encrypted, then either of the two BLE devices should send an authentication/encryption request.
This is done when you click the Pair button. So, independent of whether bonded or not, either of the devices should send an encryption request or pairing request to encrypt the link.
This is the reason you are required to pair again.
Thank you for the email Ranjith,
I am getting very different answers from the various web searches that I am doing so just to clarify:
If I have made a connection and am bonded, if I drop the connection, if I want to reconnect, I have to go through the pairing process again even though the LTKs are known?
In other documents that I have read, it states that for a bonded system, the pairing process does not need to be repeated – this is where is confusion is.
Extremely sorry for the delayed response.
Bonding is the process in which the keys and identity information exchanged are saved. After devices are bonded, they do not have to go through the pairing process again when reconnected.
In case 1 - Are you able to Read in CySmart Android App ? Could you please let us know what is the version of Cypress Dongle which you are using. Pease check the security parameters in master configuration as well.
When we change the security level to "unauthenticated with encryption", then the characteristic values will be encrypted as shown in attached image. Can you change the encryption in Read permissions to "No encryption required" and check the results.
In case 2 - Please make sure that the bonding data is stored (using the API CyBle_StoreBondingData()). We should store the bonding information in Flash by multiple call of CyBle_StoreBondingData().
Encryption.PNG 20.4 K