summaryrefslogtreecommitdiffstats
path: root/src/plugins/canbus/tinycan/tinycanbackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/canbus/tinycan/tinycanbackend.cpp')
-rw-r--r--src/plugins/canbus/tinycan/tinycanbackend.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/canbus/tinycan/tinycanbackend.cpp b/src/plugins/canbus/tinycan/tinycanbackend.cpp
index 2d9ea2d..0985e48 100644
--- a/src/plugins/canbus/tinycan/tinycanbackend.cpp
+++ b/src/plugins/canbus/tinycan/tinycanbackend.cpp
@@ -45,11 +45,14 @@
#include <QtCore/qtimer.h>
#include <QtCore/qmutex.h>
#include <QtCore/qcoreevent.h>
+#include <QtCore/qloggingcategory.h>
#include <algorithm>
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(QT_CANBUS_PLUGINS_TINYCAN)
+
#ifndef LINK_LIBMHSTCAN
Q_GLOBAL_STATIC(QLibrary, mhstcanLibrary)
#endif
@@ -344,7 +347,7 @@ void TinyCanBackendPrivate::startWrite()
::memset(&message, 0, sizeof(message));
if (Q_UNLIKELY(payload.size() > int(sizeof(message.Data.Bytes)))) {
- qWarning("Can not write frame with payload size %d, ignored", payload.size());
+ qCWarning(QT_CANBUS_PLUGINS_TINYCAN, "Cannot write frame with payload size %d.", payload.size());
} else {
message.Id = frame.frameId();
message.Flags.Flag.Len = payload.size();
@@ -392,7 +395,7 @@ void TinyCanBackendPrivate::startRead()
q->setError(systemErrorString(ret), QCanBusDevice::CanBusError::ReadError);
} else {
if (status.CanStatus == CAN_STATUS_BUS_OFF) {
- qWarning("CAN bus is in off state, trying to reset the bus");
+ qCWarning(QT_CANBUS_PLUGINS_TINYCAN, "CAN bus is in off state, trying to reset the bus.");
if (::CanSetMode(channelIndex, OP_CAN_RESET, CAN_CMD_NONE) < 0)
q->setError(systemErrorString(ret), QCanBusDevice::CanBusError::ReadError);
}
@@ -508,8 +511,8 @@ bool TinyCanBackend::open()
const QVariant param = configurationParameter(key);
const bool success = d->setConfigurationParameter(key, param);
if (Q_UNLIKELY(!success)) {
- qWarning("Cannot apply parameter: %d with value: %ls",
- key, qUtf16Printable(param.toString()));
+ qCWarning(QT_CANBUS_PLUGINS_TINYCAN, "Cannot apply parameter: %d with value: %ls.",
+ key, qUtf16Printable(param.toString()));
}
}
}