Bluetooth examples = btscanner and btchat
-
I would like to talk to someone with REAL EXPERIENCE with these examples.
I can get “btscanner” to “find” nearby Bluetooth devices – posting “device discovered” .
I cannot get same results from “btchat” “scanning”.
It posts “finished” after abut 30 seconds – hence it is timing out
without errors or “service discovered “ .They both use QbluetoothServiceDiscoveryAgent.
Tracing thru QbluetoothServiceDiscoveryAgent
(btchat) I cannot see anything different from btscanner.I did not find where the “finished” timeout is set.
I am not sure about my implementation of “error” is correct.
I would also like to know to to emulate “error” to
verify that my “error connect” code is correct.Thanks
Addendum
It appears that btchat example is incomplete hence I like to close this post. -
Qt version?
OS / platform version?
Build kit (e.g. MinGW vs MSVC on Windows, etc.)?What is "error"? Are you talking about a slot you've connected to the
QBluetoothServiceDiscoveryAgent
"error()" signal? What is your implementation of it and what is making you question its correctness?What is "error connect"?
For the timeout you can only set it for BTLE searches (see also); there's a setter for it, documented here or in your Qt version's specific docs. I suggest reading the rest of the component documentation, as well, and giving more specifics in your question (also it could be good to edit your subject to be more of a brief summary of your issue).
-
I would like to talk to someone with REAL EXPERIENCE with these examples.
I can get “btscanner” to “find” nearby Bluetooth devices – posting “device discovered” .
I cannot get same results from “btchat” “scanning”.
It posts “finished” after abut 30 seconds – hence it is timing out
without errors or “service discovered “ .They both use QbluetoothServiceDiscoveryAgent.
Tracing thru QbluetoothServiceDiscoveryAgent
(btchat) I cannot see anything different from btscanner.I did not find where the “finished” timeout is set.
I am not sure about my implementation of “error” is correct.
I would also like to know to to emulate “error” to
verify that my “error connect” code is correct.Thanks
Addendum
It appears that btchat example is incomplete hence I like to close this post. -
Qt version?
OS / platform version?
Build kit (e.g. MinGW vs MSVC on Windows, etc.)?What is "error"? Are you talking about a slot you've connected to the
QBluetoothServiceDiscoveryAgent
"error()" signal? What is your implementation of it and what is making you question its correctness?What is "error connect"?
For the timeout you can only set it for BTLE searches (see also); there's a setter for it, documented here or in your Qt version's specific docs. I suggest reading the rest of the component documentation, as well, and giving more specifics in your question (also it could be good to edit your subject to be more of a brief summary of your issue).
@mnbv
AnneRanch about 2 hours agoI would like to talk to someone with REAL EXPERIENCE with these examples.
Before getting into sideline of evaluation of which version / OS - can you answer the above as a question ?
Do you have REAL EXPERIENCE with these examples?
Questioning my usage of " error " leads me to ask the question.
-
@AnneRanch
The Bluetooth support works better with Msvc. I used 5.15.2 and Msvc 2019 on Windows 10. Well support I'with Android.@piervalli Different OS is not an option - I am on Ubuntu and can select any QT version, but currently using 15,x. Did not find much "bluetooth examples" in 6.x
Irregardless of version QT / OS - why do two implementation of "agent" acts two different ways?
Simple answer - btchat implementation of QBluetoothServiceDiscoveryAgent, does not work , hence I should ditch the btchat version / code and rebuild my own implementation of QBluetoothServiceDiscoveryAgent, using btscanner as a template.However, QBluetoothServiceDiscoveryAgent has a nasty feature - does not clear last scan and consequently does not really scan - only uses existing data. Not sure it is worth to work with it.
-
@mnbv
AnneRanch about 2 hours agoI would like to talk to someone with REAL EXPERIENCE with these examples.
Before getting into sideline of evaluation of which version / OS - can you answer the above as a question ?
Do you have REAL EXPERIENCE with these examples?
Questioning my usage of " error " leads me to ask the question.
@AnneRanch Yes, I do. And there are multiple valid contexts for the word "error" (for example, overriding QBluetoothServiceDiscoveryAgent's implementation, handling the signal by the same name, or just referring to the general idea of an error -- we can't tell, because we aren't sitting next to you).
Also version and OS is not a sideline. It's directly relevant to any quirks that you may be running into, and also to any advice (e.g. varying support by build kit, the version of the example itself, etc.). It's also fairly basic information to provide when asking a question about an API of any sort.
So, please, either state your question clearly, or don't get any help. And above all, be nice. The people here volunteer to spend time helping strangers.