Service scan with QBluetoothServiceDiscoveryAgent first performs a device scan, and once the device scan is completed, a service (SDP) scan is triggered automatically.
However when starting the QtConnectivity pingpong example with Windows in the client role, the device scan often doesn't stop and consequently the service scan doesn't start.
This seems to be (at least) because the
has been decremented too many times, to "-1". The related checks to determine if the scan is then finished or not are not then done properly and scan is not terminated.
The excessive decrement implications are likely two-fold:
1) The device scan never stops
2) Some devices are left unscanned and their services are not found
Hence it is important to understand why this happens instead of just changing the checks.
N.B. this is not consistent behaviour, other kind of behaviour, even a success, can occasionally be seen. This means there is some timing or pairing related factors at play too.