class
paho.mqtt.enums.
CallbackAPIVersion
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
Defined the arguments passed to all user-callback.
See each callbacks for details:
on_connect
,
on_connect_fail
,
on_disconnect
,
on_message
,
on_publish
,
on_subscribe
,
on_unsubscribe
,
on_log
,
on_socket_open
,
on_socket_close
,
on_socket_register_write
,
on_socket_unregister_write
VERSION1
=
1
The version used with paho-mqtt 1.x before introducing CallbackAPIVersion.
This version had different arguments depending if MQTTv5 or MQTTv3 was used.
Properties
&
ReasonCode
were missing
on some callback (apply only to MQTTv5).
This version is deprecated and will be removed in version 3.0.
class
paho.mqtt.enums.
ConnackCode
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
CONNACK_ACCEPTED
=
0
class
paho.mqtt.enums.
LogLevel
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
MQTT_LOG_DEBUG
=
16
class
paho.mqtt.enums.
MQTTErrorCode
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
MQTT_ERR_ACL_DENIED
=
12
class
paho.mqtt.enums.
MQTTProtocolVersion
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
MQTTv31
=
3
class
paho.mqtt.enums.
MessageState
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
MQTT_MS_INVALID
=
0
class
paho.mqtt.enums.
MessageType
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
AUTH
=
240
class
paho.mqtt.enums.
PahoClientMode
(
value
,
names=<not
given>
,
*values
,
module=None
,
qualname=None
,
type=None
,
start=1
,
boundary=None
)
MQTT_BRIDGE
=
1
class
paho.mqtt.properties.
Properties
(
packetType
)
MQTT v5.0 properties class.
See Properties.names for a list of accepted property names along with their numeric values.
See Properties.properties for the data type of each property.
Example of use:
publish_properties = Properties(PacketTypes.PUBLISH)
publish_properties.UserProperty = ("a", "2")
publish_properties.UserProperty = ("c", "3")
First the object is created with packet type as argument, no properties will be present at
this point. Then properties are added as attributes, the name of which is the string property
name without the spaces.
allowsMultiple(compressedName)
class paho.mqtt.properties.VariableByteIntegers
MQTT variable byte integer helper class. Used
in several places in MQTT v5.0 properties.
static decode(buffer)
Get the value of a multi-byte integer from a buffer
Return the value, and the number of bytes used.
[MQTT-1.5.5-1] the encoded value MUST use the minimum number of bytes necessary to represent the value
class paho.mqtt.reasoncodes.ReasonCode(packetType: int, aName: str = 'Success', identifier: int = -1)
MQTT version 5.0 reason codes class.
See ReasonCode.names for a list of possible numeric values along with their
names and the packets to which they apply.
getId(name)
Get the numeric id corresponding to a reason code name.
Used when setting the reason code for a packetType
check that only valid codes for the packet are set.
ConnackCode.CONNACK_ACCEPTED
ConnackCode.CONNACK_REFUSED_BAD_USERNAME_PASSWORD
ConnackCode.CONNACK_REFUSED_IDENTIFIER_REJECTED
ConnackCode.CONNACK_REFUSED_NOT_AUTHORIZED
ConnackCode.CONNACK_REFUSED_PROTOCOL_VERSION
ConnackCode.CONNACK_REFUSED_SERVER_UNAVAILABLE
LogLevel