usbrly82: Add Qt6 support

This commit is contained in:
Simon Stürz 2025-08-11 15:01:54 +02:00
parent 20d2b6c897
commit f65a662817
4 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2022, nymea GmbH
* Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -28,8 +28,9 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "plugininfo.h"
#include "integrationpluginusbrly82.h"
#include "plugininfo.h"
#include "usbrly82.h"
IntegrationPluginUsbRly82::IntegrationPluginUsbRly82()
{

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2022, nymea GmbH
* Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -31,9 +31,11 @@
#ifndef INTEGRATIONPLUGINUSBRLY82_H
#define INTEGRATIONPLUGINUSBRLY82_H
#include "integrations/integrationplugin.h"
#include <integrations/integrationplugin.h>
#include "serialportmonitor.h"
#include "usbrly82.h"
class UsbRly82;
class IntegrationPluginUsbRly82: public IntegrationPlugin
{

View File

@ -97,7 +97,6 @@ SerialPortMonitor::SerialPortMonitor(QObject *parent) : QObject(parent)
qCDebug(dcUsbRly82()) << "SerialPortMonitor: [+]" << info;
m_serialPortInfos.insert(info.systemLocation, info);
emit serialPortAdded(info);
}
udev_enumerate_unref(enumerate);

View File

@ -192,7 +192,11 @@ bool UsbRly82::connectRelay(const QString &serialPort)
}
connect(m_serialPort, &QSerialPort::readyRead, this, &UsbRly82::onReadyRead);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
connect(m_serialPort, &QSerialPort::errorOccurred, this, &UsbRly82::onError, Qt::QueuedConnection);
#else
connect(m_serialPort, SIGNAL(error(QSerialPort::SerialPortError)), this, SLOT(onError(QSerialPort::SerialPortError)), Qt::QueuedConnection);
#endif
// Get serial number
UsbRly82Reply *reply = getSerialNumber();
@ -450,7 +454,7 @@ void UsbRly82::updateAnalogInputs()
return;
}
if (m_updateAnalogInputsReply->responseData().count() != 16) {
if (m_updateAnalogInputsReply->responseData().length() != 16) {
qCWarning(dcUsbRly82()) << "Reading analog inputs response returned invalid size" << m_updateAnalogInputsReply->responseData().count() << "(should be 16)";
m_updateAnalogInputsReply = nullptr;
return;