diff options
author | Andreas Wilhelm <aw@emlix.com> | 2016-08-26 12:24:03 +0200 |
---|---|---|
committer | Andreas Wilhelm <aw@emlix.com> | 2016-09-30 06:10:56 +0000 |
commit | 5652f215309f968895351e9ba6a67fe06236337d (patch) | |
tree | 448aab28b99823d85b018463ba5e4ab9440d78c3 /src | |
parent | eb1f2c41de5f99aab45c103c89e085bdd57159e7 (diff) |
canbusutil: Removed printDataUsage method and usages
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 <eb@emlix.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/canbusutil/canbusutil.cpp | 26 | ||||
-rw-r--r-- | src/tools/canbusutil/canbusutil.h | 1 |
2 files changed, 7 insertions, 20 deletions
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 - << " <id>#{payload} (CAN 2.0 data frames)," << endl - << " <id>#Rxx (CAN 2.0 RTR frames with xx bytes data length)," << endl - << " <id>##{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); |