IBM Watson

Github Repo C Header C source JS source
mongoose-os-libs/watson mgos_watson.h   api_watson.js

See IBM Watson tutorial


mgos_watson_is_connected

bool mgos_watson_is_connected(void);

Returns true if Watson connection is up, false otherwise.

mgos_watson_send_event_jsonf

bool mgos_watson_send_event_jsonf(const char *event_id, const char *json_fmt,
                                  ...);
bool mgos_watson_send_event_jsonp(const struct mg_str *event_id,
                                  const struct mg_str *body);

Send an event, in JSON format. The message should be an object with a "d" key and properties, e.g.: mgos_watson_send_eventf("{d: {foo: %d}}", foo);

JS API


Watson.isConnected

Watson.isConnected()

Return value: true if Watson connection is up, false otherwise.

edit this doc