[Interest] Bluetooth LE: Start Encryption (opcode 0x2019)

Jérôme Godbout godboutj at amotus.ca
Mon Feb 15 14:53:18 CET 2021


Maybe you already knew that but just to make sure you pass the right flags on both end, both need to support encryption and they need to support the same encryption type.

[cid:image001.png at 01D70377.BAAD9A90]
Which mode/level are you using? Which version of Bluetooth are you using on both end? The security is an optional phase into Bleutooth your peripheral and central must agree and handle the request on both end, else you will fallback on just work unencrypted connection (Phase 1 in image below), (phase 2 depend on Io capability):
[cid:image004.png at 01D70378.00A410B0]



Jérôme Godbout
Software / Firmware Lead

C: (581) 777-0050
O: (418) 800-1073 ext.: 109
godbotuj at amotus.ca<mailto:godbotuj at amotus.ca>
[cid:image005.png at 01D70378.00A410B0]
dimonoff.com<https://www.dimonoff.com/>   |    amotus.ca<https://www.amotus-solutions.com/>

From: Interest <interest-bounces at qt-project.org> On Behalf Of cagnulein
Sent: February 15, 2021 4:33 AM
To: Simon FEUTRIER <sfeutrier at bluegriot.com>
Cc: Qt Interest <interest at qt-project.org>
Subject: Re: [Interest] Bluetooth LE: Start Encryption (opcode 0x2019)

Hi Simon, my peripheral is a Inspire I1.5 bike so yes, the encryption has been activated from the peripheral (i saw it in the hci snoof log collected using its own proprietary app on Android).
i guess i will wait the iOS tests, and if it will work, i will rewrite from scratch the bluetooth code on android (i mean, with Java not c++) to check if there is something wrong in the Qt layer.

Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud



Il giorno lun 15 feb 2021 alle ore 10:29 Simon FEUTRIER <sfeutrier at bluegriot.com<mailto:sfeutrier at bluegriot.com>> ha scritto:
Hi,

I'm working on Windows so it could be different (who knows) ?
Did you activate your peripheral encryption? What is your peripheral by the way ?
In the issue, there is a link for the mailing exchange and there are some things about android : https://lists.qt-project.org/pipermail/interest/2020-August/035699.html
Also, it has been confirmed that it should be managed internally and that's why we don't have any command to control the encryption behaviour. Thus, we cannot really do a lot of things except going further in the source code or trying to change command order or / and timing.
Cordialement,

Simon Feutrier - Ingénieur systèmes embarqués

BLUEGRioT


Le lun. 15 févr. 2021 à 10:06, cagnulein <cagnulein at gmail.com<mailto:cagnulein at gmail.com>> a écrit :
Hi, thanks for answering my question. The role of my app is Central and yes i already saw your bug reports and i think we're facing the same problem :(
I'm on android btw, and i will test the same source code on iOS and will tell you it will work or not.
If you have some ideas, we should talk ;)

Roberto Viola
Software engineer and open source enthusiast
http://robertoviola.cloud



Il giorno lun 15 feb 2021 alle ore 09:34 Simon FEUTRIER <sfeutrier at bluegriot.com<mailto:sfeutrier at bluegriot.com>> ha scritto:
Hello,

What is the role of your qt app ? Central or Peripheral ?

If it is your Central you cannot start encryption (you need to set encryption from the device side). If you enable your encryption from the peripheral side and it still does not work, look there : https://bugreports.qt.io/browse/QTBUG-86095

If it is your Peripheral, I cannot help you. I did not find any direct commands to enable or disable encryption (for both sides in fact). Neither at service / characteristic side nor at higher level.

Best regards,

Simon


Le lun. 8 févr. 2021 à 09:58, cagnulein <cagnulein at gmail.com<mailto:cagnulein at gmail.com>> a écrit :
Hi, on my application I need to use the opcode 0x2019 to start an encryption BTLE communication. How can I do in QT?
This screenshot reports how the Bluetooth trace should be.
Thanks
R.

_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210215/ebd0754c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 20863 bytes
Desc: image001.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210215/ebd0754c/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 21663 bytes
Desc: image004.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210215/ebd0754c/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 7788 bytes
Desc: image005.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210215/ebd0754c/attachment-0005.png>


More information about the Interest mailing list