Background
I've built a simple circuit which includes an Arduino Nano and a HM-10 BLE serial module.
You can see that circuit at the following Electrical Engineering SE question: https://electronics.stackexchange.com/questions/412525/when-i-write-data-to-a-ble-characteristic-ffe1-to-send-data-over-bluetooth-is
I also have an Xcode project written in Swift that successfully sends bytes to the FFE1 characteristic. It all works great and I can see the data coming from my iPad via Arduino Serial monitor.
However, from the research I did (see previous link) I believe I've determined that the data I send using Core Bluetooth writeValue() is not encrypted.
What I'm Trying To Do
Now that I've successfully sent and received bytes I would like to cause my iPad to bond with the BLE device (HM-10) so I can insure the data I send is encrypted via the provided BLE channel.
What I've Tried
- Read through the Core Bluetooth docs at Apple, but I cannot find how to pair or bond to the device so that the data sent over the channel will then be encrypted.
- Read every SO question I could find, but can't find any iOS code that shows me how to bond and send data securely.
- I did find some very basic info that to get the devices to bond I
need to try to write to a characteristic of the BLE device that has
the property
CBCharacteristicPropertyNotifyEncryptionRequiredbut the documentation on that at Apple is a ridiculous one-liner. - I wrote code that iterated through the characteristics of the HM-10 and read the properties and I didn't seem to find that property. But the docs on the HM-10 seem to indicate that it does support a authentication and encryption and I know that is a part of BLE.
Questions
- Can you point me to Swift code that gives me an example of what I will do to bond and send encrypted data? Is there some property I need to set on
CBPeriperhalor some param I need to send intowriteValue()? - Am I misunderstanding? Does the HM-10 not support sending encrypted data?

