mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-11 16:40:17 +00:00
2 files changed
+5
-3
No files matched your search
@@ -128,7 +128,8 @@ static void mqtt_fn(struct mg_connection *c, int ev, void *ev_data, void *fnd) {
|
|||||||
static void timer_mqtt_fn(void *param) {
|
static void timer_mqtt_fn(void *param) {
|
||||||
struct mg_mgr *mgr = (struct mg_mgr *) param;
|
struct mg_mgr *mgr = (struct mg_mgr *) param;
|
||||||
if (s_mqtt == NULL) {
|
if (s_mqtt == NULL) {
|
||||||
struct mg_mqtt_opts opts = {0};
|
struct mg_mqtt_opts opts;
|
||||||
|
memset(&opts, 0, sizeof(opts));
|
||||||
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
|
s_mqtt = mg_mqtt_connect(mgr, s_config.url, &opts, mqtt_fn, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,7 +208,8 @@ void device_dashboard_fn(struct mg_connection *c, int ev, void *ev_data,
|
|||||||
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q}\n", "user", u->name, "token",
|
mg_http_reply(c, 200, NULL, "{%Q:%Q,%Q:%Q}\n", "user", u->name, "token",
|
||||||
u->token);
|
u->token);
|
||||||
} else {
|
} else {
|
||||||
struct mg_http_serve_opts opts = {0};
|
struct mg_http_serve_opts opts;
|
||||||
|
memset(&opts, 0, sizeof(opts));
|
||||||
#if 1
|
#if 1
|
||||||
opts.root_dir = "/web_root";
|
opts.root_dir = "/web_root";
|
||||||
opts.fs = &mg_fs_packed;
|
opts.fs = &mg_fs_packed;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ int main(int argc, char *argv[]) {
|
|||||||
&c.mac[3], &c.mac[4], &c.mac[5]);
|
&c.mac[3], &c.mac[4], &c.mac[5]);
|
||||||
|
|
||||||
struct mip_driver driver = {.tx = tap_tx, .up = tap_up, .rx = tap_rx};
|
struct mip_driver driver = {.tx = tap_tx, .up = tap_up, .rx = tap_rx};
|
||||||
mip_init(&mgr, &c, &driver, (void *) fd);
|
mip_init(&mgr, &c, &driver, (void *) (size_t) fd);
|
||||||
MG_INFO(("Init done, starting main loop"));
|
MG_INFO(("Init done, starting main loop"));
|
||||||
|
|
||||||
extern void device_dashboard_fn(struct mg_connection *, int, void *, void *);
|
extern void device_dashboard_fn(struct mg_connection *, int, void *, void *);
|
||||||
|
|||||||
Reference in new issue
Block a user