-
Notifications
You must be signed in to change notification settings - Fork 2
/
canbusnode.h
46 lines (33 loc) · 1.02 KB
/
canbusnode.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
39
40
41
42
43
44
45
46
#ifndef CANBUSNODE_H
#define CANBUSNODE_H
#include <QObject>
class QCanBusDevice;
class QCanBusFrame;
class QTimer;
class CanBusNode : public QObject
{
Q_OBJECT
protected:
CanBusNode(QCanBusDevice* canBusDevice, quint32 frameIdSending, quint32 frameIdReceiving, QObject* parent = nullptr);
public:
~CanBusNode() = default;
Q_SIGNALS:
void changed();
void timeout();
protected:
void sendFrame(quint32 frameId, const QByteArray& data);
void sendFrame(const QByteArray& data);
virtual void receiveFrame(quint32 frameId, const QByteArray& data);
virtual void receiveFrame(const QByteArray& data);
void receiveFrame(const QCanBusFrame& frame);
virtual QVector<quint32> receivingFrameIds() const;
void setTimeoutInterval(int interval);
private:
friend class CanBusNodeDetector;
friend class ChargingRelayController;
QCanBusDevice* m_canBusDevice = nullptr;
quint32 m_frameIdSending = 0x0;
quint32 m_frameIdReceiving = 0x0;
QTimer* m_timeOutTimer = nullptr;
};
#endif