-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoderbase.h
35 lines (27 loc) · 889 Bytes
/
decoderbase.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
#ifndef DECODERBASE_H
#define DECODERBASE_H
#include <QObject>
#include "configuration.h"
class DecoderBase : public QObject
{
Q_OBJECT
public:
explicit DecoderBase(QObject *parent = 0, Configuration* config = 0);
const QByteArray& getPacketBytes(){return packetBytes;};
const QList<QByteArray>& getPacketParts(){return packetParts;};
const QList<QVariant>& getPacketValues(){return packetValues;};
protected:
Configuration* config;
int packetMaxLen;
bool packetStarted;
QByteArray packetBytes;
QList<QByteArray> packetParts;
QList<QVariant> packetValues;
signals:
//void newPacket(const DecoderBase*);
public slots:
virtual void newData(const QByteArray&) = 0;
virtual void packetSeparator() = 0;
};
DecoderBase* createDecoder(QObject *parent, Configuration* config);
#endif // DECODERBASE_H