Subscribe to an MQTT topic and receive message from the broker
Simulink Support Package for Android Devices / Communication
Use the MQTT Subscribe block to receive messages from the message queuing telemetry transport (MQTT) broker on the specified topic.
Data Length — Length of data
The port outputs the actual length of the data received from the MQTT broker.
Data — Data received from MQTT broker
The block outputs the data received from the MQTT broker as an array of ASCII characters.
Topic — Topic for subscription
channels/<channelID>/subscribe (default) | any valid topic name
Specify a topic to which the client subscribes. A topic can have a maximum of 128 characters. For information on topics and their structure, see Topics in MQTT.
Maximum length of output message — Maximum length of data read from the MQTT broker
256 (default) |
Specify the maximum length of the data you want to receive at each sample time.
Sample time — Frequency to check for messages from MQTT broker
1 (default) |
-1 | any positive integer
Specify how often the client checks for a new message from the broker. When you
specify the sample time as
-1, the block inherits its sample time
based on the context of the block within the model.
Introduced in R2023a