From 5652f215309f968895351e9ba6a67fe06236337d Mon Sep 17 00:00:00 2001 From: Andreas Wilhelm Date: Fri, 26 Aug 2016 12:24:03 +0200 Subject: canbusutil: Removed printDataUsage method and usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This method just prints out part of the usage instructions and does not create added value for the application. Change-Id: I4615f5708ecdbbf05951d7a5d00c5c77a6239e54 Reviewed-by: Rolf Eike Beer Reviewed-by: André Hartmann Reviewed-by: Alex Blasche --- src/tools/canbusutil/canbusutil.cpp | 26 +++++++------------------- src/tools/canbusutil/canbusutil.h | 1 - 2 files changed, 7 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/tools/canbusutil/canbusutil.cpp b/src/tools/canbusutil/canbusutil.cpp index 5f74411..d310781 100644 --- a/src/tools/canbusutil/canbusutil.cpp +++ b/src/tools/canbusutil/canbusutil.cpp @@ -82,21 +82,11 @@ void CanBusUtil::printPlugins() m_output << plugins.at(i) << endl; } -void CanBusUtil::printDataUsage() -{ - m_output << "Invalid [data] field, use format: " << endl - << " #{payload} (CAN 2.0 data frames)," << endl - << " #Rxx (CAN 2.0 RTR frames with xx bytes data length)," << endl - << " ##{payload} (CAN FD data frames)," << endl - << "{payload} has 0..8 (0..64 CAN FD) ASCII hex-value pairs" << endl; -} - bool CanBusUtil::parseDataField(qint32 &id, QString &payload) { int hashMarkPos = m_data.indexOf('#'); if (hashMarkPos < 0) { - m_output << "No hash mark found!" << endl; - printDataUsage(); + m_output << "Data field invalid: No hash mark found!" << endl; return false; } @@ -133,8 +123,7 @@ bool CanBusUtil::parsePayloadField(QString payload, bool &rtrFrame, } if (!validPayloadLength) { - m_output << "RTR data frame length not specified/valid." << endl; - printDataUsage(); + m_output << "Data field invalid: RTR data frame length not specified/valid." << endl; } return validPayloadLength; @@ -148,15 +137,15 @@ bool CanBusUtil::parsePayloadField(QString payload, bool &rtrFrame, bool numberConverOk = true; quint8 high = QString(payload[i]).toInt(&numberConverOk, 16); if (!numberConverOk) { - m_output << "Could not convert '" << QString(payload[i]) << "' to a number"<< endl; - printDataUsage(); + m_output << "Data field invalid: Could not convert '" + << QString(payload[i]) << "' to a number"<< endl; return false; } quint8 low = QString(payload[i+1]).toInt(&numberConverOk, 16); if (!numberConverOk) { - m_output << "Could not convert '" << QString(payload[i+1]) << "' to a number" << endl; - printDataUsage(); + m_output << "Data field invalid: Could not convert '" + << QString(payload[i+1]) << "' to a number" << endl; return false; } @@ -172,8 +161,7 @@ bool CanBusUtil::parsePayloadField(QString payload, bool &rtrFrame, bytes = bytes.left(size); } } else { - m_output << "Payload size not multiple of two!" << endl; - printDataUsage(); + m_output << "Data field invalid: Payload size not multiple of two!" << endl; return false; } return true; diff --git a/src/tools/canbusutil/canbusutil.h b/src/tools/canbusutil/canbusutil.h index ce9f29c..8737c30 100644 --- a/src/tools/canbusutil/canbusutil.h +++ b/src/tools/canbusutil/canbusutil.h @@ -52,7 +52,6 @@ public: bool start(const QString &pluginName, const QString &deviceName, const QString &data = QString()); void printPlugins(); - void printDataUsage(); private: bool parseDataField(qint32 &id, QString &payload); -- cgit v1.2.3