Commit 993973b5 authored by Kishen Maloor's avatar Kishen Maloor

Add new API to discover resources on OCF Clouds

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 055748e4
......@@ -318,6 +318,25 @@ oc_cloud_refresh_token(oc_cloud_context_t *ctx, oc_cloud_cb_t cb, void *data)
return -1;
}
int
oc_cloud_discover_resources(oc_cloud_context_t *ctx,
oc_discovery_all_handler_t handler, void *user_data)
{
if (!ctx) {
return -1;
}
if (!(ctx->store.status & OC_CLOUD_LOGGED_IN)) {
return -1;
}
if (oc_do_ip_discovery_all_at_endpoint(handler, ctx->cloud_ep, user_data)) {
return 0;
}
return -1;
}
/* Internal APIs for accessing the OCF Cloud */
bool
cloud_access_register(oc_endpoint_t *endpoint, const char *auth_provider,
......
......@@ -24,6 +24,7 @@
#define OC_CLOUD_H
#include "oc_ri.h"
#include "oc_client_state.h"
#include "oc_session_events.h"
#ifdef __cplusplus
......@@ -128,6 +129,9 @@ int oc_cloud_get_token_expiry(oc_cloud_context_t *ctx);
int oc_cloud_add_resource(oc_resource_t *resource);
void oc_cloud_delete_resource(oc_resource_t *resource);
int oc_cloud_publish_resources(size_t device);
int oc_cloud_discover_resources(oc_cloud_context_t *ctx,
oc_discovery_all_handler_t handler,
void *user_data);
int oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx,
const char *server,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment