Multi brokers MQTT semble fonctionner

This commit is contained in:
2025-05-03 15:01:06 -04:00
parent 9e43e9c748
commit e298577c2f
17 changed files with 780 additions and 558 deletions
+1 -11
View File
@@ -4,8 +4,7 @@
CCANDataLogger::CCANDataLogger():
mTopicDeviceString("")
{
mMQTTCLient = 0;
mCANMsgList.clear();
mCANMsgList.clear();
}
@@ -51,11 +50,6 @@ int CCANDataLogger::SetMQTTTopicDevice(QString DeviceString)
return RET_OK;
}
int CCANDataLogger::SetMQTTClient(CMQTTClientWrapper *MQTTClient)
{
mMQTTCLient = MQTTClient;
return RET_OK;
}
QList<CMQTTMessage> *CCANDataLogger::GetMQTTMessagesList()
{
@@ -115,10 +109,6 @@ QList<CMQTTMessage> *CCANDataLogger::GetMQTTMessagesList()
mCANMsgList.clear();
// if(mMQTTCLient != 0)
// {
// mMQTTCLient->NewMQTTMessages(mMQTTMsgList);
// }
return &mMQTTMsgList;
}
@@ -18,12 +18,10 @@ public:
//MQTT logging
QString mTopicDeviceString;
QList<CMQTTMessage> mMQTTMsgList;
CMQTTClientWrapper *mMQTTCLient;
QList<CCANMessage> mCANMsgList;
CMQTTMessage GetMQTTMessage(CCANMessage* Message, bool Format = false);
int SetMQTTTopicDevice(QString DeviceString);
int SetMQTTClient(CMQTTClientWrapper *MQTTClient);
QList<CMQTTMessage> *GetMQTTMessagesList();
+1 -3
View File
@@ -13,7 +13,7 @@ CCANDevice::CCANDevice(QObject *parent)
mProgramPtr = 0;
}
CCANDevice::CCANDevice(CCANDeviceConfig &SysConfig, CMQTTClientWrapper *MQTTClient, QString DeviceTopicPrefix)
CCANDevice::CCANDevice(CCANDeviceConfig &SysConfig, QString DeviceTopicPrefix)
{
mMessageList.clear();
mMessagesListLoaded = false;
@@ -21,7 +21,6 @@ CCANDevice::CCANDevice(CCANDeviceConfig &SysConfig, CMQTTClientWrapper *MQTTClie
mProgramPtr = 0;
mDeviceConfigInfo = SysConfig;
mCANMQTTClient = MQTTClient;
mDeviceTopicPrefix = DeviceTopicPrefix;
mCANDriverIF = 0;
@@ -101,7 +100,6 @@ int CCANDevice::Init()
#else
mCANDataLogger.SetMQTTTopicDevice(QString("CANBus/%1/").arg(mDeviceConfigInfo.mDeviceName));
#endif
mCANDataLogger.SetMQTTClient(mCANMQTTClient);
mProgramPtr->SetCANConnectionStatusRequest(true);
mProgramPtr->UpdateCANModuleStatusRequest(mDeviceConfigInfo.mDeviceName,"Connecté","NOUPDATE");
+1 -2
View File
@@ -24,7 +24,7 @@ class CCANDevice : public QObject
Q_OBJECT
public:
explicit CCANDevice(QObject *parent = 0);
CCANDevice(CCANDeviceConfig &SysConfig, CMQTTClientWrapper* MQTTClient = 0, QString DeviceTopicPrefix="");
CCANDevice(CCANDeviceConfig &SysConfig, QString DeviceTopicPrefix="");
~CCANDevice();
int Init(QString DatabaseFileName, TPCANHandle CANDeviceID, TPCANBaudrate CANDeviceBaudRate, QString DevDescription, QString DeviceName, unsigned int DevicePollPeriod);
@@ -40,7 +40,6 @@ public:
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;
CMQTTClientWrapper *mCANMQTTClient;
QString mDeviceTopicPrefix;
CCANWatchdog mCANWatchdog;