You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above function call will publish a message to the specified topic using the MQTT QoS `at_most_once`. Note that messages sent with `at_most_once` QoS are not subject to notification.
119
119
@@ -151,7 +151,7 @@ Subscribe to an MQTT topic by using the `subscribe/3` function. Specify a topic
151
151
subscribed_handler = fun handle_subscribed/2,
152
152
data_handler = fun handle_data/3
153
153
},
154
-
ok = mqtt_client:subscribe(MTQQ, Topic, SubscribeOptions).
154
+
ok = mqtt_client:subscribe(MQTT, Topic, SubscribeOptions).
155
155
156
156
The `subscribe/3` function will return `{error, already_subscribed}` if the client application is already subscribed to the specified topic.
157
157
@@ -173,14 +173,14 @@ The `data_handler` will be passed the MQTT client instance, topic on which the m
173
173
174
174
### Unsubscribing from an MQTT topic
175
175
176
-
Use the `unscibscribe/3` function to unsubscribe from a topic.
176
+
Use the `unsubscribe/3` function to unsubscribe from a topic.
177
177
178
178
%% erlang
179
179
Topic = <<"atomvm/topic0">>,
180
180
UnSubscribeOptions = #{
181
181
unsubscribed_handler = fun handle_unsubscribed/2
182
182
},
183
-
ok = mqtt_client:unsubscribe(MTQQ, Topic, UnSubscribeOptions).
183
+
ok = mqtt_client:unsubscribe(MQTT, Topic, UnSubscribeOptions).
184
184
185
185
The `unsubscribe/3` function will return `{error, not_subscribed}` if the client application is not yet subscribed to the specified topic.
186
186
@@ -199,6 +199,21 @@ TODO
199
199
200
200
#### Username/Password authentication
201
201
202
+
The username and password can be specified either as parameters to `mqtt_client:start/1` in the configuration map or directly in the broker URL (if supported by the broker).
0 commit comments