unknownconstant / ArduinoBLE

ArduinoBLE library for Arduino
GNU Lesser General Public License v2.1
6 stars 4 forks source link

Function to enable / disable encryption requirements #13

Open unknownconstant opened 3 years ago

unknownconstant commented 3 years ago

Function to enable and disable encryption requirements as a whole.

The original Arduino BLE library uses uint8_t for characteristic properties, and the new uses the same bits for the properties but changes the type to uint16_t to allow for BLE permissions too. If uint8_t is passed to the new uint16_t then the 8 MSBs may become undefined leading to unpredictable behaviour.

I think the third is the most stable but if the compiler will warn developers putting uint8_t into uint16_t then this doesn’t need to happen.