Extend mg_mqtt_{pub,sub} by adding qos and retain

This commit is contained in:
cpq committed 2021-06-10 19:27:19 +01:00
1 parent a15d518571
commit 3deafaea7f
8 files changed
+39 -63

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
mm->data.ptr, (int) mm->topic.len, mm->topic.ptr));
for (struct sub *sub = s_subs; sub != NULL; sub = sub->next) {
if (mg_strcmp(mm->topic, sub->topic) != 0) continue;
mg_mqtt_pub(sub->c, &mm->topic, &mm->data);
mg_mqtt_pub(sub->c, &mm->topic, &mm->data, 1, false);
}
break;
}