Watchdog avec date/time et reporting fonctionnel.
This commit is contained in:
@@ -93,17 +93,6 @@ int CCANDevice::Init()
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
if(mDeviceConfigInfo.mDeviceWatchdogActivated == true)
|
||||
{
|
||||
if(mCANWatchdog.Init(mCANDriverIF,mDeviceHandle,mDeviceConfigInfo.mWatchdogPeriod,mDeviceConfigInfo.mWatchdogCANMsgID) != RET_OK)
|
||||
{
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage("Impossible d'initialiser un watchdog CAN","CCANDevice",true,1,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
||||
}
|
||||
mCANWatchdog.StartWDT();
|
||||
|
||||
QString Log = QString("Watchdog CAN initialisé pour le module sur le channel %1").arg(mDeviceConfigInfo.mCANDeviceID);
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(Log,"CCANDevice",true,1,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_SUCCESS_STATUS);
|
||||
}
|
||||
|
||||
mIsCANInitialized = true;
|
||||
|
||||
@@ -120,6 +109,25 @@ int CCANDevice::Init()
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CCANDevice::StartWatchdog(CDeviceDetectionConfig *DeviceMonitorConfig)
|
||||
{
|
||||
if(mDeviceConfigInfo.mDeviceWatchdogActivated == true)
|
||||
{
|
||||
if(mCANWatchdog.Init(mCANDriverIF,mDeviceHandle,mDeviceConfigInfo.mWatchdogPeriod,DeviceMonitorConfig) != RET_OK)
|
||||
{
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage("Impossible d'initialiser un watchdog CAN","CCANDevice",true,1,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_ERROR_STATUS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
mCANWatchdog.StartWDT();
|
||||
|
||||
QString Log = QString("Watchdog CAN initialisé pour le module sur le channel %1").arg(mDeviceConfigInfo.mCANDeviceID);
|
||||
CGeneralMessagesLogDispatcher::instance()->AddLogMessage(Log,"CCANDevice",true,1,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_SUCCESS_STATUS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CCANDevice::Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod)
|
||||
{
|
||||
mDeviceConfigInfo.mCANDeviceID = CANDeviceID;
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
#include "CANDataLogger.h"
|
||||
#include "MQTTMessage.h"
|
||||
#include "CANWatchdog.h"
|
||||
//#include "MQTTClientWrapper.h"
|
||||
|
||||
|
||||
class CMQTTClientWrapper;
|
||||
class COtarcikCan;
|
||||
class CDeviceDetectionConfig;
|
||||
|
||||
class CCANDevice : public QObject
|
||||
{
|
||||
@@ -28,6 +29,7 @@ public:
|
||||
|
||||
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
|
||||
int Init();
|
||||
int StartWatchdog(CDeviceDetectionConfig *DeviceMonitorConfig);
|
||||
QList<CCANMessage*> *GetCANMessagesList(){return &mMessageList;}
|
||||
|
||||
public:
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
unsigned int mWatchdogPeriod;
|
||||
|
||||
CCANDeviceConfig &operator=(const CCANDeviceConfig &source);
|
||||
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const CCANDeviceConfig &source);
|
||||
|
||||
@@ -4,21 +4,29 @@
|
||||
#include <QDate>
|
||||
#include <QTime>
|
||||
#include <QFloat16>
|
||||
#include "MQTTClientWrapper.h"
|
||||
#include "InternetMonitor.h"
|
||||
#include "LANDevicesPresenceMonitor.h"
|
||||
#include "DeviceDetectionConfig.h"
|
||||
|
||||
CCANWatchdog::CCANWatchdog()
|
||||
{
|
||||
mCANDriverIF = new CPCANInterface;
|
||||
//mCANDriverIF = new CPCANInterface;
|
||||
mIsCANInitialized = false;
|
||||
|
||||
mWatchdogTimer = new QTimer;
|
||||
mWatchdogTimer->setSingleShot(false);
|
||||
mCANDriverIF = 0;
|
||||
mWDTInitialized = false;
|
||||
// mMQTTPresenceMonitor = 0;
|
||||
// mLANDevicesMonitor = 0;
|
||||
// mInternetMonitor = 0;
|
||||
mDevicesMonitorConfig = 0;
|
||||
|
||||
connect(mWatchdogTimer,&QTimer::timeout,this,&CCANWatchdog::WatchdogTimeoutTimerExpired);
|
||||
}
|
||||
|
||||
int CCANWatchdog::Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle, unsigned int WDTPeriod, unsigned int CANMsgID)
|
||||
int CCANWatchdog::Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle, unsigned int WDTPeriod, CDeviceDetectionConfig *DevicesMonitorConfig)
|
||||
{
|
||||
if(WDTPeriod < 200)
|
||||
{
|
||||
@@ -27,6 +35,7 @@ int CCANWatchdog::Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle,
|
||||
return RET_GENERAL_ERROR;
|
||||
}
|
||||
|
||||
mDevicesMonitorConfig = DevicesMonitorConfig;
|
||||
mCANDeviceHandle = CANDeviceHandle;
|
||||
mWDTPeriod = WDTPeriod;
|
||||
mCANDriverIF = CANDriverIF;
|
||||
@@ -35,7 +44,7 @@ int CCANWatchdog::Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle,
|
||||
mWatchdogTimer->setInterval(mWDTPeriod);
|
||||
mWatchdogTimer->setSingleShot(false);
|
||||
|
||||
mWDTCANMsg.mCANMsgID = CANMsgID;
|
||||
mWDTCANMsg.mCANMsgID = DevicesMonitorConfig->mReportingCANMsgID;
|
||||
mWDTCANMsg.mCANMsgLength = 8;
|
||||
mWDTCANMsg.mCANMsgData.clear();
|
||||
mWDTCANMsg.mCANMsgData.append(8,(char)0x00);
|
||||
@@ -65,7 +74,30 @@ void CCANWatchdog::WatchdogTimeoutTimerExpired()
|
||||
// BigData |= 0x100000000;
|
||||
|
||||
BigData = GetCANDateTimeBuffer();
|
||||
if(mDevicesMonitorConfig != 0)
|
||||
{
|
||||
if(mDevicesMonitorConfig->mInternetMonitor != 0)
|
||||
{
|
||||
BigData |= mDevicesMonitorConfig->mInternetMonitor->GetCANInternetStatusMask();
|
||||
}
|
||||
}
|
||||
if(mDevicesMonitorConfig != 0)
|
||||
{
|
||||
if(mDevicesMonitorConfig->mMQTTPresenceMonitor != 0)
|
||||
{
|
||||
BigData |= mDevicesMonitorConfig->mMQTTPresenceMonitor->GetMQTTServerPresenceCANMask();
|
||||
}
|
||||
}
|
||||
if(mDevicesMonitorConfig != 0)
|
||||
{
|
||||
if(mDevicesMonitorConfig->mLANDevicesMonitor != 0)
|
||||
{
|
||||
|
||||
BigData |= mDevicesMonitorConfig->mLANDevicesMonitor->GetDevicesPresenceCANMask();
|
||||
}
|
||||
}
|
||||
|
||||
mWDTCANMsg.mCANMsgID = mDevicesMonitorConfig->mReportingCANMsgID;
|
||||
mWDTCANMsg.SetRawData(BigData,CCANSignal::CAN_SIGNAL_ENCODING_INTEL);
|
||||
mCANDriverIF->SendCANMessage(mCANDeviceHandle,mWDTCANMsg);
|
||||
|
||||
@@ -93,6 +125,11 @@ quint64 CCANWatchdog::GetCANDateTimeBuffer()
|
||||
return OutputBuffer;
|
||||
}
|
||||
|
||||
int CCANWatchdog::SetDevicesDetectionConfig(CDeviceDetectionConfig *DeviceMonitoringConfig)
|
||||
{
|
||||
mDevicesMonitorConfig = DeviceMonitoringConfig;
|
||||
}
|
||||
|
||||
int CCANWatchdog::StartWDT()
|
||||
{
|
||||
if(mWDTInitialized == false)
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
//Parker controller. This controller uses this update as a watchdog signal, but the register contains
|
||||
//some useful data for the Parker controller as well.
|
||||
|
||||
class CMQTTClientWrapper;
|
||||
class CLANDevicesPresenceMonitor;
|
||||
class CInternetMonitor;
|
||||
class CDeviceDetectionConfig;
|
||||
|
||||
class CCANWatchdog: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -18,11 +23,12 @@ class CCANWatchdog: public QObject
|
||||
public:
|
||||
CCANWatchdog();
|
||||
|
||||
int Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle, unsigned int WDTPeriod,unsigned int CANMsgID);
|
||||
int StartWDT();
|
||||
int StopWDT();
|
||||
bool IsInitialized(){return mWDTInitialized;}
|
||||
quint64 GetCANDateTimeBuffer();
|
||||
int Init(CPCANInterface *CANDriverIF, TPCANHandle CANDeviceHandle, unsigned int WDTPeriod, CDeviceDetectionConfig *DevicesMonitorConfig);
|
||||
int StartWDT();
|
||||
int StopWDT();
|
||||
bool IsInitialized(){return mWDTInitialized;}
|
||||
quint64 GetCANDateTimeBuffer();
|
||||
int SetDevicesDetectionConfig(CDeviceDetectionConfig *DeviceMonitoringConfig);
|
||||
|
||||
CPCANInterface *mCANDriverIF;
|
||||
unsigned int mWDTPeriod;
|
||||
@@ -30,10 +36,17 @@ public:
|
||||
bool mWDTInitialized;
|
||||
CCANMessage mWDTCANMsg;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
bool mIsCANInitialized;
|
||||
TPCANHandle mCANDeviceHandle;
|
||||
|
||||
// CMQTTClientWrapper *mMQTTPresenceMonitor;
|
||||
// CLANDevicesPresenceMonitor *mLANDevicesMonitor;
|
||||
// CInternetMonitor *mInternetMonitor;
|
||||
CDeviceDetectionConfig *mDevicesMonitorConfig;
|
||||
|
||||
|
||||
public slots:
|
||||
void WatchdogTimeoutTimerExpired();
|
||||
|
||||
@@ -25,6 +25,7 @@ CMQTTClientWrapper::CMQTTClientWrapper()
|
||||
|
||||
mProgramPtr = 0;
|
||||
mCPUInterface = 0;
|
||||
mMQTTPresenceCANBit = 0;
|
||||
mMessagesQueueMode = MQTT_DROP_MSG_MODE;
|
||||
mDisconnectionIsVoluntary = false;
|
||||
mIsClientConnecting = false;
|
||||
@@ -51,6 +52,12 @@ int CMQTTClientWrapper::SetMQTTParams(CCloudParams *Params)
|
||||
int CMQTTClientWrapper::SetCPUInterface(CComputerBoardInterface *CPUIF)
|
||||
{
|
||||
mCPUInterface = CPUIF;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CMQTTClientWrapper::SetMQTTServerPresenceCANBit(quint64 CANBit)
|
||||
{
|
||||
mMQTTPresenceCANBit = CANBit;
|
||||
}
|
||||
|
||||
int CMQTTClientWrapper::StartMQTTClient()
|
||||
@@ -120,6 +127,19 @@ int CMQTTClientWrapper::NewMQTTMessages(QList<CMQTTMessage> MessagesList)
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
quint64 CMQTTClientWrapper::GetMQTTServerPresenceCANMask()
|
||||
{
|
||||
if(mMQTTClient.state() == QMqttClient::Connected)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
quint64 Mask = 1;
|
||||
Mask <<= mMQTTPresenceCANBit;
|
||||
|
||||
return Mask;
|
||||
}
|
||||
|
||||
void CMQTTClientWrapper::StateChanged()
|
||||
{
|
||||
switch(mMQTTClient.state())
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
~CMQTTClientWrapper();
|
||||
int SetMQTTParams(CCloudParams *Params);
|
||||
int SetCPUInterface(CComputerBoardInterface *CPUIF);
|
||||
int SetMQTTServerPresenceCANBit(quint64 CANBit);
|
||||
int ConnectToBroker();
|
||||
int NewMQTTMessages(QList<CMQTTMessage> MessagesList);
|
||||
int DisconnectFromBroker();
|
||||
@@ -37,6 +38,7 @@ public:
|
||||
int SetCANDevicesList(QList<CCANDevice*> *List);
|
||||
int StartMQTTClient();
|
||||
int StopMQTTClient();
|
||||
quint64 GetMQTTServerPresenceCANMask();
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +58,7 @@ private:
|
||||
CComputerBoardInterface *mCPUInterface;
|
||||
|
||||
int SendNextQueueMessage();
|
||||
quint64 mMQTTPresenceCANBit;
|
||||
|
||||
|
||||
int UpdateGUIBufferingStatus();
|
||||
|
||||
@@ -10,6 +10,10 @@ CDeviceDetectionConfig::CDeviceDetectionConfig()
|
||||
mLANDeviceDetectConfigList.append(CLANDevicePresenceConfig());
|
||||
}
|
||||
mReportingCANMsgID = 300;
|
||||
|
||||
mMQTTPresenceMonitor = 0;
|
||||
mLANDevicesMonitor = 0;
|
||||
mInternetMonitor = 0;
|
||||
}
|
||||
|
||||
QList<CLANDevicePresenceConfig> *CDeviceDetectionConfig::GetLANDevicesConfigList()
|
||||
@@ -35,6 +39,16 @@ QDataStream &operator>>(QDataStream &in, CDeviceDetectionConfig &dest)
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
int CDeviceDetectionConfig::SetCANPresenceMonitors(CMQTTClientWrapper *MQTTPresenceMonitor, CLANDevicesPresenceMonitor *LANDevicesMonitor, CInternetMonitor *InternetMonitor)
|
||||
{
|
||||
mMQTTPresenceMonitor = MQTTPresenceMonitor;
|
||||
mLANDevicesMonitor = LANDevicesMonitor;
|
||||
mInternetMonitor = InternetMonitor;
|
||||
return RET_OK;
|
||||
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const CDeviceDetectionConfig &source)
|
||||
{
|
||||
out << source.mInternetDetectionCANStatusBit
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
#include "LANDevicePresenceConfig.h"
|
||||
#include <QDataStream>
|
||||
|
||||
|
||||
class CMQTTClientWrapper;
|
||||
class CLANDevicesPresenceMonitor;
|
||||
class CInternetMonitor;
|
||||
|
||||
class CDeviceDetectionConfig
|
||||
{
|
||||
public:
|
||||
@@ -16,8 +21,13 @@ public:
|
||||
quint64 mMQTTDetectionCANStatusBit;
|
||||
QList<CLANDevicePresenceConfig> mLANDeviceDetectConfigList;
|
||||
|
||||
CMQTTClientWrapper *mMQTTPresenceMonitor;
|
||||
CLANDevicesPresenceMonitor *mLANDevicesMonitor;
|
||||
CInternetMonitor *mInternetMonitor;
|
||||
|
||||
CDeviceDetectionConfig &operator=(const CDeviceDetectionConfig &source);
|
||||
int SetCANPresenceMonitors(CMQTTClientWrapper* MQTTPresenceMonitor, CLANDevicesPresenceMonitor *LANDevicesMonitor, CInternetMonitor *InternetMonitor);
|
||||
|
||||
CDeviceDetectionConfig &operator=(const CDeviceDetectionConfig &source);
|
||||
};
|
||||
|
||||
QDataStream &operator<<(QDataStream &out, const CDeviceDetectionConfig &source);
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<x>270</x>
|
||||
<y>100</y>
|
||||
<width>321</width>
|
||||
<height>461</height>
|
||||
<height>431</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
@@ -119,7 +119,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>420</y>
|
||||
<y>390</y>
|
||||
<width>80</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
@@ -216,7 +216,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>420</y>
|
||||
<y>390</y>
|
||||
<width>80</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
@@ -309,67 +309,6 @@
|
||||
<string>Période rafraîchissement (ms):</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mWatchdogMsgIDLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>380</y>
|
||||
<width>111</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CAN Msg ID (HEX):</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mWatchdogMsgIDPrefixLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>380</y>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0x</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="mWatchdogMsgIDSpinBx">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>380</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2048</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="displayIntegerBase">
|
||||
<number>16</number>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="mDatabaseGroupBox">
|
||||
<property name="geometry">
|
||||
@@ -551,6 +490,67 @@
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mWatchdogMsgIDPrefixLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>610</y>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0x</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="mWatchdogMsgIDSpinBx">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>610</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2048</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="displayIntegerBase">
|
||||
<number>16</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mWatchdogMsgIDLbl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>610</y>
|
||||
<width>111</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CAN Msg ID (HEX):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -45,6 +45,13 @@ int CInternetMonitor::Start(quint64 CANReportingBit)
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CInternetMonitor::UpdateCANReportingBit(quint64 CANBit)
|
||||
{
|
||||
mCANReportingMask = 1;
|
||||
mCANReportingMask <<= CANBit;
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int CInternetMonitor::CheckInternet()
|
||||
{
|
||||
if(mConnectionTimer->isActive()) //are we waiting for a reply??
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
explicit CInternetMonitor(QObject *parent = 0);
|
||||
~CInternetMonitor();
|
||||
int Start(quint64 CANReportingBit);
|
||||
int UpdateCANReportingBit(quint64 CANBit);
|
||||
bool IsInternetActive();
|
||||
quint64 GetCANInternetStatusMask();
|
||||
|
||||
|
||||
@@ -44,16 +44,18 @@ int CLANDeviceMonitor::PingDevice()
|
||||
|
||||
CLANDeviceMonitor::~CLANDeviceMonitor()
|
||||
{
|
||||
if(mDevMonitorTimer != 0)
|
||||
{
|
||||
mDevMonitorTimer->stop();
|
||||
delete mDevMonitorTimer;
|
||||
}
|
||||
if(mPingProcess != 0)
|
||||
{
|
||||
mPingProcess->terminate();
|
||||
delete mPingProcess;
|
||||
}
|
||||
if(mDevMonitorTimer != 0)
|
||||
{
|
||||
mDevMonitorTimer->stop();
|
||||
mDevMonitorTimer = 0;
|
||||
delete mDevMonitorTimer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +96,8 @@ void CLANDeviceMonitor::PingProcessFinished(int exitCode, QProcess::ExitStatus e
|
||||
}
|
||||
|
||||
GetDeviceCANStatusMask();
|
||||
mDevMonitorTimer->start(LAN_DEVICE_MONITOR_PRESENCE_CHECK_TIMEOUT);
|
||||
if(mDevMonitorTimer != 0)
|
||||
mDevMonitorTimer->start(LAN_DEVICE_MONITOR_PRESENCE_CHECK_TIMEOUT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ int COtarcikCan::Start()
|
||||
mCANBusMQTTClient.SetMQTTParams(&mCloudLoggingParams);
|
||||
mCANBusMQTTClient.SetCANDevicesList(&mCANDevicesList);
|
||||
mCANBusMQTTClient.SetCPUInterface(&mCPUInterface);
|
||||
mCANBusMQTTClient.SetMQTTServerPresenceCANBit(mSystemConfig.GetDeviceDetectionConfig()->mMQTTDetectionCANStatusBit);
|
||||
|
||||
mGeneralSystemParams = *mSystemConfig.GetGeneralSystemSettings();
|
||||
mMainWindow.mDataLoggingSettingsPage->SetGeneralSettingsParams(&mGeneralSystemParams);
|
||||
@@ -95,9 +96,14 @@ int COtarcikCan::Start()
|
||||
mDeviceDetectionConfigParams = *mSystemConfig.GetDeviceDetectionConfig();
|
||||
mMainWindow.mDataLoggingSettingsPage->SetDeviceConfigSettings(mSystemConfig.GetDeviceDetectionConfig());
|
||||
|
||||
|
||||
mInternetMonitor.Start(mSystemConfig.GetDeviceDetectionConfig()->mInternetDetectionCANStatusBit);
|
||||
mLANDevicesPresenceMonitor.Start(mSystemConfig.GetDeviceDetectionConfig()->GetLANDevicesConfigList());
|
||||
|
||||
mSystemConfig.mDeviceDetectionParams.SetCANPresenceMonitors(&mCANBusMQTTClient,&mLANDevicesPresenceMonitor,&mInternetMonitor);
|
||||
for(int i = 0; i < mCANDevicesList.size(); i++)
|
||||
{
|
||||
mCANDevicesList.at(i)->StartWatchdog(mSystemConfig.GetDeviceDetectionConfig());
|
||||
}
|
||||
// mMainWindow.mCANWatchdogSettingsPage->SetCANWatchdogConfig(mSystemConfig.GetCANWatchdogConfig());
|
||||
|
||||
// mGPTimer->setSingleShot(false);
|
||||
@@ -261,6 +267,8 @@ int COtarcikCan::SaveDeviceDetectionSettingsRequest(CDeviceDetectionConfig *Devi
|
||||
mSystemConfig.SaveConfig();
|
||||
mLANDevicesPresenceMonitor.Stop();
|
||||
mLANDevicesPresenceMonitor.Start(DeviceDetectconfig->GetLANDevicesConfigList());
|
||||
mInternetMonitor.UpdateCANReportingBit(DeviceDetectconfig->mInternetDetectionCANStatusBit);
|
||||
mCANBusMQTTClient.SetMQTTServerPresenceCANBit(DeviceDetectconfig->mMQTTDetectionCANStatusBit);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
@@ -315,5 +323,5 @@ void COtarcikCan::QuitApplicationRequest()
|
||||
mCPUInterface.StopCPUWatchdog();
|
||||
mCPUInterface.DeInit();
|
||||
|
||||
QCoreApplication::quit();
|
||||
QCoreApplication::exit(69);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user