mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
Add user and pass to struct mg_mqtt_opts
This commit is contained in:
1 parent
03d187b147
commit
52be84f04e
4 files changed
+30
-34
No files matched your search
+3
-2
@@ -23,6 +23,8 @@
|
||||
#define MQTT_SET_QOS(flags, qos) (flags) = ((flags) & ~0x6) | ((qos) << 1)
|
||||
|
||||
struct mg_mqtt_opts {
|
||||
struct mg_str user; // Username, can be empty
|
||||
struct mg_str pass; // Password, can be empty
|
||||
struct mg_str client_id; // Client ID
|
||||
struct mg_str will_topic; // Will topic
|
||||
struct mg_str will_message; // Will message
|
||||
@@ -47,8 +49,7 @@ struct mg_connection *mg_mqtt_connect(struct mg_mgr *, const char *url,
|
||||
mg_event_handler_t fn, void *fn_data);
|
||||
struct mg_connection *mg_mqtt_listen(struct mg_mgr *mgr, const char *url,
|
||||
mg_event_handler_t fn, void *fn_data);
|
||||
void mg_mqtt_login(struct mg_connection *c, const char *url,
|
||||
struct mg_mqtt_opts *opts);
|
||||
void mg_mqtt_login(struct mg_connection *c, struct mg_mqtt_opts *opts);
|
||||
void mg_mqtt_pub(struct mg_connection *c, struct mg_str *topic,
|
||||
struct mg_str *data, int qos, bool retain);
|
||||
void mg_mqtt_sub(struct mg_connection *, struct mg_str *topic, int qos);
|
||||
|
||||
Reference in new issue
Block a user