Skip to content

Commit 41e24d7

Browse files
committed
track recent changes
1 parent 10029d6 commit 41e24d7

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

reference-projects/stm32/nucleo-f746zg/web-ui-dashboard/hal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,3 @@ static inline void clock_init(void) {
174174
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
175175
}
176176

177-
#define MG_TCPIP_DRIVER_INIT(mgr) \
178-
struct mg_tcpip_driver_stm32f_data driver_data = {.mdc_cr = 4}; \
179-
struct mg_tcpip_if mif = {.mac = GENERATE_MAC_ADDRESS(), \
180-
.driver = &mg_tcpip_driver_stm32f, \
181-
.driver_data = &driver_data}; \
182-
mg_tcpip_init(&mgr, &mif);

reference-projects/windows-macos-linux/web-ui-dashboard/net.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static void handle_firmware_upload(struct mg_connection *c,
211211
mg_http_reply(c, 500, "", "offset and total not set\n");
212212
} else if (ofs == 0 && mg_ota_begin((size_t) tot) == false) {
213213
mg_http_reply(c, 500, "", "mg_ota_begin(%ld) failed\n", tot);
214-
} else if (data.len > 0 && mg_ota_write(data.ptr, data.len) == false) {
214+
} else if (data.len > 0 && mg_ota_write(data.buf, data.len) == false) {
215215
mg_http_reply(c, 500, "", "mg_ota_write(%lu) @%ld failed\n", data.len, ofs);
216216
mg_ota_end();
217217
} else if (data.len == 0 && mg_ota_end() == false) {
@@ -274,33 +274,33 @@ static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
274274
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
275275
struct user *u = authenticate(hm);
276276

277-
if (mg_http_match_uri(hm, "/api/#") && u == NULL) {
277+
if (mg_match(hm->uri, mg_str("/api/#"), NULL) && u == NULL) {
278278
mg_http_reply(c, 403, "", "Not Authorised\n");
279-
} else if (mg_http_match_uri(hm, "/api/login")) {
279+
} else if (mg_match(hm->uri, mg_str("/api/login"), NULL)) {
280280
handle_login(c, u);
281-
} else if (mg_http_match_uri(hm, "/api/logout")) {
281+
} else if (mg_match(hm->uri, mg_str("/api/logout"), NULL)) {
282282
handle_logout(c);
283-
} else if (mg_http_match_uri(hm, "/api/debug")) {
283+
} else if (mg_match(hm->uri, mg_str("/api/debug"), NULL)) {
284284
handle_debug(c, hm);
285-
} else if (mg_http_match_uri(hm, "/api/stats/get")) {
285+
} else if (mg_match(hm->uri, mg_str("/api/stats/get"), NULL)) {
286286
handle_stats_get(c);
287-
} else if (mg_http_match_uri(hm, "/api/events/get")) {
287+
} else if (mg_match(hm->uri, mg_str("/api/events/get"), NULL)) {
288288
handle_events_get(c, hm);
289-
} else if (mg_http_match_uri(hm, "/api/settings/get")) {
289+
} else if (mg_match(hm->uri, mg_str("/api/settings/get"), NULL)) {
290290
handle_settings_get(c);
291-
} else if (mg_http_match_uri(hm, "/api/settings/set")) {
291+
} else if (mg_match(hm->uri, mg_str("/api/settings/set"), NULL)) {
292292
handle_settings_set(c, hm->body);
293-
} else if (mg_http_match_uri(hm, "/api/firmware/upload")) {
293+
} else if (mg_match(hm->uri, mg_str("/api/firmware/upload"), NULL)) {
294294
handle_firmware_upload(c, hm);
295-
} else if (mg_http_match_uri(hm, "/api/firmware/commit")) {
295+
} else if (mg_match(hm->uri, mg_str("/api/firmware/commit"), NULL)) {
296296
handle_firmware_commit(c);
297-
} else if (mg_http_match_uri(hm, "/api/firmware/rollback")) {
297+
} else if (mg_match(hm->uri, mg_str("/api/firmware/rollback"), NULL)) {
298298
handle_firmware_rollback(c);
299-
} else if (mg_http_match_uri(hm, "/api/firmware/status")) {
299+
} else if (mg_match(hm->uri, mg_str("/api/firmware/status"), NULL)) {
300300
handle_firmware_status(c);
301-
} else if (mg_http_match_uri(hm, "/api/device/reset")) {
301+
} else if (mg_match(hm->uri, mg_str("/api/device/reset"), NULL)) {
302302
handle_device_reset(c);
303-
} else if (mg_http_match_uri(hm, "/api/device/eraselast")) {
303+
} else if (mg_match(hm->uri, mg_str("/api/device/eraselast"), NULL)) {
304304
handle_device_eraselast(c);
305305
} else {
306306
struct mg_http_serve_opts opts;
@@ -310,7 +310,7 @@ static void ev_handler(struct mg_connection *c, int ev, void *ev_data) {
310310
mg_http_serve_dir(c, ev_data, &opts);
311311
}
312312
MG_DEBUG(("%lu %.*s %.*s -> %.*s", c->id, (int) hm->method.len,
313-
hm->method.ptr, (int) hm->uri.len, hm->uri.ptr, (int) 3,
313+
hm->method.buf, (int) hm->uri.len, hm->uri.buf, (int) 3,
314314
&c->send.buf[9]));
315315
}
316316
}

0 commit comments

Comments
 (0)