summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/passthrucan/passthrucanio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/canbus/passthrucan/passthrucanio.cpp')
-rw-r--r--src/plugins/canbus/passthrucan/passthrucanio.cpp49
1 files changed, 8 insertions, 41 deletions
diff --git a/src/plugins/canbus/passthrucan/passthrucanio.cpp b/src/plugins/canbus/passthrucan/passthrucanio.cpp
index dc3d2c7..4482aa1 100644
--- a/src/plugins/canbus/passthrucan/passthrucanio.cpp
+++ b/src/plugins/canbus/passthrucan/passthrucanio.cpp
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Ford Motor Company.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtSerialBus module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Ford Motor Company.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "passthrucanio.h"
@@ -106,7 +73,7 @@ void PassThruCanIO::close()
emit closeFinished();
}
-void PassThruCanIO::applyConfig(int key, const QVariant &value)
+void PassThruCanIO::applyConfig(QCanBusDevice::ConfigurationKey key, const QVariant &value)
{
if (Q_UNLIKELY(!m_passThru)) {
qCCritical(QT_CANBUS_PLUGINS_PASSTHRU, "Pass-thru interface not open");
@@ -185,8 +152,8 @@ bool PassThruCanIO::setMessageFilters(const QList<QCanBusDevice::Filter> &filter
else
mask.setRxStatus({});
- qToBigEndian<quint32>(filter.frameId & filter.frameIdMask, pattern.data());
- qToBigEndian<quint32>(filter.frameIdMask, mask.data());
+ qToBigEndian<QCanBusFrame::FrameId>(filter.frameId & filter.frameIdMask, pattern.data());
+ qToBigEndian<QCanBusFrame::FrameId>(filter.frameIdMask, mask.data());
if (m_passThru->startMsgFilter(m_channelId, J2534::PassThru::PassFilter,
mask, pattern) != J2534::PassThru::NoError)
@@ -236,7 +203,7 @@ bool PassThruCanIO::writeMessages()
else
msg.setTxFlags({});
- qToBigEndian<quint32>(frame.frameId(), msg.data());
+ qToBigEndian<QCanBusFrame::FrameId>(frame.frameId(), msg.data());
std::memcpy(msg.data() + 4, payload.data(), payloadSize);
}
}
@@ -287,7 +254,7 @@ void PassThruCanIO::readMessages(bool writePending)
return;
}
const int numFrames = qMin<ulong>(m_ioBuffer.size(), numMsgs);
- QVector<QCanBusFrame> frames;
+ QList<QCanBusFrame> frames;
frames.reserve(numFrames);
for (int i = 0; i < numFrames; ++i) {
@@ -299,7 +266,7 @@ void PassThruCanIO::readMessages(bool writePending)
"Message with invalid size %lu received", msg.size());
continue;
}
- const quint32 msgId = qFromBigEndian<quint32>(msg.data());
+ const QCanBusFrame::FrameId msgId = qFromBigEndian<QCanBusFrame::FrameId>(msg.data());
const QByteArray payload (msg.data() + 4, msg.size() - 4);
QCanBusFrame frame (msgId, payload);