YULTek/Otarcik_CAN/Sources/CANMessage.h
2023-01-15 12:38:14 -05:00

37 lines
1.2 KiB
C++

#ifndef CANMESSAGE_H
#define CANMESSAGE_H
#include <QByteArray>
#include <QDataStream>
#include "PCANBasic.h"
class CCANMessage
{
public:
CCANMessage();
CCANMessage(const CCANMessage &Src);
CCANMessage(const quint32 Channel,const TPCANMsg CANMsg,const TPCANTimestamp CANTimeStamp);
quint32 mCANChannel; //Channel from which the message has been read
quint64 mCANMsgID; // 11/29-bit message identifier
quint8 mCANMsgType; // Type of the message, using the PCAN interface driver encoding defined in PCANbasic.h
quint8 mCANMsgLength; // Data Length Code of the message (0..8)
QByteArray mCANMsgData; // Data of the message, max size = 8 bytes
//Timestamp
quint64 mCANMsgMillisecs; // Base-value: milliseconds: 0.. 2^32-1
quint32 mCANMsgMillisecsOverflow; // Roll-arounds of millis
quint32 mCANMsgMicrosecs; // Microseconds: 0..999
CCANMessage &operator=(const CCANMessage *source);
int SetDataFromDriver(quint32 Channel,TPCANMsg CANMsg,TPCANTimestamp CANTimeStamp);
};
QDataStream &operator<<(QDataStream &out, const CCANMessage &source);
QDataStream &operator>>(QDataStream &in, CCANMessage &dest);
#endif // CANMESSAGE_H