38 lines
728 B
C++
38 lines
728 B
C++
#ifndef CANWATCHDOG_H
|
|
#define CANWATCHDOG_H
|
|
|
|
#include <QObject>
|
|
#include "PCANInterface.h"
|
|
#include <QTimer>
|
|
#include "CANMessage.h"
|
|
|
|
class CCANWatchdog: public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CCANWatchdog();
|
|
|
|
int Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle, unsigned int WDTPeriod,unsigned int CANMsgID);
|
|
int StartWDT();
|
|
int StopWDT();
|
|
bool IsInitialized(){return mWDTInitialized;}
|
|
|
|
CPCANInterface *mCANDriverIF;
|
|
unsigned int mWDTPeriod;
|
|
QTimer *mWatchdogTimer;
|
|
bool mWDTInitialized;
|
|
CCANMessage mWDTCANMsg;
|
|
|
|
private:
|
|
bool mIsCANInitialized;
|
|
TPCANHandle mCANDeviceHandle;
|
|
|
|
|
|
public slots:
|
|
void WatchdogTimeoutTimerExpired();
|
|
|
|
};
|
|
|
|
#endif // CANWATCHDOG_H
|