#ifndef CANDEVICE_H #define CANDEVICE_H #include "defines.h" #include #include "CANAnalyzer.h" #include "CANMessage.h" #include "PCANInterface.h" #include "CANDatabase.h" #include #include "PCANBasic.h" #include "CANDeviceConfig.h" #include "CANDataLogger.h" #include "MQTTMessage.h" #include "CANWatchdog.h" class CMQTTClientWrapper; class COtarcikCan; class CDeviceDetectionConfig; class CCANDevice : public QObject { Q_OBJECT public: explicit CCANDevice(QObject *parent = 0); CCANDevice(CCANDeviceConfig &SysConfig, QString DeviceTopicPrefix=""); ~CCANDevice(); int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod); int Init(); int StartWatchdog(CDeviceDetectionConfig *DeviceMonitorConfig); QList *GetCANMessagesList(){return &mMessageList;} public: CCANDeviceConfig mDeviceConfigInfo; COtarcikCan *mProgramPtr; bool mMessagesListLoaded; CCANAnalyzer mCANAnalyzer; //The module that handles the USB puck and decodes the data CCANDatabase mCANDatabase; //The device's database loaded from dbc file CCANDataLogger mCANDataLogger; QString mDeviceTopicPrefix; CCANWatchdog mCANWatchdog; QList mMessageList; QList *GetMQTTMessagesList(); // CCANDevice &operator=(const CCANDevice *source); int NewMessageParsed(int BufferSize = 0); TPCANHandle mDeviceHandle; private: bool mConfigSet; CPCANInterface *mCANDriverIF; bool mIsCANInitialized; signals: public slots: }; QDataStream &operator<<(QDataStream &out, const CCANDevice &source); QDataStream &operator>>(QDataStream &in, CCANDevice &dest); #endif // CANDEVICE_H