diff --git a/README.md b/README.md index 2ba81111..950e1817 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,12 @@ robust, and easy. Features include: - Tiny static and run-time footprint - Source code is both ISO C and ISO C++ compliant - Works with any network stack with socket API, like LwIP or FreeRTOS-Plus-TCP -- Optional [built-in IP stack](mip) for bare metal or RTOS-enabled applications - Very easy to integrate: just copy `mongoose.c` and `mongoose.h` files to your build tree +- Optional built-in TCP/IP stack with drivers for bare metal or RTOS firmwares + - A full device dashboard + [bare metal example on Nucleo-F429ZI](examples/stm32/nucleo-f429zi-baremetal) + is only 6 files + - For comparison, a CubeIDE generated HTTP example is 400+ files - Detailed [documentation](https://mongoose.ws/documentation/) and [tutorials](https://mongoose.ws/tutorials/) diff --git a/examples/device-dashboard/net.c b/examples/device-dashboard/net.c index db5eab60..07e77ddb 100644 --- a/examples/device-dashboard/net.c +++ b/examples/device-dashboard/net.c @@ -170,6 +170,10 @@ void device_dashboard_fn(struct mg_connection *c, int ev, void *ev_data, // u ? u->name : "NULL")); if (mg_http_match_uri(hm, "/api/hi")) { mg_http_reply(c, 200, "", "hi\n"); // Testing endpoint + } else if (mg_http_match_uri(hm, "/api/debug")) { + int level = mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG); + mg_log_set(level); + mg_http_reply(c, 200, "", "Debug level set to %d\n", level); } else if (u == NULL && mg_http_match_uri(hm, "/api/#")) { // All URIs starting with /api/ must be authenticated mg_http_reply(c, 403, "", "Denied\n");