IoTivity-Lite
oc_ri.h File Reference
#include "oc_config.h"
#include "oc_endpoint.h"
#include "oc_rep.h"
#include "oc_uuid.h"
#include "util/oc_etimer.h"

Macros

#define OC_NUM_CORE_RESOURCES_PER_DEVICE   (1 + OCF_D)
 
#define oc_ri_add_timed_event_callback_seconds(cb_data, event_callback, seconds)
 

Typedefs

typedef struct oc_collection_s oc_collection_t
 
typedef struct oc_event_callback_s oc_event_callback_t
 
typedef void(* oc_get_properties_cb_t) (oc_resource_t *, oc_interface_mask_t, void *)
 
typedef struct oc_link_s oc_link_t
 
typedef struct oc_properties_cb_t oc_properties_cb_t
 
typedef void(* oc_request_callback_t) (oc_request_t *, oc_interface_mask_t, void *)
 
typedef struct oc_request_handler_s oc_request_handler_t
 
typedef struct oc_request_t oc_request_t
 
typedef struct oc_resource_s oc_resource_t
 
typedef struct oc_response_buffer_s oc_response_buffer_t
 
typedef struct oc_response_t oc_response_t
 
typedef struct oc_separate_response_s oc_separate_response_t
 
typedef bool(* oc_set_properties_cb_t) (oc_resource_t *, oc_rep_t *, void *)
 
typedef oc_event_callback_retval_t(* oc_trigger_t) (void *)
 

Enumerations

enum  oc_core_resource_t {
  OCF_P = 0, OCF_CON, OCF_INTROSPECTION_WK, OCF_INTROSPECTION_DATA,
  OCF_RES, OCF_MNT, OCF_COAPCLOUDCONF, OCF_SW_UPDATE,
  OCF_SEC_DOXM, OCF_SEC_PSTAT, OCF_SEC_ACL, OCF_SEC_CRED,
  OCF_SEC_SP, OCF_SEC_CSR, OCF_SEC_ROLES, OCF_D
}
 
enum  oc_event_callback_retval_t { OC_EVENT_DONE = 0, OC_EVENT_CONTINUE }
 
enum  oc_interface_mask_t {
  OC_IF_BASELINE = 1 << 1, OC_IF_LL = 1 << 2, OC_IF_B = 1 << 3, OC_IF_R = 1 << 4,
  OC_IF_RW = 1 << 5, OC_IF_A = 1 << 6, OC_IF_S = 1 << 7, OC_IF_CREATE = 1 << 8
}
 
enum  oc_method_t { OC_GET = 1, OC_POST, OC_PUT, OC_DELETE }
 
enum  oc_resource_properties_t { OC_DISCOVERABLE = (1 << 0), OC_OBSERVABLE = (1 << 1), OC_SECURE = (1 << 4), OC_PERIODIC = (1 << 6) }
 
enum  oc_status_t {
  OC_STATUS_OK = 0, OC_STATUS_CREATED, OC_STATUS_CHANGED, OC_STATUS_DELETED,
  OC_STATUS_NOT_MODIFIED, OC_STATUS_BAD_REQUEST, OC_STATUS_UNAUTHORIZED, OC_STATUS_BAD_OPTION,
  OC_STATUS_FORBIDDEN, OC_STATUS_NOT_FOUND, OC_STATUS_METHOD_NOT_ALLOWED, OC_STATUS_NOT_ACCEPTABLE,
  OC_STATUS_REQUEST_ENTITY_TOO_LARGE, OC_STATUS_UNSUPPORTED_MEDIA_TYPE, OC_STATUS_INTERNAL_SERVER_ERROR, OC_STATUS_NOT_IMPLEMENTED,
  OC_STATUS_BAD_GATEWAY, OC_STATUS_SERVICE_UNAVAILABLE, OC_STATUS_GATEWAY_TIMEOUT, OC_STATUS_PROXYING_NOT_SUPPORTED,
  __NUM_OC_STATUS_CODES__, OC_IGNORE, OC_PING_TIMEOUT
}
 

Functions

bool oc_ri_add_resource (oc_resource_t *resource)
 
void oc_ri_add_timed_event_callback_ticks (void *cb_data, oc_trigger_t event_callback, oc_clock_time_t ticks)
 
oc_resource_t * oc_ri_alloc_resource (void)
 
bool oc_ri_delete_resource (oc_resource_t *resource)
 
void oc_ri_free_resource_properties (oc_resource_t *resource)
 
oc_resource_t * oc_ri_get_app_resource_by_uri (const char *uri, size_t uri_len, size_t device)
 
oc_resource_t * oc_ri_get_app_resources (void)
 
oc_interface_mask_t oc_ri_get_interface_mask (char *iface, size_t if_len)
 
int oc_ri_get_query_nth_key_value (const char *query, size_t query_len, char **key, size_t *key_len, char **value, size_t *value_len, size_t n)
 
int oc_ri_get_query_value (const char *query, size_t query_len, const char *key, char **value)
 
void oc_ri_init (void)
 
void oc_ri_remove_timed_event_callback (void *cb_data, oc_trigger_t event_callback)
 
void oc_ri_shutdown (void)
 
int oc_status_code (oc_status_t key)
 

Macro Definition Documentation

◆ oc_ri_add_timed_event_callback_seconds

#define oc_ri_add_timed_event_callback_seconds (   cb_data,
  event_callback,
  seconds 
)
Value:
do { \
oc_ri_add_timed_event_callback_ticks( \
cb_data, event_callback, \
(oc_clock_time_t)seconds *(oc_clock_time_t)OC_CLOCK_SECOND); \
} while (0)