MqttSubscribe (FB)

FUNCTION_BLOCK MqttSubscribe EXTENDS AbbETrig3

subscribe to a topic on an already established connection to an MQTT broker

InOut:

Scope

Name

Type

Initial

Comment

Input

Conn

POINTER TO MQTT_CONNECTION

0

Pointer to valid connection struct created by MqttConnect

Topic

STRING(Constants.MQTT_MAX_TOPIC_LEN)

Defaults.MQTT_DEFAULT_EMPTY

Topic name as a string. See the description at the top. For further information see the MQTT specification.

MaxQos

MQTT_QOS

MQTT_QOS.QOS_0

Signals the server which is the highest QoS level which can be handled. Can be reduced to relieve the client from high network load.

Output

ErrorID

ERROR_ID

ERROR_ID.MQTT_ERR_NO_ERROR

Error code description