Implémentation LanDeviceMonitor
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef LANDEVICEMONITOR_H
|
||||
#define LANDEVICEMONITOR_H
|
||||
|
||||
#include <QObject>
|
||||
#include "defines.h"
|
||||
#include "LANDevicePresenceConfig.h"
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
|
||||
#define LAN_DEVICE_MONITOR_PING_TIMEOUT 3000
|
||||
#define LAN_DEVICE_MONITOR_PRESENCE_CHECK_TIMEOUT 5000
|
||||
|
||||
|
||||
class CLANDeviceMonitor : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
CLANDeviceMonitor(QString IPAddress, unsigned int CANBit, bool Active, QString Description = "");
|
||||
~CLANDeviceMonitor();
|
||||
|
||||
int PingDevice();
|
||||
quint64 GetDeviceCANStatusMask();
|
||||
|
||||
private:
|
||||
QTimer *mDevMonitorTimer;
|
||||
QString mDeviceIPAddress;
|
||||
unsigned int mCANStatusBit;
|
||||
bool mIsDetectionActive;
|
||||
QString mDeviceDescription;
|
||||
bool mIsDeviceOnline;
|
||||
QProcess *mPingProcess;
|
||||
bool mIsPingInProgress;
|
||||
|
||||
|
||||
public slots:
|
||||
void MonitorTimeExpired();
|
||||
void PingProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
|
||||
};
|
||||
|
||||
#endif // LANDEVICEMONITOR_H
|
||||
Reference in New Issue
Block a user