class QMqtt

Contains miscellaneous identifiers used throughout the Qt MQTT module. More

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

class PayloadFormatIndicator

The payload format provides information on the content of a message. This can help other clients to handle the message faster.

Constant

Description

QMqtt.PayloadFormatIndicator.Unspecified

The format is not specified.

QMqtt.PayloadFormatIndicator.UTF8Encoded

The payload of the message is formatted as UTF-8 Encoded Character Data.

class MessageStatus

This enum type specifies the available states of a message. Depending on the QoS and role of the client, different message statuses are expected.

Constant

Description

QMqtt.MessageStatus.Unknown

The message status is unknown.

QMqtt.MessageStatus.Published

The client received a message for one of its subscriptions. This applies to QoS levels 1 and 2.

QMqtt.MessageStatus.Acknowledged

A message has been acknowledged. This applies to QoS 1 and states that the message handling has been finished from the client side.

QMqtt.MessageStatus.Received

A message has been received. This applies to QoS 2.

QMqtt.MessageStatus.Released

A message has been released. This applies to QoS 2. For a publisher the message handling has been finished.

QMqtt.MessageStatus.Completed

A message has been completed. This applies to QoS 2 and states that the message handling has been finished from the client side.

class ReasonCode

This enum type specifies the available error codes.

Constant

Description

QMqtt.ReasonCode.Success

The specified action has succeeded.

QMqtt.ReasonCode.SubscriptionQoSLevel0

A subscription with QoS level 0 has been created.

QMqtt.ReasonCode.SubscriptionQoSLevel1

A subscription with QoS level 1 has been created.

QMqtt.ReasonCode.SubscriptionQoSLevel2

A subscription with QoS level 2 has been created.

QMqtt.ReasonCode.NoMatchingSubscriber

The message has been accepted by the server, but there are no subscribers to receive this message. A broker may send this reason code instead of Success.

QMqtt.ReasonCode.NoSubscriptionExisted

No matching Topic Filter is being used by the Client.

QMqtt.ReasonCode.ContinueAuthentication

Continue the authentication with another step.

QMqtt.ReasonCode.ReAuthenticate

Initiate a re-authentication.

QMqtt.ReasonCode.UnspecifiedError

An unspecified error occurred.

QMqtt.ReasonCode.MalformedPacket

The packet sent to the server is invalid.

QMqtt.ReasonCode.ProtocolError

A protocol error has occurred. In most cases, this will cause the server to disconnect the client.

QMqtt.ReasonCode.ImplementationSpecificError

The packet is valid, but the recipient rejects it.

QMqtt.ReasonCode.UnsupportedProtocolVersion

The requested protocol version is not supported by the server.

QMqtt.ReasonCode.InvalidClientId

The client ID is invalid.

QMqtt.ReasonCode.InvalidUserNameOrPassword

The username or password specified is invalid.

QMqtt.ReasonCode.NotAuthorized

The client is not authorized for the specified action.

QMqtt.ReasonCode.ServerNotAvailable

The server to connect to is not available.

QMqtt.ReasonCode.ServerBusy

The server to connect to is not available. The client is asked to try at a later time.

QMqtt.ReasonCode.ClientBanned

The client has been banned from the server.

QMqtt.ReasonCode.InvalidAuthenticationMethod

The authentication method specified is invalid.

QMqtt.ReasonCode.InvalidTopicFilter

The topic filter specified is invalid.

QMqtt.ReasonCode.InvalidTopicName

The topic name specified is invalid.

QMqtt.ReasonCode.MessageIdInUse

The message ID used in the previous packet is already in use.

QMqtt.ReasonCode.MessageIdNotFound

The message ID used in the previous packet has not been found.

QMqtt.ReasonCode.PacketTooLarge

The packet received is too large. See also maximumPacketSize() .

QMqtt.ReasonCode.QuotaExceeded

An administratively imposed limit has been exceeded.

QMqtt.ReasonCode.InvalidPayloadFormat

The payload format is invalid. See also payloadFormatIndicator() .

QMqtt.ReasonCode.RetainNotSupported

The server does not support retained messages. See also retainAvailable() .

QMqtt.ReasonCode.QoSNotSupported

The QoS level requested is not supported. See also maximumQoS() .

QMqtt.ReasonCode.UseAnotherServer

The server the client tries to connect to is not available. See also serverReference() .

QMqtt.ReasonCode.ServerMoved

The server the client tries to connect to has moved to a new address. See also serverReference() .

QMqtt.ReasonCode.SharedSubscriptionsNotSupported

Shared subscriptions are not supported. See also sharedSubscriptionSupported() .

QMqtt.ReasonCode.ExceededConnectionRate

The connection rate limit has been exceeded.

QMqtt.ReasonCode.SubscriptionIdsNotSupported

Subscription IDs are not supported. See also subscriptionIdentifierSupported() .

QMqtt.ReasonCode.WildCardSubscriptionsNotSupported

Subscriptions using wildcards are not supported by the server. See also wildcardSupported() .

Not all values are available in every use case. Especially, some servers will reject a reason code not suited for a specific command. See below table to highlight expected reason codes for specific actions.

Reason Code

Connect Properties

Subscription Properties

Message Properties

Success

X

X

X

SubscriptionQoSLevel0

X

SubscriptionQoSLevel1

X

SubscriptionQoSLevel2

X

NoMatchingSubscriber

X

UnspecifiedError

X

X

X

MalformedPacket

X

ProtocolError

X

ImplementationSpecificError

X

X

X

UnsupportedProtocolVersion

X

InvalidClientId

X

InvalidUserNameOrPassword

X

NotAuthorized

X

X

X

ServerNotAvailable

X

ServerBusy

X

ClientBanned

X

InvalidAuthenticationMethod

X

InvalidTopicFilter

X

InvalidTopicName

X

X

MessageIdInUse

X

X

MessageIdNotFound

X

PacketTooLarge

X

QuotaExceeded

X

X

X

InvalidPayloadFormat

X

X

RetainNotSupported

X

QoSNotSupported

X

UseAnotherServer

X

ServerMoved

X

SharedSubscriptionsNotSupported

X

ExceededConnectionRate

X

SubscriptionIdsNotSupported

X

WildCardSubscriptionsNotSupported

X