-
Notifications
You must be signed in to change notification settings - Fork 1
/
can_parser.h
38 lines (27 loc) · 943 Bytes
/
can_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef CAN_PARSER_H
#define CAN_PARSER_H
#include <QObject>
#include <QHash>
#include "Structures.h"
using DecodeTable = QHash<unsigned int, CAN_DecodeParameters>;
using DecodeTableIter = QHashIterator<unsigned int, CAN_DecodeParameters>;
class CAN_Parser : public QObject
{
Q_OBJECT
public:
CAN_Parser(QObject *parent = nullptr);
DecodeTableIter getDecodeTableIter() { return DecodeTableIter(m_decodeTable); }
signals:
void DataSuccessfullyDecoded(TableEntry tableEntry);
void CAN_DecodeParametersChanged(unsigned int ID);
public slots:
void AddEntry(unsigned int ID, CAN_DecodeParameters decodeParameters);
void RemoveEntry(unsigned int ID);
void DecodeData(RawData rawPacket);
private:
DecodeTable m_decodeTable;
TableEntry DecodeData_Existing(RawData rawData);
TableEntry DecodeData_NonExistent(RawData rawData);
uint64_t DecodeValue(RawData& rawData);
};
#endif // CAN_PARSER_H