diff --git a/libguh/bluetooth/bluetoothlowenergydevice.cpp b/libguh/bluetooth/bluetoothlowenergydevice.cpp index 2437499f..269c79fb 100644 --- a/libguh/bluetooth/bluetoothlowenergydevice.cpp +++ b/libguh/bluetooth/bluetoothlowenergydevice.cpp @@ -17,6 +17,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "bluetoothlowenergydevice.h" +#include "loggingcategories.h" BluetoothLowEnergyDevice::BluetoothLowEnergyDevice(const QBluetoothDeviceInfo &deviceInfo, const QLowEnergyController::RemoteAddressType &addressType, QObject *parent) : QObject(parent), m_deviceInfo(deviceInfo) @@ -69,21 +70,21 @@ bool BluetoothLowEnergyDevice::isConnected() const void BluetoothLowEnergyDevice::connected() { m_connected = true; - qDebug() << "connected to bluetooth LE device:" << name() << address().toString(); + qCDebug(dcHardware) << "Connected to Bluetooth LE device:" << name() << address().toString(); emit connectionStatusChanged(); - qDebug() << "discover services..."; + qCDebug(dcHardware) << "Discover Bluetooth LE services..."; m_controller->discoverServices(); } void BluetoothLowEnergyDevice::disconnected() { m_connected = false; - qWarning() << "disconnected from bluetooth LE device:" << name() << address().toString(); + qCWarning(dcHardware) << "Disconnected from Bluetooth LE device:" << name() << address().toString(); emit connectionStatusChanged(); } void BluetoothLowEnergyDevice::deviceError(const QLowEnergyController::Error &error) { if (isConnected()) - qWarning() << "ERROR: Bluetooth LE device:" << name() << address().toString() << ": " << error << m_controller->errorString(); + qCWarning(dcHardware) << "Bluetooth LE device:" << name() << address().toString() << ": " << error << m_controller->errorString(); } diff --git a/libguh/bluetooth/bluetoothscanner.cpp b/libguh/bluetooth/bluetoothscanner.cpp index 7b1b5ff8..3babc472 100644 --- a/libguh/bluetooth/bluetoothscanner.cpp +++ b/libguh/bluetooth/bluetoothscanner.cpp @@ -35,6 +35,7 @@ */ #include "bluetoothscanner.h" +#include "loggingcategories.h" /*! Construct the hardware resource BluetoothScanner with the given \a parent. */ BluetoothScanner::BluetoothScanner(QObject *parent) : @@ -54,7 +55,7 @@ bool BluetoothScanner::isAvailable() // Check if Bluetooth is available on this device if (!localDevice.isValid()) { - qWarning() << "ERROR: no bluetooth device found."; + qCWarning(dcHardware) << "No Bluetooth device found."; m_available = false; return false; } @@ -68,7 +69,7 @@ bool BluetoothScanner::isAvailable() // Get connected devices QList remotes = localDevice.allDevices(); if (remotes.isEmpty()) { - qWarning() << "ERROR: no bluetooth host info found."; + qCWarning(dcHardware) << "No Bluetooth host info found."; m_available = false; return false; } @@ -81,7 +82,7 @@ bool BluetoothScanner::isAvailable() connect(m_discoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &BluetoothScanner::deviceDiscovered); connect(m_discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), this, SLOT(onError(QBluetoothDeviceDiscoveryAgent::Error))); - qDebug() << "--> Bluetooth discovery created successfully."; + qCDebug(dcDeviceManager) << "--> Bluetooth discovery created successfully."; m_available = true; return true; } @@ -101,7 +102,7 @@ bool BluetoothScanner::discover(const PluginId &pluginId) m_deviceInfos.clear(); m_discoveryAgent->start(); m_timer->start(); - qDebug() << "Bluetooth discovery started..."; + qCDebug(dcHardware) << "Bluetooth discovery started..."; return true; } return false; @@ -114,7 +115,7 @@ void BluetoothScanner::deviceDiscovered(const QBluetoothDeviceInfo &device) if (device.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration) { bluetoothLE = true; } - qDebug() << "Bluetooth device discovered:" << device.name() << device.address() << "LE:" << bluetoothLE; + qCDebug(dcHardware) << "Bluetooth device discovered:" << device.name() << device.address() << "LE:" << bluetoothLE; m_deviceInfos.append(device); } @@ -131,12 +132,12 @@ void BluetoothScanner::onError(QBluetoothDeviceDiscoveryAgent::Error error) if (isRunning()) m_discoveryAgent->stop(); - qWarning() << "ERROR: Bluetooth discovery:" << m_discoveryAgent->errorString(); + qCWarning(dcHardware) << "Bluetooth discovery error:" << m_discoveryAgent->errorString(); } void BluetoothScanner::discoveryTimeout() { - qDebug() << "Bluetooth discovery finished."; + qCDebug(dcHardware) << "Bluetooth discovery finished."; m_discoveryAgent->stop(); emit bluetoothDiscoveryFinished(m_pluginId, m_deviceInfos); } diff --git a/libguh/hardware/radio433/radio433.cpp b/libguh/hardware/radio433/radio433.cpp index da817ae5..863fc984 100644 --- a/libguh/hardware/radio433/radio433.cpp +++ b/libguh/hardware/radio433/radio433.cpp @@ -111,7 +111,7 @@ bool Radio433::enable() // return false; // } } - qCDebug(dcHardware) << "--> Radio 433 MHz GPIO's enabled."; + qCDebug(dcDeviceManager) << "--> Radio 433 MHz GPIO's enabled."; #endif return true; @@ -134,7 +134,7 @@ bool Radio433::disabel() void Radio433::brennenstuhlAvailableChanged(const bool &available) { if (available) { - qCDebug(dcHardware) << "--> Radio 433 MHz Brennenstuhl LAN Gateway available."; + qCDebug(dcDeviceManager) << "--> Radio 433 MHz Brennenstuhl LAN Gateway available."; } else { qCWarning(dcHardware) << "--> Radio 433 MHz Brennenstuhl LAN Gateway NOT available."; } diff --git a/libguh/network/networkmanager.cpp b/libguh/network/networkmanager.cpp index 077b1d7a..1f55ba5c 100644 --- a/libguh/network/networkmanager.cpp +++ b/libguh/network/networkmanager.cpp @@ -46,7 +46,7 @@ NetworkManager::NetworkManager(QObject *parent) : m_manager = new QNetworkAccessManager(this); connect(m_manager, &QNetworkAccessManager::finished, this, &NetworkManager::replyFinished); - qCDebug(dcHardware) << "--> Network manager created successfully."; + qCDebug(dcDeviceManager) << "--> Network manager created successfully."; } /*! Posts a request to obtain the contents of the target \a request from the plugin with the given \a pluginId diff --git a/libguh/network/upnpdiscovery/upnpdiscovery.cpp b/libguh/network/upnpdiscovery/upnpdiscovery.cpp index 61268dab..6602fb0a 100644 --- a/libguh/network/upnpdiscovery/upnpdiscovery.cpp +++ b/libguh/network/upnpdiscovery/upnpdiscovery.cpp @@ -78,7 +78,7 @@ UpnpDiscovery::UpnpDiscovery(QObject *parent) : connect(this,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(error(QAbstractSocket::SocketError))); connect(this, &UpnpDiscovery::readyRead, this, &UpnpDiscovery::readData); - qCDebug(dcHardware) << "--> UPnP discovery created successfully."; + qCDebug(dcDeviceManager) << "--> UPnP discovery created successfully."; } /*! Returns false, if the \l{UpnpDiscovery} resource is not available. Returns true, if a device with diff --git a/plugins/deviceplugins/elgato/aveabulb.cpp b/plugins/deviceplugins/elgato/aveabulb.cpp index 260ff668..66d1e222 100644 --- a/plugins/deviceplugins/elgato/aveabulb.cpp +++ b/plugins/deviceplugins/elgato/aveabulb.cpp @@ -16,6 +16,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifdef BLUETOOTH_LE #include "aveabulb.h" AveaBulb::AveaBulb(const QBluetoothDeviceInfo &deviceInfo, const QLowEnergyController::RemoteAddressType &addressType, QObject *parent) : @@ -570,3 +571,5 @@ bool AveaBulb::setMagicHour(ActionId actionId) sendNextCommand(); return true; } + +#endif // BLUETOOTH_LE diff --git a/plugins/deviceplugins/elgato/aveabulb.h b/plugins/deviceplugins/elgato/aveabulb.h index 6a6aa86e..9e659e9e 100644 --- a/plugins/deviceplugins/elgato/aveabulb.h +++ b/plugins/deviceplugins/elgato/aveabulb.h @@ -19,6 +19,8 @@ #ifndef AVEABULB_H #define AVEABULB_H +#ifdef BLUETOOTH_LE + #include #include @@ -95,5 +97,6 @@ public slots: bool setMagicHour(ActionId actionId); }; +#endif // BLUETOOTH_LE #endif // AVEABULB_H diff --git a/plugins/deviceplugins/elgato/commandrequest.cpp b/plugins/deviceplugins/elgato/commandrequest.cpp index 6d4636a9..b78c24f2 100644 --- a/plugins/deviceplugins/elgato/commandrequest.cpp +++ b/plugins/deviceplugins/elgato/commandrequest.cpp @@ -16,6 +16,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifdef BLUETOOTH_LE + #include "commandrequest.h" CommandRequest::CommandRequest() : @@ -46,3 +48,5 @@ QByteArray CommandRequest::value() const { return m_value; } + +#endif // BLUETOOTH_LE diff --git a/plugins/deviceplugins/elgato/commandrequest.h b/plugins/deviceplugins/elgato/commandrequest.h index 635526a0..990675fc 100644 --- a/plugins/deviceplugins/elgato/commandrequest.h +++ b/plugins/deviceplugins/elgato/commandrequest.h @@ -19,6 +19,8 @@ #ifndef COMMANDREQUEST_H #define COMMANDREQUEST_H +#ifdef BLUETOOTH_LE + #include #include #include @@ -41,4 +43,6 @@ private: }; +#endif // BLUETOOTH_LE + #endif // COMMANDREQUEST_H diff --git a/plugins/deviceplugins/elgato/devicepluginelgato.cpp b/plugins/deviceplugins/elgato/devicepluginelgato.cpp index 5dde564d..4af2a410 100644 --- a/plugins/deviceplugins/elgato/devicepluginelgato.cpp +++ b/plugins/deviceplugins/elgato/devicepluginelgato.cpp @@ -397,6 +397,8 @@ \quotefile plugins/deviceplugins/elgato/devicepluginelgato.json */ +#ifdef BLUETOOTH_LE + #include "devicepluginelgato.h" #include "plugin/device.h" @@ -592,5 +594,6 @@ void DevicePluginElgato::actionFinished(const ActionId actionId, const bool &suc } } +#endif // BLUETOOTH_LE diff --git a/plugins/deviceplugins/elgato/devicepluginelgato.h b/plugins/deviceplugins/elgato/devicepluginelgato.h index 23e1f2eb..c0f87804 100644 --- a/plugins/deviceplugins/elgato/devicepluginelgato.h +++ b/plugins/deviceplugins/elgato/devicepluginelgato.h @@ -19,6 +19,8 @@ #ifndef DEVICEPLUGINELGATO_H #define DEVICEPLUGINELGATO_H +#ifdef BLUETOOTH_LE + #include "plugin/deviceplugin.h" #include "bluetooth/bluetoothlowenergydevice.h" #include "aveabulb.h" @@ -49,5 +51,6 @@ private slots: void bulbAvailableChanged(); void actionFinished(const ActionId actionId, const bool &success); }; +#endif // BLUETOOTH_LE #endif // DEVICEPLUGINELGATO_H