IoTivity-Lite
|
#include "messaging/coap/constants.h"
#include "oc_endpoint.h"
#include "oc_ri.h"
#include <stdbool.h>
#include "oc_blockwise.h"
Data Structures | |
struct | oc_client_cb_t |
client callback information More... | |
struct | oc_client_handler_t |
client handler information More... | |
struct | oc_client_response_t |
Client response information. More... | |
Typedefs | |
typedef struct oc_client_cb_t | oc_client_cb_t |
client callback information More... | |
typedef struct oc_client_handler_t | oc_client_handler_t |
client handler information More... | |
typedef oc_discovery_flags_t(* | oc_discovery_all_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, oc_endpoint_t *, oc_resource_properties_t, bool, void *) |
discovery_all handler More... | |
typedef oc_discovery_flags_t(* | oc_discovery_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, oc_endpoint_t *, oc_resource_properties_t, void *) |
discovery handler More... | |
typedef void(* | oc_response_handler_t) (oc_client_response_t *) |
client response handler More... | |
Enumerations | |
enum | oc_discovery_flags_t { OC_STOP_DISCOVERY = 0 , OC_CONTINUE_DISCOVERY } |
discovery flags More... | |
enum | oc_qos_t { HIGH_QOS = 0 , LOW_QOS } |
Quality of Service. More... | |
Functions | |
oc_client_cb_t * | oc_ri_alloc_client_cb (const char *uri, oc_endpoint_t *endpoint, oc_method_t method, const char *query, oc_client_handler_t handler, oc_qos_t qos, void *user_data) |
allocate the client callback information More... | |
oc_client_cb_t * | oc_ri_find_client_cb_by_mid (uint16_t mid) |
find the client callback info by message id (mid) More... | |
oc_client_cb_t * | oc_ri_find_client_cb_by_token (const uint8_t *token, uint8_t token_len) |
find the client callback info by token More... | |
void | oc_ri_free_client_cbs_by_endpoint (const oc_endpoint_t *endpoint) |
free the client callback information by endpoint More... | |
void | oc_ri_free_client_cbs_by_mid (uint16_t mid) |
free the client callback infomation by message id (mid) More... | |
oc_client_cb_t * | oc_ri_get_client_cb (const char *uri, const oc_endpoint_t *endpoint, oc_method_t method) |
retrieve the client callback information More... | |
bool | oc_ri_invoke_client_cb (void *response, oc_blockwise_state_t **response_state, oc_client_cb_t *cb, oc_endpoint_t *endpoint) |
invoke the Client callback when a response is received More... | |
bool | oc_ri_is_client_cb_valid (const oc_client_cb_t *client_cb) |
is the client callback information valid More... | |
oc_discovery_flags_t | oc_ri_process_discovery_payload (uint8_t *payload, int len, oc_client_handler_t handler, oc_endpoint_t *endpoint, void *user_data) |
handle the discovery payload (e.g. More... | |
typedef struct oc_client_cb_t oc_client_cb_t |
client callback information
typedef struct oc_client_handler_t oc_client_handler_t |
client handler information
typedef oc_discovery_flags_t(* oc_discovery_all_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, oc_endpoint_t *, oc_resource_properties_t, bool, void *) |
discovery_all handler
typedef oc_discovery_flags_t(* oc_discovery_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, oc_endpoint_t *, oc_resource_properties_t, void *) |
discovery handler
typedef void(* oc_response_handler_t) (oc_client_response_t *) |
client response handler
enum oc_discovery_flags_t |
enum oc_qos_t |
oc_client_cb_t* oc_ri_alloc_client_cb | ( | const char * | uri, |
oc_endpoint_t * | endpoint, | ||
oc_method_t | method, | ||
const char * | query, | ||
oc_client_handler_t | handler, | ||
oc_qos_t | qos, | ||
void * | user_data | ||
) |
allocate the client callback information
uri | the uri to be called |
endpoint | the endpoint of the device |
method | method to be used |
query | the query params to be used |
handler | the callback when data arrives |
qos | quality of service level |
user_data | user data to be provided with the invocation of the callback |
oc_client_cb_t* oc_ri_find_client_cb_by_mid | ( | uint16_t | mid | ) |
find the client callback info by message id (mid)
mid | the message id |
oc_client_cb_t* oc_ri_find_client_cb_by_token | ( | const uint8_t * | token, |
uint8_t | token_len | ||
) |
find the client callback info by token
token | the token |
token_len | the token lenght |
void oc_ri_free_client_cbs_by_endpoint | ( | const oc_endpoint_t * | endpoint | ) |
free the client callback information by endpoint
endpoint | the endpoint |
void oc_ri_free_client_cbs_by_mid | ( | uint16_t | mid | ) |
free the client callback infomation by message id (mid)
mid | the message id |
oc_client_cb_t* oc_ri_get_client_cb | ( | const char * | uri, |
const oc_endpoint_t * | endpoint, | ||
oc_method_t | method | ||
) |
retrieve the client callback information
uri | the uri for the callback |
endpoint | the endpoint for the callback |
method | the used method |
bool oc_ri_invoke_client_cb | ( | void * | response, |
oc_blockwise_state_t ** | response_state, | ||
oc_client_cb_t * | cb, | ||
oc_endpoint_t * | endpoint | ||
) |
invoke the Client callback when a response is received
response | the response |
response_state | the state of the blockwise transfer |
cb | the callback |
endpoint | the endpoint |
bool oc_ri_is_client_cb_valid | ( | const oc_client_cb_t * | client_cb | ) |
is the client callback information valid
client_cb | the client callback information |
oc_discovery_flags_t oc_ri_process_discovery_payload | ( | uint8_t * | payload, |
int | len, | ||
oc_client_handler_t | handler, | ||
oc_endpoint_t * | endpoint, | ||
void * | user_data | ||
) |
handle the discovery payload (e.g.
parse the oic/res response and do the callbacks)
payload | the recieved discovery response |
len | lenght of the payload |
handler | handler of the discovery |
endpoint | endpoint |
user_data | the user data to be supplied to the handler |