Watchdog fonctionnel

This commit is contained in:
2023-07-31 14:50:35 -04:00
parent 5a83f9f8e0
commit 01aac940d5
16 changed files with 1161 additions and 474 deletions
+17 -1
View File
@@ -67,7 +67,6 @@ int CCANDevice::Init()
return RET_GENERAL_ERROR;
}
mIsCANInitialized = true;
if(mCANDatabase.Init(mDeviceConfigInfo.mCANDeviceDatabaseFilename) == RET_OK)
{
@@ -82,6 +81,9 @@ int CCANDevice::Init()
}
// if(mCANAnalyzer.Init(mDeviceConfigInfo.mCANDeviceID,mDeviceConfigInfo.mCANDeviceBaudrate,&mMessageList,mDeviceConfigInfo.mDevicePollPeriod) != RET_OK)
if(mCANAnalyzer.Init(mCANDriverIF,mDeviceHandle,mDeviceConfigInfo.mCANDeviceID,&mMessageList,mDeviceConfigInfo.mDevicePollPeriod) != RET_OK)
{
@@ -91,6 +93,20 @@ 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",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,true,1,CGeneralMessagesLogDispatcher::GEN_MSG_TXT_SUCCESS_STATUS);
}
mIsCANInitialized = true;
#ifdef USE_TOPIC_PREFIX
mCANDataLogger.SetMQTTTopicDevice(QString("%2CANBus/%1/").arg(mDeviceConfigInfo.mDeviceName).arg(mDeviceTopicPrefix));
#else