mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:13:25 +00:00
Bluetooth: start discovery if address isn't already known
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2954bc5f22
commit
9491c96103
3 changed files with 9 additions and 0 deletions
|
@ -301,6 +301,13 @@ bool BTDiscovery::checkException(const char* method, const QAndroidJniObject *ob
|
|||
}
|
||||
#endif // Q_OS_ANDROID
|
||||
|
||||
void BTDiscovery::discoverAddress(QString address)
|
||||
{
|
||||
if (!btDeviceInfo.keys().contains(address) && !discoveryAgent->isActive()) {
|
||||
qDebug() << "restarting discovery agent";
|
||||
discoveryAgent->start();
|
||||
}
|
||||
}
|
||||
|
||||
bool isBluetoothAddress(const QString &address)
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
QList<btVendorProduct> getBtDcs();
|
||||
QBluetoothLocalDevice localBtDevice;
|
||||
void BTDiscoveryReDiscover();
|
||||
void discoverAddress(QString address);
|
||||
|
||||
private:
|
||||
static BTDiscovery *m_instance;
|
||||
|
|
|
@ -311,6 +311,7 @@ void DownloadFromDCWidget::on_device_currentTextChanged(const QString &device)
|
|||
// ensure we have a discovery running
|
||||
if (btd == nullptr)
|
||||
btd = BTDiscovery::instance();
|
||||
btd->discoverAddress(device);
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(device)
|
||||
|
|
Loading…
Add table
Reference in a new issue