Github Repo | C Header | C source | JS source |
---|---|---|---|
mongoose-os-libs/mongoose | mgos_mongoose.h |
See here.
This file contains wrappers around low-level Mongoose Library calls.
See https://mongoose-os.com/docs/mongoose-os/userguide/intro.md#main-event-loop for the detailed explanation.
struct mg_mgr *mgos_get_mgr(void);
Return global event manager
int mongoose_poll(int ms);
If there are active connections, calls
mg_mgr_poll
on global event manager. Also calls all registered on-poll callbacks (seemgos_add_poll_cb()
and friends). Also feeds watchdog if that feature is enabled (seemgos_wdt_set_feed_on_poll()
). Also reports min free heap size if that feature is enabled (seemgos_set_enable_min_heap_free_reporting()
)
typedef void (*mgos_poll_cb_t)(void *cb_arg);
On-poll callback;
cb_arg
is an arbitrary pointer given tomgos_add_poll_cb()
void mgos_add_poll_cb(mgos_poll_cb_t cb, void *cb_arg);
Add an on-poll callback with an arbitrary argument, see
mongoose_poll()
.
void mgos_remove_poll_cb(mgos_poll_cb_t cb, void *cb_arg);
Remove an on-poll callback, see
mongoose_poll()
.
void mgos_wdt_set_feed_on_poll(bool enable);
Set whether wdt should be fed on each call to
mongoose_poll()
.
void mgos_set_enable_min_heap_free_reporting(bool enable);
edit this docSet whether min free heap size should be reported on each call to
mongoose_poll()
.