Développement cloud.

This commit is contained in:
2023-02-19 17:03:43 -05:00
parent 3ec5677dca
commit daa887d67b
33 changed files with 2122 additions and 100 deletions
@@ -0,0 +1,43 @@
#include "CloudParams.h"
#include <QDataStream>
CCloudParams::CCloudParams()
{
}
QDataStream &operator>>(QDataStream &in, CCloudParams &dest)
{
in >> dest.mMQTTBrokerHostName
>> dest.mMQTTBrokerPassword
>> dest.mMQTTBrokerPort
>> dest.mMQTTBrokerUserName
>> dest.mMQTTTopicPrefix;
return in;
}
QDataStream &operator<<(QDataStream &out, const CCloudParams &source)
{
out << source.mMQTTBrokerHostName
<< source.mMQTTBrokerPassword
<< source.mMQTTBrokerPort
<< source.mMQTTBrokerUserName
<< source.mMQTTTopicPrefix;
return out;
}
CCloudParams& CCloudParams::operator=(const CCloudParams *source)
{
if(source == this)
{
return *this;
}
this->mMQTTBrokerHostName = source->mMQTTBrokerHostName;
this->mMQTTBrokerPassword = source->mMQTTBrokerPassword;
this->mMQTTBrokerPort = source->mMQTTBrokerPort;
this->mMQTTBrokerUserName = source->mMQTTBrokerUserName;
this->mMQTTTopicPrefix = source->mMQTTTopicPrefix;
return *this;
}
@@ -0,0 +1,22 @@
#ifndef CLOUDPARAMS_H
#define CLOUDPARAMS_H
#include <QString>
class CCloudParams
{
public:
CCloudParams();
QString mMQTTBrokerHostName;
QString mMQTTBrokerUserName;
QString mMQTTBrokerPassword;
QString mMQTTTopicPrefix;
quint32 mMQTTBrokerPort;
CCloudParams &operator=(const CCloudParams *source);
};
QDataStream &operator<<(QDataStream &out, const CCloudParams &source);
QDataStream &operator>>(QDataStream &in, CCloudParams &dest);
#endif // CLOUDPARAMS_H
@@ -0,0 +1,12 @@
#include "MQTTMessage.h"
CMQTTMessage::CMQTTMessage()
{
}
CMQTTMessage::CMQTTMessage(QString Topic, QString Payload)
{
mMessageTopic = Topic;
mMessagePayload = Payload;
}
@@ -0,0 +1,15 @@
#ifndef MQTTMESSAGE_H
#define MQTTMESSAGE_H
#include <QString>
class CMQTTMessage
{
public:
CMQTTMessage();
CMQTTMessage(QString Topic, QString Payload);
QString mMessageTopic;
QString mMessagePayload;
};
#endif // MQTTMESSAGE_H