|CMake:|| find_package(Qt6 REQUIRED COMPONENTS Mqtt) |
target_link_libraries(mytarget PRIVATE Qt6::Mqtt)
|qmake:||QT += mqtt|
|void||setAuthenticationData(const QByteArray &authData)|
|void||setAuthenticationMethod(const QString &authMethod)|
|void||setUserProperties(const QMqttUserProperties &properties)|
Note: Connection properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See QMqttClient::ProtocolVersion for more information.
Member Function Documentation
QByteArray QMqttConnectionProperties::authenticationData() const
Returns the authentication data.
See also setAuthenticationData().
QString QMqttConnectionProperties::authenticationMethod() const
Returns the authentication method.
See also setAuthenticationMethod().
quint32 QMqttConnectionProperties::maximumPacketSize() const
Returns the maximum packet size the client can receive.
See also setMaximumPacketSize().
quint16 QMqttConnectionProperties::maximumReceive() const
Returns the maximum amount of QoS 1 and QoS 2 publications that the client (when obtained from QMqttClient::connectionProperties()) or the server (when obtained from QMqttClient::serverConnectionProperties()) is willing to process concurrently for this session.
See also setMaximumReceive().
quint16 QMqttConnectionProperties::maximumTopicAlias() const
Returns the maximum topic alias ID the client can use.
See also setMaximumTopicAlias().
Returns whether the client should receive problem information.
See also setRequestProblemInformation().
Returns whether the client should receive response information.
See also setRequestResponseInformation().
quint32 QMqttConnectionProperties::sessionExpiryInterval() const
Returns the session expiry interval.
See also setSessionExpiryInterval().
void QMqttConnectionProperties::setAuthenticationData(const QByteArray &authData)
Sets the authentication data to authData.
Authentication data can only be used if an authentication method has been specified.
void QMqttConnectionProperties::setAuthenticationMethod(const QString &authMethod)
Sets the authentication method to authMethod.
void QMqttConnectionProperties::setMaximumPacketSize(quint32 packetSize)
Sets the maximum packet size to packetSize. The maximum packet size specifies the maximum size one packet can contain. This includes the packet header and its properties.
If no maximum packet size is specified, no limit is imposed beyond the limitations of the protocol itself.
See also maximumPacketSize().
void QMqttConnectionProperties::setMaximumReceive(quint16 maximumReceive)
Sets the maximum amount of QoS 1 and QoS 2 publications that the client is willing to process concurrently for this session to maximumReceive.
A maximum receive value of 0 is not allowed.
See also maximumReceive().
void QMqttConnectionProperties::setMaximumTopicAlias(quint16 alias)
Sets the maximum topic alias to alias. The maximum topic alias specifies the highest value that the client will accept from the server. The client uses this value to limit the number of topic aliases it is willing to hold for the connection.
The default value is 0. 0 indicates that the client does not accept any topic aliases on this connection.
See also maximumTopicAlias().
Sets the request problem information to problem. A client uses this to request the server to return additional information in case of failure. Types of failure include connection and message management on the server side.
The default value is
false, which indicates that the client must not receive any problem information for anything but connection management. The server still may send problem information for connection handling. If the value is
true, the server may return problem information.
Problem information is available in user properties or reason strings of the property classes.
See also requestProblemInformation().
Sets the request response information to response. A client uses this to request the server to return response information after the connection request has been handled.
The default value is
false, which indicates that the client must not return any response information. If the value is
true, the server may return response information, but is not enforced to do so.
See also requestResponseInformation().
void QMqttConnectionProperties::setSessionExpiryInterval(quint32 expiry)
Sets the session expiry interval to expiry. The session expiry interval specifies the number of seconds a server holds information on the client state after a connection has been closed.
The default value is 0, which specifies that the session is closed when the network connection ends. If the value is specified as maximum of quint32, then the session does not expire.
See also sessionExpiryInterval().
void QMqttConnectionProperties::setUserProperties(const QMqttUserProperties &properties)
Sets the user properties of the connection to properties.
The default value is to not send any user information.
See also userProperties().
QMqttUserProperties QMqttConnectionProperties::userProperties() const
Returns the user properties for the connection.
See also setUserProperties().
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.