1#ifndef MQTTPARAMETERS_H
2#define MQTTPARAMETERS_H
6#include <Kanoop/kanoopprotocol.h>
18 _host(host), _port(port) {}
22 QString
host()
const {
return _host; }
25 void setHost(
const QString& value) { _host = value; }
29 int port()
const {
return _port; }
32 void setPort(
int value) { _port = value; }
64 bool useSsl()
const {
return _useSsl; }
112 QMqttClient::ProtocolVersion _protocolVersion = QMqttClient::MQTT_5_0;
113 bool _useSsl =
false;
114 bool _verifyPeer =
false;
116 QSslCertificate _clientCertificate;
117 QSslCertificate _caCertificate;
Encapsulates connection parameters for an MQTT broker.
void setPrivateKey(const QSslKey &value)
Set the client private key for SSL authentication.
QString username() const
Get the authentication username.
void setUseSsl(bool value)
Set whether SSL/TLS is enabled.
QSslCertificate caCertificate() const
Get the CA certificate used to verify the broker.
void setPassword(const QString &value)
Set the authentication password.
void setClientCertificate(const QSslCertificate &value)
Set the client SSL certificate.
MqttParameters()
Construct default MQTT parameters.
void setClientCertificate(const QString &filename)
Set the client SSL certificate from a PEM file.
bool useSsl() const
Get whether SSL/TLS is enabled.
void setCaCertificate(const QSslCertificate &value)
Set the CA certificate used to verify the broker.
bool verifyPeer() const
Get whether peer certificate verification is enabled.
void setCaCertificate(const QString &filename)
Set the CA certificate from a PEM file.
void setProtocolVersion(QMqttClient::ProtocolVersion value)
Set the MQTT protocol version.
QSslCertificate clientCertificate() const
Get the client SSL certificate.
void setVerifyPeer(bool value)
Set whether peer certificate verification is enabled.
MqttParameters(const QString &host, int port=1883)
Construct MQTT parameters with the given host and port.
int port() const
Get the broker port number.
void setPort(int value)
Set the broker port number.
QString password() const
Get the authentication password.
void setPrivateKey(const QString &filename)
Set the client private key from a PEM file.
QString host() const
Get the broker hostname.
QString clientId() const
Get the MQTT client identifier.
QSslKey privateKey() const
Get the client private key for SSL authentication.
void setHost(const QString &value)
Set the broker hostname.
QMqttClient::ProtocolVersion protocolVersion() const
Get the MQTT protocol version.
void setClientId(const QString &value)
Set the MQTT client identifier.
void setUsername(const QString &value)
Set the authentication username.