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
ConnPOINTER TO MQTT_CONNECTION
0
Pointer to valid connection struct created by MqttConnect
TopicSTRING(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.
MaxQosMQTT_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
ErrorIDERROR_ID.MQTT_ERR_NO_ERROR
Error code description