diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-05-31 09:43:58 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-06-09 10:46:27 +0000 |
commit | 74916ede2ff34c2040db9cabbb5a6ee81442a7e8 (patch) | |
tree | b7cc7d9b80d83aa18bca42e593dc1fc30c5a6b47 /src/bluetooth/qbluetoothservicediscoveryagent_p.h | |
parent | 3bf621a5e611eb5b7585464d0453a87b688f7a4e (diff) |
Adds a better state transition support to the BluetoothModel
When the model changes quickly from one discovery mode to the next, the
public device discovery agent and the internal device discovery agent
inside QBlutoothServiceDiscoveryAgent interact with each other. One agent
is shutting down while the other is starting. Since both instances
manage the same hardware, the resulting signals hit the agents in
unexpected states which even leads to random crashes.
The fix is to let one agent stop and only start the next one once the
first has properly shut down. Unfortunately the public BluetoothModel
API acts synchronously via its running property. Therefore the
synchronous running property must be mapped to asynchronous state changes
inside the agents. To achieve this the model uses an internal state
transition table which determines how the next setRunning(bool) call
is to be processed.
As a consequence it is possible to have a non-running BluetoothModel
but the internal agent is still shutting down. Another scenario
might exhibit a running model whereas one internal agent is still
finishing up and the next is waiting to start.
Task-number: QTBUG-51307
Change-Id: I0a471b913b8784d2218a797442cee7ee4d00edf3
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_p.h')
0 files changed, 0 insertions, 0 deletions