Chreece / BTHomeV2-ESP32-example

An BTHome v2 example with encryption for ESP32
MIT License
35 stars 7 forks source link

Add data encryption support #4

Closed countrysideboy closed 1 year ago

countrysideboy commented 1 year ago

Port the code form bthome-weather-station project.

ENABLE_ENCRYPT will add extra data to the adv,which may makes the length longer than 31(bluetooth 4.0), so buildPaket with only one measurement data.

Maybe we should upgrade to ble 5.0, but it's another story...

Chreece commented 1 year ago

thank you! will check it the in the next days

countrysideboy commented 1 year ago

Use the bindkey as a string, instead of the byte array, such as “1122aabbcc…”?

Chreece commented 1 year ago

Use the bindkey as a string, instead of the byte array, such as “1122aabbcc…”?

Sorry my fault, you have the bind key in .ino file, yes it would be better to have a string for the user to make it more clear. I will use your code as it is now and will try to make it a string if you don't have any time :)

countrysideboy commented 1 year ago

At first, I try to use the bindkey string, but I find no simple way convert form hex string to byte array.