
Originally Posted by
anneranch
After starting the bluetooth inquiry - discover near-by devices - I IMMEDIATELY receive first signal "device discovered " then after EXPECTED delay I receive second signal " scan completed".
That makes no sense - the "device discovered" should be received AFTER scan in completed.
This implies that "device discovered" signal is not emitted from after the actual scan is finished , but from some yet unknown data base filled previously.
To quote the friendly manual,
To retrieve results asynchronously, connect to the deviceDiscovered() signal. To get a list of all discovered devices, call discoveredDevices() after the finished() signal.
and in regards to deviceDiscovered() :
The signal is emitted as soon as the most important device information has been collected. However, as long as the finished() signal has not been emitted the information collection continues even for already discovered devices.
If you ask for the asynchronous signal, as the btscanner example does, then the process runs something like this:
Scan starts
While (scan not complete)
If a device is discovered (i.e. an inquiry response received)
emit a deviceDiscovered() signal as soon as enough information is known
add device to discovered list
keep scanning
emit finished() signal
Scan starts
While (scan not complete)
If a device is discovered (i.e. an inquiry response received)
emit a deviceDiscovered() signal as soon as enough information is known
add device to discovered list
keep scanning
emit finished() signal
To copy to clipboard, switch view to plain text mode
So, it is perfectly logical for the discovery signal to appear before the finished signal... (It seems illogical to expected reports of new devices after it is finished looking)
It is also possible the same device might be discovered twice but I do not know if that leads to more deviceDiscovered() signals for the same device.
The time from the start of scan (Bluetooth inquiry out) to the first detected device (inquiry response) might be measured in milliseconds, more than fast enough to be considered "IMMEDIATELY", or it may be coming from an operating system maintained list of active devices. Either way the device exists.
If you want a single consolidated list then wait only on the finished signal (after about 10.24 seconds I guess) and use the discoveredDevices() to list all discovered devices in one hit. You should watch the error signal too.

Originally Posted by
anneranch
This is just one starting "problem" I could use some assistance with , if it is a real issue. I do not know.
Does not seem like problem at all.
Bookmarks