Cloud API

int aos_cloud_register_callback(int cb_type, aos_cloud_cb_t cb)

Register cloud event callback.

Return
the operation status, 0 is OK, others is error.
Parameters
  • cb_type: event type interested.
  • cb: cloud event callback.

int aos_cloud_report(const char * method, const char * json_buffer, void(*done_cb)(void *), void * arg)

Report event to cloud.

Return
the operation status, 0 is OK, others is error.
Parameters
  • method: remote method name.
  • json_buffer: method’s payload.
  • done_cb: report done callback.
  • arg: private data passed to done_cb.

void aos_cloud_trigger(int cb_type, const char * json_buffer)

Trigger specific event, used by Cloud Backend.

Parameters
  • cb_type: event type.
  • json_buffer: payload.

void aos_cloud_register_backend(int(*report)(const char *method, const char *json_buffer))

Register Cloud Backend.

Parameters
  • report: called when user do aos_cloud_report.