Github Repo | C Header | C source | JS source |
---|---|---|---|
mongoose-os-libs/dash | mgos_dash.h | api_dash.js |
This library provides support for device management dashboard.
Device management dashboard API.
bool mgos_dash_is_connected(void);
Returns true if mDash connection is up, false otherwise.
void mgos_dash_notifyf(const char *method, const char *json_fmt, ...);
Send an notification RPC to the dashboard that does not require an answer. Example - report statistical data:
mgos_dash_notifyf("Data", "[%d, %d]", value1, value2);
void mgos_dash_notify(const char *method, const char *data);
Same as
mgos_dash_notifyf()
but accepts stringified data.
Dash.isConnected()
Return value: true if mDash connection is up, false otherwise.
Dash.notify(name, data)
Send notification event to mDash. name
is an event name,
data
is either a string or an object. A string is sent as-is,
and object gets JSON.stringify()
-ed then sent.
Return value: none.
Example:
Dash.notify('Data', {temperature: 12.34});
edit this doc