KanoopProtocolQt 1.2.3
Qt HTTP operations and MQTT client library
Loading...
Searching...
No Matches
MqttParameters Class Reference

Encapsulates connection parameters for an MQTT broker. More...

#include <mqttparameters.h>

Public Member Functions

 MqttParameters ()
 Construct default MQTT parameters.
 
 MqttParameters (const QString &host, int port=1883)
 Construct MQTT parameters with the given host and port.
 
QString host () const
 Get the broker hostname.
 
void setHost (const QString &value)
 Set the broker hostname.
 
int port () const
 Get the broker port number.
 
void setPort (int value)
 Set the broker port number.
 
QString username () const
 Get the authentication username.
 
void setUsername (const QString &value)
 Set the authentication username.
 
QString password () const
 Get the authentication password.
 
void setPassword (const QString &value)
 Set the authentication password.
 
QString clientId () const
 Get the MQTT client identifier.
 
void setClientId (const QString &value)
 Set the MQTT client identifier.
 
QMqttClient::ProtocolVersion protocolVersion () const
 Get the MQTT protocol version.
 
void setProtocolVersion (QMqttClient::ProtocolVersion value)
 Set the MQTT protocol version.
 
bool useSsl () const
 Get whether SSL/TLS is enabled.
 
void setUseSsl (bool value)
 Set whether SSL/TLS is enabled.
 
bool verifyPeer () const
 Get whether peer certificate verification is enabled.
 
void setVerifyPeer (bool value)
 Set whether peer certificate verification is enabled.
 
QSslCertificate clientCertificate () const
 Get the client SSL certificate.
 
void setClientCertificate (const QSslCertificate &value)
 Set the client SSL certificate.
 
void setClientCertificate (const QString &filename)
 Set the client SSL certificate from a PEM file.
 
QSslCertificate caCertificate () const
 Get the CA certificate used to verify the broker.
 
void setCaCertificate (const QSslCertificate &value)
 Set the CA certificate used to verify the broker.
 
void setCaCertificate (const QString &filename)
 Set the CA certificate from a PEM file.
 
QSslKey privateKey () const
 Get the client private key for SSL authentication.
 
void setPrivateKey (const QSslKey &value)
 Set the client private key for SSL authentication.
 
void setPrivateKey (const QString &filename)
 Set the client private key from a PEM file.
 

Detailed Description

Encapsulates connection parameters for an MQTT broker.

Definition at line 9 of file mqttparameters.h.

Constructor & Destructor Documentation

◆ MqttParameters() [1/2]

MqttParameters::MqttParameters ( )
inline

Construct default MQTT parameters.

Definition at line 13 of file mqttparameters.h.

◆ MqttParameters() [2/2]

MqttParameters::MqttParameters ( const QString &  host,
int  port = 1883 
)
inline

Construct MQTT parameters with the given host and port.

Parameters
hostThe broker hostname or IP address.
portThe broker port number (default 1883).

Definition at line 17 of file mqttparameters.h.

Member Function Documentation

◆ caCertificate()

QSslCertificate MqttParameters::caCertificate ( ) const
inline

Get the CA certificate used to verify the broker.

Returns
The CA certificate.

Definition at line 88 of file mqttparameters.h.

◆ clientCertificate()

QSslCertificate MqttParameters::clientCertificate ( ) const
inline

Get the client SSL certificate.

Returns
The client certificate.

Definition at line 78 of file mqttparameters.h.

◆ clientId()

QString MqttParameters::clientId ( ) const
inline

Get the MQTT client identifier.

Returns
The client ID string.

Definition at line 50 of file mqttparameters.h.

◆ host()

QString MqttParameters::host ( ) const
inline

Get the broker hostname.

Returns
The broker hostname or IP address.

Definition at line 22 of file mqttparameters.h.

◆ password()

QString MqttParameters::password ( ) const
inline

Get the authentication password.

Returns
The password string.

Definition at line 43 of file mqttparameters.h.

◆ port()

int MqttParameters::port ( ) const
inline

Get the broker port number.

Returns
The port number.

Definition at line 29 of file mqttparameters.h.

