@SpaceToon said in Unknown Exception is not beeing caught in trycatch-Block (Bluetooth Low Energy, ServiceDetailsDiscovery):
@KH-219Design : Thank you very much for your suggestion, for using the lowenergy example from Qt. I did this and the same error occurs there! For this reason, I copied the following code from there and paste it in my .cpp file
@SpaceToon I'm truly happy to hear you are able to make forward progress on this!
This year marks the first year that I have ventured into BLE using Qt, and I have hit some minor hiccups myself. That is why your post caught my attention in the first place. However, I am working on Android and you are on Windows, which have very different backend/underlying BLE system stacks. So based on the difference in operating systems, I was doubtful if anything I learned would really translate directly here.
Your watershed moment about QLowEnergyController::Error prompted me to go look at my code again to see what I am doing in case of QLowEnergyController::Error. I noticed that in my slot I have this comment:
// The Qt API for QLowEnergyController has some confusing // overlap/ambiguity. When we get "ConnectionError" I would EXPECT that // the signal QLowEnergyController::disconnected would also be // forthcoming. But it seems (by observation) that this is not how it // works. So we have to treat BOTH the disconnected signal and the // error signal as signs of a disconnection.... so maybe you and I did actually run into a very similar pitfall after all!
It would be great to know if there is some null-reference bug in Qt BLE itself, but neither you nor I may have time to investigate that further. Since we both seem to have worked around our respective pain points, may we carry on and each deliver a successful project!
You also asked:
Did you compile Qt for debug, and can the debugger see/know the location of the corresponding Qt source files?
Which is a very useful tactic, which I have done many times on Linux Qt.
I just read some of this: https://stackoverflow.com/questions/5571098/how-can-i-make-msvc-debugger-step-into-qt-library-source-code-again/5576414
Which refers to compiling the QtCored5.dll DLL(s) for oneself. (This is essentially analogous to how I do it on Linux, but building Qt from source is usually several hours of effort on the first time... and I'm not talking about the additional potential hours of just letting the compiler run!)
Maybe someone else in this thread has had personal experience with debugging into Qt source files on Microsoft Windows. Or maybe that could be a new thread!