discovery fixed

This commit is contained in:
Boernsman 2019-10-18 18:20:18 +02:00 committed by Boernsman
parent e3658865a1
commit fd536272fe
3 changed files with 3 additions and 2 deletions

View File

@ -90,6 +90,7 @@ void DevicePluginLukeRoberts::setupDevice(DeviceSetupInfo *info)
BluetoothLowEnergyDevice *bluetoothDevice = hardwareManager()->bluetoothLowEnergyManager()->registerDevice(deviceInfo, QLowEnergyController::RandomAddress);
LukeRoberts *lamp = new LukeRoberts(bluetoothDevice, this);
connect(lamp, &LukeRoberts::connectedChanged, this, &DevicePluginLukeRoberts::onConnectedChanged);
connect(lamp, &LukeRoberts::deviceInformationChanged, this, &DevicePluginLukeRoberts::onDeviceInformationChanged);
m_lamps.insert(lamp, device);

View File

@ -284,6 +284,7 @@ void LukeRoberts::onExternalApiEndpointCharacteristicChanged(const QLowEnergyCha
if (characteristic.uuid() == m_externalApiEndpoint.uuid()) {
qCDebug(dcLukeRoberts()) << "Data received" << value;
}
uint8_t scene = static_cast<uint8_t>(value.at(2));
if (value.length() > 4) { //its a scene
@ -295,6 +296,5 @@ void LukeRoberts::onExternalApiEndpointCharacteristicChanged(const QLowEnergyCha
}
qCDebug(dcLukeRoberts()) << "Service characteristic changed" << characteristic.name() << value.toHex();
}

View File

@ -31,7 +31,7 @@
#include "typeutils.h"
#include "hardware/bluetoothlowenergy/bluetoothlowenergydevice.h"
static QBluetoothUuid customControlServiceUuid = QBluetoothUuid(QUuid("44092840-0567-11E6-B862-0002^"));
static QBluetoothUuid customControlServiceUuid = QBluetoothUuid(QUuid("44092840-0567-11E6-B862-0002A5D5C51B"));
static QBluetoothUuid externalApiEndpointCharacteristicUuid = QBluetoothUuid(QUuid("44092842-0567-11E6-B862-0002A5D5C51B"));
inline QByteArray &operator<<(QByteArray &l, quint8 r)