diff options
-rw-r--r-- | src/bluetooth/bluetooth.pro | 3 | ||||
-rw-r--r-- | src/bluetooth/osx/osxbtcentralmanager.mm | 4 | ||||
-rw-r--r-- | tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp | 6 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro index 6cf0795c..67a001d2 100644 --- a/src/bluetooth/bluetooth.pro +++ b/src/bluetooth/bluetooth.pro @@ -154,7 +154,7 @@ config_bluez:qtHaveModule(dbus) { SOURCES -= qlowenergyservice.cpp SOURCES -= qlowenergycontroller.cpp SOURCES -= qlowenergycontroller_p.cpp -} else:ios { +} else:ios|tvos { DEFINES += QT_IOS_BLUETOOTH LIBS += -framework Foundation -framework CoreBluetooth @@ -197,4 +197,3 @@ config_bluez:qtHaveModule(dbus) { OTHER_FILES += HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS - diff --git a/src/bluetooth/osx/osxbtcentralmanager.mm b/src/bluetooth/osx/osxbtcentralmanager.mm index 2f881f79..e197a78c 100644 --- a/src/bluetooth/osx/osxbtcentralmanager.mm +++ b/src/bluetooth/osx/osxbtcentralmanager.mm @@ -43,12 +43,13 @@ #include <algorithm> #include <limits> -QT_BEGIN_NAMESPACE Q_DECLARE_METATYPE(QLowEnergyCharacteristic) Q_DECLARE_METATYPE(QLowEnergyDescriptor) Q_DECLARE_METATYPE(QLowEnergyHandle) +QT_BEGIN_NAMESPACE + namespace OSXBluetooth { NSUInteger qt_countGATTEntries(CBService *service) @@ -80,7 +81,6 @@ NSUInteger qt_countGATTEntries(CBService *service) QT_END_NAMESPACE -QT_USE_NAMESPACE @interface QT_MANGLE_NAMESPACE(OSXBTCentralManager) (PrivateAPI) diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp index 50ecc099..b31b35f0 100644 --- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp +++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp @@ -189,7 +189,7 @@ void tst_QLowEnergyController::initTestCase() */ void tst_QLowEnergyController::init() { -#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) +#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) || defined(Q_OS_TVOS) /* * Add a delay to give Android/iOS stack time to catch up in between * the multiple connect/disconnects within each test function. @@ -249,7 +249,7 @@ void tst_QLowEnergyController::tst_connect() { QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices(); -#ifdef Q_OS_IOS +#if defined(Q_OS_IOS) || defined(Q_OS_TVOS) if (remoteDeviceInfo.isValid()) #else if (localAdapters.isEmpty() || !remoteDeviceInfo.isValid()) @@ -264,7 +264,7 @@ void tst_QLowEnergyController::tst_connect() else QCOMPARE(control.remoteName(), remoteDeviceInfo.name()); -#ifndef Q_OS_IOS +#if !defined(Q_OS_IOS) && !defined(Q_OS_TVOS) const QBluetoothAddress localAdapter = localAdapters.at(0).address(); QCOMPARE(control.localAddress(), localAdapter); QVERIFY(!control.localAddress().isNull()); |