Skip to content

Commit 6f93dff

Browse files
author
Michael Foukarakis
committed
qdlt: Add some basic doc
* Add some basic descriptions for the headers in qdlt/ so that some relationships are clear in generated graphs. * Some basic docs in locations where code is parsing DLT message(s) or DLT messages are created based on internal state. This is not complete by far, most functions miss documentation and there are no statements of intent anywhere. Signed-off-by: Michael Foukarakis <[email protected]>
1 parent ff11946 commit 6f93dff

27 files changed

+248
-31
lines changed

qdlt/dlt_protocol.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@
164164
#define DLT_SCOD_HEX 0x00010000
165165
#define DLT_SCOD_BIN 0x00018000
166166
/*
167-
* Definitions of DLT services.
167+
* Definitions of DLT service IDs.
168+
*
169+
* Should correspond to AUTOSAR DLT protocol specification the DLT service
170+
* implementation conforms to.
168171
*/
169172
#define DLT_SERVICE_ID_SET_LOG_LEVEL 0x01 /**< Service ID: Set log level */
170173
#define DLT_SERVICE_ID_SET_TRACE_STATUS 0x02 /**< Service ID: Set trace status */

qdlt/dltmessagematcher.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111

1212
class QDltMsg;
1313

14+
/**
15+
* A class which can be used to set search parameters for matching on potential DLT messages.
16+
*
17+
* Offers functions to search different parts of a DLT message.
18+
* Offers the option to search either the header, the payload, or both.
19+
* Searches can be case-sensitive - default is case-insensitive.
20+
* The pattern to search a payload can be either a regular expression or plain text.
21+
*
22+
* Currently used by the UI search dialog.
23+
* @see SearchDialog
24+
*/
1425
class QDLT_EXPORT DltMessageMatcher
1526
{
1627
public:
@@ -46,9 +57,32 @@ class QDLT_EXPORT DltMessageMatcher
4657
m_messageIdFormat = msgIdFormat;
4758
}
4859

60+
/**
61+
*
62+
* @return `true` if `msg` matches all of:
63+
* - application ID set in `this`
64+
* - context ID set in `this`
65+
* - timestamp range set in `this`
66+
* - pattern matches either the `msg` header or payload
67+
* `false` otherwise.
68+
*
69+
* @see SearchDialog::findMessages
70+
*/
4971
bool match(const QDltMsg& message, const Pattern& pattern) const;
72+
5073
private:
74+
75+
/**
76+
* Match the application ID in `appId` against `this`
77+
*
78+
* @return `true` if `this` has no application ID set or the IDs match exactly, false otherwise
79+
*/
5180
bool matchAppId(const QString& appId) const;
81+
/**
82+
* Match the context ID in `ctxId` against `this`
83+
*
84+
* @return `true` if `this` has no application ID set or the IDs match exactly, false otherwise
85+
*/
5286
bool matchCtxId(const QString& ctxId) const;
5387
bool matchTimestampRange(unsigned int ts) const;
5488
private:

qdlt/fieldnames.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include <QObject>
77
#include <QString>
88

9+
/**
10+
* Class to obtain human-readable names for DLT message parts,
11+
* and UI element properties.
12+
*
13+
* @see MainWindow::initView
14+
*/
915
class QDLT_EXPORT FieldNames : public QObject
1016
{
1117
Q_OBJECT
@@ -42,9 +48,9 @@ class QDLT_EXPORT FieldNames : public QObject
4248
static bool getColumnShown(Fields cn,QDltSettingsManager *settings = NULL);
4349

4450
signals:
45-
51+
4652
public slots:
47-
53+
4854
};
4955

5056
#endif // FIELDNAMES_H

