Bluetooth: restart scan for different device on macOS
This makes no sense, but apparently we need to start a fresh scan in order to be able to talk to a different BLE dive computer on the Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ef0e76bc69
commit
7512a6e915
@ -305,6 +305,15 @@ bool BTDiscovery::checkException(const char* method, const QAndroidJniObject *ob
|
||||
|
||||
void BTDiscovery::discoverAddress(QString address)
|
||||
{
|
||||
#if defined(Q_OS_MACOS)
|
||||
// macOS appears to need a fresh scan if we want to switch devices
|
||||
static QString lastAddress;
|
||||
if (lastAddress != address) {
|
||||
btDeviceInfo.clear();
|
||||
discoveryAgent->stop();
|
||||
lastAddress = address;
|
||||
}
|
||||
#endif
|
||||
if (!btDeviceInfo.keys().contains(address) && !discoveryAgent->isActive()) {
|
||||
qDebug() << "restarting discovery agent";
|
||||
discoveryAgent->start();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user