mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
First stab
This commit is contained in:
1 parent
9173034b96
commit
d6852f5e74
90 files changed
+54758
-122
No files matched your search
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) 2021 Cesanta Software Limited
|
||||
// All rights reserved
|
||||
|
||||
#include "device.h"
|
||||
#include "mongoose.h"
|
||||
|
||||
// static const char *s_debug_level = "2";
|
||||
// static const char *s_listening_address = "http://0.0.0.0:80";
|
||||
|
||||
// Event handler for the listening connection.
|
||||
// static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data)
|
||||
// {
|
||||
// if (ev == MG_EV_HTTP_MSG) {
|
||||
// mg_http_reply(c, 200, "", "hello, %s!\n", "world");
|
||||
// }
|
||||
// (void) fn_data;
|
||||
// (void) ev_data;
|
||||
// }
|
||||
|
||||
static void fn(void *args) {
|
||||
// struct mg_mgr mgr;
|
||||
// struct mg_connection *c;
|
||||
|
||||
// mg_log_set(s_debug_level);
|
||||
// mg_mgr_init(&mgr);
|
||||
// if ((c = mg_http_listen(&mgr, s_listening_address, cb, &mgr)) == NULL) {
|
||||
// LOG(LL_ERROR, ("Cannot listen on %s. Use http://ADDR:PORT or :PORT",
|
||||
// s_listening_address));
|
||||
// }
|
||||
// LOG(LL_INFO, ("Starting Mongoose v%s", MG_VERSION));
|
||||
// for (;;) mg_mgr_poll(&mgr, 1000);
|
||||
// mg_mgr_free(&mgr);
|
||||
// int delay_ms = *(int *) args;
|
||||
for (;;) {
|
||||
led_toggle();
|
||||
vTaskDelay(pdMS_TO_TICKS(300));
|
||||
};
|
||||
(void) args;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
init_ram();
|
||||
init_hardware();
|
||||
xTaskCreate(fn, "server", 512, NULL, configMAX_PRIORITIES - 1, NULL);
|
||||
vTaskStartScheduler();
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user