OpcUaCanOpen
CANopen OPC-UA server
CanMessage.h
Go to the documentation of this file.
1 
8 #ifndef CANMESSAGE_H_
9 #define CANMESSAGE_H_
10 
11 #ifdef _WIN32
12 #include <Winsock2.h>
13 #else
14 #include <sys/time.h>
15 #endif
16 
20 typedef struct CanMsgStruct
21 {
22  //Identifier of the message
23  long c_id;
24  //Flags activated in the message
25  unsigned char c_ff;
26  //Length of the message
27  unsigned char c_dlc;
28  //Body of the message
29  unsigned char c_data[8];
30  //Timestamp of the message
31  struct timeval c_time;
32  //Is the message a remote Transmission request? Must be true for remote request frames and false for data frames
33  bool c_rtr;
34 #ifdef __cplusplus
35 public:
36  CanMsgStruct() :
37  c_id(0),
38  c_ff(0),
39  c_dlc(0),
40  c_rtr(false)
41  {
43  for (int i=0; i<8; i++)
44  c_data[i] = 0;
45  }
46 #endif //Be careful when using this strut from C
47 
48 } CanMessage;
49 
50 #endif /* CANMESSAGE_H_ */