-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ble connection timeouts #29
Comments
Hi @ojg78, thanks for the feedback. Its a good question, and I'm not sure of the answer, since Qt handles BLE connections a bit differently on each platform. So while I don't see that timeout on any of my Pokit devices, I'm most often testing on Linux. You could try raising the timeout (eg to 3 minutes), and enabling debug output, like:
Let us know if that helps, or what the debug output shows. Thanks! |
With the 180 second timeout the same behaviour occurs, issue the command once and get an error then immediately issue the command again to get a successful response. The 180 second timeout option returns the error without delay. Debug below.
I removed some of the sample returns for brevity
|
THanks @ojg78, this looks like something internal to Qt's BLE implementation for Windows. tl;dr Would you mind trying the one of the latest Qt 6.9 beta builds? eg dokit-0.5.4+1474.win.x86-64.msvc.qt-6.9.0.portable.zip (an official Dokit v0.5.4 release; just using Qt 6.9.0 beta). Longer version: for curiosity, I had a look at where this error originates in the Qt Connectivity source code: // Reading characteristics can take surprisingly long at the
// first time, so we need to have a large the timeout here.
hr = QWinRTFunctions::await(op, result.GetAddressOf(),
QWinRTFunctions::ProcessThreadEvents, 5000, earlyExit);
// E_ILLEGAL_METHOD_CALL will be the result for a device, that is not reachable at
// the moment. In this case we should jump back into the outer loop and keep trying.
if (hr == E_ILLEGAL_METHOD_CALL)
break;
EMIT_WORKER_ERROR_AND_QUIT_IF_FAILED_2(hr, "Could not await characteristic read"); It would be nice if Qt would log the value of Anyway, what's more interesting, is that error message ( Thanks! |
Very useful, thank you. Is it just the nature of ble that commands need to be issued several times before they are acknowledged by the Pokit Pro? Seems like it needs a very recent connection to have happened to accept further commands.
The text was updated successfully, but these errors were encountered: