forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
can_structs.h
57 lines (48 loc) · 1.07 KB
/
can_structs.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
47
48
49
50
51
52
53
54
55
56
#ifndef CAN_STRUCTS_H
#define CAN_STRUCTS_H
#include <QObject>
#include <QVector>
#include <stdint.h>
struct CANFrame
{
public:
uint32_t ID;
int bus;
bool extended;
bool remote;
bool isReceived; //did we receive this or send it?
int len;
unsigned char data[8];
uint64_t timestamp;
uint64_t timedelta;
uint32_t frameCount; //used in overwrite mode
friend bool operator<(const CANFrame& l, const CANFrame& r)
{
return l.timestamp < r.timestamp;
}
CANFrame()
{
ID = 0;
bus = 0;
extended = false;
remote = false;
isReceived = true;
len = 0;
timestamp = 0;
timedelta = 0;
frameCount = 1;
}
};
class CANFltObserver
{
public:
quint32 id;
quint32 mask;
QObject * observer; //used to target the specific object that setup this filter
bool operator ==(const CANFltObserver &b) const
{
if ( (id == b.id) && (mask == b.mask) && (observer == b.observer) ) return true;
return false;
}
};
#endif // CAN_STRUCTS_H