Make compile succeed without BT_SUPPORT

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-10-06 07:52:17 -07:00
parent 7aacaf60da
commit 56c82081a5
4 changed files with 9 additions and 14 deletions

View file

@ -21,17 +21,16 @@ endif()
if(BTSUPPORT) if(BTSUPPORT)
add_definitions(-DBT_SUPPORT) add_definitions(-DBT_SUPPORT)
set(BT_SRC_FILES desktop-widgets/btdeviceselectiondialog.cpp) set(BT_SRC_FILES desktop-widgets/btdeviceselectiondialog.cpp)
set(BT_CORE_SRC_FILES qtserialbluetooth.cpp) set(BT_CORE_SRC_FILES qtserialbluetooth.cpp btdiscovery.cpp)
endif() endif()
if(BLESUPPORT) if(BLESUPPORT)
add_definitions(-DBLE_SUPPORT) add_definitions(-DBLE_SUPPORT)
set(BT_CORE_SRC_FILES qt-ble.cpp) set(BT_CORE_SRC_FILES ${BT_CORE_SRC_FILES} qt-ble.cpp)
endif() endif()
# compile the core library, in C. # compile the core library, in C.
set(SUBSURFACE_CORE_LIB_SRCS set(SUBSURFACE_CORE_LIB_SRCS
btdiscovery.cpp
cochran.c cochran.c
datatrak.c datatrak.c
deco.c deco.c

View file

@ -6,13 +6,11 @@
#include <QString> #include <QString>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QAbstractListModel> #include <QAbstractListModel>
#if defined(BT_SUPPORT)
#include <QBluetoothLocalDevice> #include <QBluetoothLocalDevice>
#include <QBluetoothDeviceDiscoveryAgent> #include <QBluetoothDeviceDiscoveryAgent>
#include <QBluetoothUuid> #include <QBluetoothUuid>
#include "core/libdivecomputer.h" #include "core/libdivecomputer.h"
#endif
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
#include <QAndroidJniObject> #include <QAndroidJniObject>
#include <QAndroidJniEnvironment> #include <QAndroidJniEnvironment>
@ -29,7 +27,6 @@ public:
~BTDiscovery(); ~BTDiscovery();
static BTDiscovery *instance(); static BTDiscovery *instance();
#if defined(BT_SUPPORT)
struct btPairedDevice { struct btPairedDevice {
QString address; QString address;
QString name; QString name;
@ -49,28 +46,25 @@ public:
void getBluetoothDevices(); void getBluetoothDevices();
#endif #endif
QList<btVendorProduct> getBtDcs(); QList<btVendorProduct> getBtDcs();
#endif
private: private:
static BTDiscovery *m_instance; static BTDiscovery *m_instance;
bool m_btValid; bool m_btValid;
#if defined(BT_SUPPORT)
QList<struct btVendorProduct> btDCs; // recognized DCs QList<struct btVendorProduct> btDCs; // recognized DCs
QList<struct btVendorProduct> btAllDevices; // all paired BT stuff QList<struct btVendorProduct> btAllDevices; // all paired BT stuff
#endif
#if defined(Q_OS_ANDROID) #if defined(Q_OS_ANDROID)
bool checkException(const char* method, const QAndroidJniObject* obj); bool checkException(const char* method, const QAndroidJniObject* obj);
#endif #endif
#if defined(BT_SUPPORT)
QList<struct btPairedDevice> btPairedDevices; QList<struct btPairedDevice> btPairedDevices;
QBluetoothLocalDevice localBtDevice; QBluetoothLocalDevice localBtDevice;
QBluetoothDeviceDiscoveryAgent *discoveryAgent; QBluetoothDeviceDiscoveryAgent *discoveryAgent;
#endif
signals: signals:
void dcVendorChanged(); void dcVendorChanged();
void dcProductChanged(); void dcProductChanged();
void dcBtChanged(); void dcBtChanged();
}; };
#endif // BTDISCOVERY_H #endif // BTDISCOVERY_H

View file

@ -9,8 +9,9 @@
#include "dive.h" #include "dive.h"
#include "libdivecomputer.h" #include "libdivecomputer.h"
#include "connectionlistmodel.h" #include "connectionlistmodel.h"
#if BT_SUPPORT
#include "core/btdiscovery.h" #include "core/btdiscovery.h"
#endif
/* Helper object for access of Device Data in QML */ /* Helper object for access of Device Data in QML */
class DCDeviceData : public QObject { class DCDeviceData : public QObject {
Q_OBJECT Q_OBJECT
@ -100,5 +101,4 @@ extern QStringList vendorList;
extern QHash<QString, QStringList> productList; extern QHash<QString, QStringList> productList;
extern QMap<QString, dc_descriptor_t *> descriptorLookup; extern QMap<QString, dc_descriptor_t *> descriptorLookup;
extern ConnectionListModel connectionListModel; extern ConnectionListModel connectionListModel;
#endif #endif

View file

@ -9,7 +9,9 @@
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QColor> #include <QColor>
#if BT_SUPPORT
#include "core/btdiscovery.h" #include "core/btdiscovery.h"
#endif
#include "core/gpslocation.h" #include "core/gpslocation.h"
#include "core/downloadfromdcthread.h" #include "core/downloadfromdcthread.h"
#include "qt-models/divelistmodel.h" #include "qt-models/divelistmodel.h"