qdlt/qdltargument.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
//! One argument of a DLT message.
3232
/*!
3333
This class contains one argument of a DLT message.
34-
A QDltMessage contains several Arguments.
34+
A QDltMessage contains several QDltArgument, like a DLT message contains
35+
multiple arguments.
3536
*/
3637
class QDLT_EXPORT QDltArgument
3738
{

qdlt/qdltbase.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828

2929
constexpr const auto DLT_MAX_MESSAGE_LEN = 1024*64;
3030

31-
//! Base class for all DLT classes.
32-
/*!
33-
This class contains helper functions needed for all DLT operations and classes.
34-
*/
31+
/**
32+
* Base class for all DLT classes.
33+
*
34+
* This class contains helper functions needed for all DLT operations and classes.
35+
*/
3536
class QDLT_EXPORT QDlt
3637
{
3738
public:

qdlt/qdltconnection.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ class QDLT_EXPORT QDltDataView
8282
int m_position;
8383
};
8484

85+
/**
86+
* Base class for classes representing a connection for user commands & UI.
87+
*
88+
* Has concrete methods.
89+
*/
8590
class QDLT_EXPORT QDltConnection
8691
{
8792

@@ -102,6 +107,11 @@ class QDLT_EXPORT QDltConnection
102107
bool parseAscii(QDltMsg &msg);
103108

104109
void clear();
110+
/**
111+
* Add data to a connection, to be parsed.
112+
*
113+
* @see MainWindow::read
114+
*/
105115
void add(const QByteArray &bytes);
106116

107117
QByteArray data;

qdlt/qdltcontrol.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232

3333
#include "export_rules.h"
3434

35+
/**
36+
* This class contains various signals used in MainWindow, corresponding to user commands.
37+
* Execution of the commands is in UI code. Signals defined here are
38+
* connected to slots in e.g. MainWindow.
39+
* (rem. private slots can be invoked by arbitrary components)
40+
*
41+
* Also passed to plugins via MainWindow -> QDltPluginManager
42+
*
43+
* @see MainWindow::sendInjection
44+
* @see MainWindow::jumpToMsgSignal
45+
*/
3546
class QDLT_EXPORT QDltControl : public QObject
3647
{
3748
Q_OBJECT

qdlt/qdltctrlmsg.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212

1313
namespace qdlt::msg::payload {
1414

15+
/**
16+
* Most DLT service IDs referenced here can be found in the AUTOSAR DLT specification.
17+
*
18+
* Note the AUTOSAR spec does not reserve IDs.
19+
*/
20+
21+
/**
22+
* A struct associated with the `GetLogInfo` DLT service command,
23+
* to retrieve log levels for all registered contexts.
24+
*/
1525
struct GetLogInfo {
1626
struct App {
1727
struct Ctx {
@@ -30,15 +40,27 @@ struct GetLogInfo {
3040
std::vector<App> apps;
3141
};
3242

43+
/**
44+
* A struct associated with the `GetSoftwareVersion` DLT service command,
45+
* to retrieve a string denoting the system's software version.
46+
*/
3347
struct GetSoftwareVersion {
3448
};
3549

50+
/**
51+
* A struct associated with the `GetDefaultLogLevel` DLT service command,
52+
* to retrieve the currently set default log level.
53+
*/
3654
struct GetDefaultLogLevel
3755
{
3856
uint8_t logLevel;
3957
uint8_t status;
4058
};
4159

60+
/**
61+
* A struct associated with the `GetDefaultLogLevel` DLT service command,
62+
* to set a log level.
63+
*/
4264
struct SetLogLevel {
4365
uint8_t status;
4466
};

qdlt/qdltdefaultfilter.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
#include "qdltfilterlist.h"
3737

3838

39+
/**
40+
* "Default" filters loaded by MainWindow - initialises the indexer.
41+
* this ∋ `QDltFilterList` ∋ `QDltFilter`
42+
*
43+
* @see MainWindow
44+
*/
3945
class QDLT_EXPORT QDltDefaultFilter
4046
{
4147
public:

qdlt/qdltexporter.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
#define QDLT_DEFAULT_EXPORT_SIGNATURE "ITSOEACNYUMRP"
1616
#define QDLT_DEFAULT_EXPORT_DELIMITER ','
1717

18+
/**
19+
* Class used for UI export functions. Currently implemented as a thread that must be fed
20+
* messages to export.
21+
*
22+
* There is no interface toward a collection of DLT messages, but instead
23+
* functions are referencing single QDltMsg instances. This is suboptimal.
24+
*/
1825
class QDLT_EXPORT QDltExporter : public QThread
1926
{
2027
Q_OBJECT

0 commit comments

Comments
 (0)