◆ privateKey()

QSslKey MqttParameters::privateKey ( ) const
inline

Get the client private key for SSL authentication.

Returns
The private key.

Definition at line 98 of file mqttparameters.h.

◆ protocolVersion()

QMqttClient::ProtocolVersion MqttParameters::protocolVersion ( ) const
inline

Get the MQTT protocol version.

Returns
The protocol version enum value.

Definition at line 57 of file mqttparameters.h.

◆ setCaCertificate() [1/2]

void MqttParameters::setCaCertificate ( const QSslCertificate &  value)
inline

Set the CA certificate used to verify the broker.

Parameters
valueThe CA certificate.

Definition at line 91 of file mqttparameters.h.

◆ setCaCertificate() [2/2]

void MqttParameters::setCaCertificate ( const QString &  filename)

Set the CA certificate from a PEM file.

Parameters
filenamePath to the CA certificate file.

◆ setClientCertificate() [1/2]

void MqttParameters::setClientCertificate ( const QSslCertificate &  value)
inline

Set the client SSL certificate.

Parameters
valueThe client certificate.

Definition at line 81 of file mqttparameters.h.

◆ setClientCertificate() [2/2]

void MqttParameters::setClientCertificate ( const QString &  filename)

Set the client SSL certificate from a PEM file.

Parameters
filenamePath to the certificate file.

◆ setClientId()

void MqttParameters::setClientId ( const QString &  value)
inline

Set the MQTT client identifier.

Parameters
valueThe client ID string.

Definition at line 53 of file mqttparameters.h.

◆ setHost()

void MqttParameters::setHost ( const QString &  value)
inline

Set the broker hostname.

Parameters
valueThe broker hostname or IP address.

Definition at line 25 of file mqttparameters.h.

◆ setPassword()

void MqttParameters::setPassword ( const QString &  value)
inline

Set the authentication password.

Parameters
valueThe password string.

Definition at line 46 of file mqttparameters.h.

◆ setPort()

void MqttParameters::setPort ( int  value)
inline

Set the broker port number.

Parameters
valueThe port number.

Definition at line 32 of file mqttparameters.h.

◆ setPrivateKey() [1/2]

void MqttParameters::setPrivateKey ( const QSslKey &  value)
inline

Set the client private key for SSL authentication.

Parameters
valueThe private key.

Definition at line 101 of file mqttparameters.h.

◆ setPrivateKey() [2/2]

void MqttParameters::setPrivateKey ( const QString &  filename)

Set the client private key from a PEM file.

Parameters
filenamePath to the private key file.

◆ setProtocolVersion()

void MqttParameters::setProtocolVersion ( QMqttClient::ProtocolVersion  value)
inline

Set the MQTT protocol version.

Parameters
valueThe protocol version enum value.

Definition at line 60 of file mqttparameters.h.

◆ setUsername()

void MqttParameters::setUsername ( const QString &  value)
inline

Set the authentication username.

Parameters
valueThe username string.

Definition at line 39 of file mqttparameters.h.

◆ setUseSsl()

void MqttParameters::setUseSsl ( bool  value)
inline

Set whether SSL/TLS is enabled.

Parameters
valueTrue to enable SSL.

Definition at line 67 of file mqttparameters.h.

◆ setVerifyPeer()

void MqttParameters::setVerifyPeer ( bool  value)
inline

Set whether peer certificate verification is enabled.

Parameters
valueTrue to enable peer verification.

Definition at line 74 of file mqttparameters.h.

◆ username()

QString MqttParameters::username ( ) const
inline

Get the authentication username.

Returns
The username string.

Definition at line 36 of file mqttparameters.h.

◆ useSsl()

bool MqttParameters::useSsl ( ) const
inline

Get whether SSL/TLS is enabled.

Returns
True if SSL is enabled.

Definition at line 64 of file mqttparameters.h.

◆ verifyPeer()

bool MqttParameters::verifyPeer ( ) const
inline

Get whether peer certificate verification is enabled.

Returns
True if peer verification is enabled.

Definition at line 71 of file mqttparameters.h.


The documentation for this class was generated from the following file: