From 3b8a69ad9ea37d43ebe015829230a00ed3acfce7 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 27 Dec 2016 05:20:05 -0800 Subject: [PATCH] Update android build to LinkReference changes --- src/comm/BluetoothLink.cc | 12 ++++-------- src/comm/BluetoothLink.h | 2 +- src/comm/LinkManager.cc | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/comm/BluetoothLink.cc b/src/comm/BluetoothLink.cc index 93bc9b8de..c5a019acd 100644 --- a/src/comm/BluetoothLink.cc +++ b/src/comm/BluetoothLink.cc @@ -29,24 +29,20 @@ #include "BluetoothLink.h" #include "QGC.h" -BluetoothLink::BluetoothLink(BluetoothConfiguration* config) - : _connectState(false) +BluetoothLink::BluetoothLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _connectState(false) , _targetSocket(NULL) #ifdef __ios__ , _discoveryAgent(NULL) #endif , _shutDown(false) { - Q_ASSERT(config != NULL); - _config = config; - _config->setLink(this); - //moveToThread(this); + } BluetoothLink::~BluetoothLink() { - // Disconnect link from configuration - _config->setLink(NULL); _disconnect(); #ifdef __ios__ if(_discoveryAgent) { diff --git a/src/comm/BluetoothLink.h b/src/comm/BluetoothLink.h index 2a2b98144..9e9d318bb 100644 --- a/src/comm/BluetoothLink.h +++ b/src/comm/BluetoothLink.h @@ -169,7 +169,7 @@ protected: private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - BluetoothLink(BluetoothConfiguration* config); + BluetoothLink(SharedLinkConfigurationPointer& config); ~BluetoothLink(); // From LinkInterface diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index c4482009d..e014464d3 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -493,7 +493,7 @@ void LinkManager::_updateAutoConnectLinks(void) // Android builds only support a single serial connection. Repeatedly calling availablePorts after that one serial // port is connected leaks file handles due to a bug somewhere in android serial code. In order to work around that // bug after we connect the first serial port we stop probing for additional ports. - if (!_autoconnectConfigurations.count()) { + if (!_sharedAutoconnectConfigurations.count()) { portList = QGCSerialPortInfo::availablePorts(); } #else -- 2.22.0