IoTivity-Lite
oc_client_state.h File Reference
#include "messaging/coap/constants.h"
#include "oc_config.h"
#include "oc_endpoint.h"
#include "oc_ri.h"
#include "util/oc_compiler.h"
#include "util/oc_features.h"
#include "messaging/coap/oc_coap.h"
#include <stdbool.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, const 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, const 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_toc_ri_alloc_client_cb (const char *uri, const 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_toc_ri_find_client_cb_by_mid (uint16_t mid)
 find the client callback info by message id (mid) More...
 
oc_client_cb_toc_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 with code OC_CANCELLED More...
 
void oc_ri_free_client_cbs_by_endpoint_v1 (const oc_endpoint_t *endpoint, oc_status_t code)
 free the client callback information by endpoint with a specific code More...
 
void oc_ri_free_client_cbs_by_mid (uint16_t mid)
 free the client callback infomation by message id (mid) with code OC_CANCELLED More...
 
void oc_ri_free_client_cbs_by_mid_v1 (uint16_t mid, oc_status_t code)
 free the client callback infomation by message id (mid) More...
 
oc_client_cb_toc_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_is_client_cb_valid (const oc_client_cb_t *client_cb)
 is the client callback information valid More...
 

Typedef Documentation

◆ oc_client_cb_t

client callback information

◆ oc_client_handler_t

client handler information

◆ oc_discovery_all_handler_t

typedef oc_discovery_flags_t(* oc_discovery_all_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, const oc_endpoint_t *, oc_resource_properties_t, bool, void *)

discovery_all handler

◆ oc_discovery_handler_t

typedef oc_discovery_flags_t(* oc_discovery_handler_t) (const char *, const char *, oc_string_array_t, oc_interface_mask_t, const oc_endpoint_t *, oc_resource_properties_t, void *)

discovery handler

◆ oc_response_handler_t

typedef void(* oc_response_handler_t) (oc_client_response_t *)

client response handler

Enumeration Type Documentation

◆ oc_discovery_flags_t

discovery flags

Enumerator
OC_STOP_DISCOVERY 

stop discovering (also no more data)

OC_CONTINUE_DISCOVERY 

continue discovering (more data)

◆ oc_qos_t

enum oc_qos_t

Quality of Service.

Enumerator
HIGH_QOS 

confirmable messages

LOW_QOS 

non-confirmable messages

Function Documentation

◆ oc_ri_alloc_client_cb()

oc_client_cb_t* oc_ri_alloc_client_cb ( const char *  uri,
const 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

Parameters
urithe uri to be called (cannot be NULL)
endpointthe endpoint of the device
methodmethod to be used
querythe query params to be used
handlerthe callback when data arrives
qosquality of service level
user_datauser data to be provided with the invocation of the callback
Returns
oc_client_cb_t* the client callback info

◆ oc_ri_find_client_cb_by_mid()

oc_client_cb_t* oc_ri_find_client_cb_by_mid ( uint16_t  mid)

find the client callback info by message id (mid)

Parameters
midthe message id
Returns
oc_client_cb_t* the client callback info

◆ oc_ri_find_client_cb_by_token()

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

Parameters
tokenthe token (cannot be NULL)
token_lenthe token lenght
Returns
oc_client_cb_t* the client callback info

◆ oc_ri_free_client_cbs_by_endpoint()

void oc_ri_free_client_cbs_by_endpoint ( const oc_endpoint_t endpoint)

free the client callback information by endpoint with code OC_CANCELLED

Deprecated:
replaced by oc_ri_free_client_cbs_by_endpoint_v1 in v2.2.5.4
Parameters
endpointthe endpoint

◆ oc_ri_free_client_cbs_by_endpoint_v1()

void oc_ri_free_client_cbs_by_endpoint_v1 ( const oc_endpoint_t endpoint,
oc_status_t  code 
)

free the client callback information by endpoint with a specific code

Parameters
endpointthe endpoint
codethe propagated code to client callback

◆ oc_ri_free_client_cbs_by_mid()

void oc_ri_free_client_cbs_by_mid ( uint16_t  mid)

free the client callback infomation by message id (mid) with code OC_CANCELLED

Deprecated:
replaced by oc_ri_free_client_cbs_by_mid_v1 in v2.2.5.4
Parameters
midthe message id

◆ oc_ri_free_client_cbs_by_mid_v1()

void oc_ri_free_client_cbs_by_mid_v1 ( uint16_t  mid,
oc_status_t  code 
)

free the client callback infomation by message id (mid)

Parameters
midthe message id
codethe propagated code to client callback

◆ oc_ri_get_client_cb()

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

Parameters
urithe uri for the callback (cannot be NULL)
endpointthe endpoint for the callback
methodthe used method
Returns
oc_client_cb_t* the client callback info

◆ oc_ri_is_client_cb_valid()

bool oc_ri_is_client_cb_valid ( const oc_client_cb_t client_cb)

is the client callback information valid

Parameters
client_cbthe client callback information
Returns
true is correct
false is incomplete