libcoap 4.3.5-develop-72190a8
Loading...
Searching...
No Matches
coap_subscribe.h File Reference

Defines the application visible subscribe information. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COAP_OBSERVE_ESTABLISH   0
 The value COAP_OBSERVE_ESTABLISH in a GET/FETCH request option COAP_OPTION_OBSERVE indicates a new observe relationship for (sender address, token) is requested.
 
#define COAP_OBSERVE_CANCEL   1
 The value COAP_OBSERVE_CANCEL in a GET/FETCH request option COAP_OPTION_OBSERVE indicates that the observe relationship for (sender address, token) must be cancelled.
 

Typedefs

typedef int(* coap_observe_added_t) (coap_session_t *session, coap_subscription_t *observe_key, coap_proto_t e_proto, coap_address_t *e_listen_addr, coap_addr_tuple_t *s_addr_info, coap_bin_const_t *raw_packet, coap_bin_const_t *oscore_info, void *user_data)
 Callback handler definition called when a new observe has been set up, as defined in coap_persist_track_funcs().
 
typedef int(* coap_observe_deleted_t) (coap_session_t *session, coap_subscription_t *observe_key, void *user_data)
 Callback handler definition called when an observe is being removed, as defined in coap_persist_track_funcs().
 
typedef int(* coap_track_observe_value_t) (coap_context_t *context, coap_str_const_t *resource_name, uint32_t observe_num, void *user_data)
 Callback handler definition called when an observe unsolicited response is being sent, as defined in coap_persist_track_funcs().
 
typedef int(* coap_dyn_resource_added_t) (coap_session_t *session, coap_str_const_t *resource_name, coap_bin_const_t *raw_packet, void *user_data)
 Callback handler definition called when a dynamic resource is getting created, as defined in coap_persist_track_funcs().
 
typedef int(* coap_resource_deleted_t) (coap_context_t *context, coap_str_const_t *resource_name, void *user_data)
 Callback handler definition called when resource is removed, as defined in coap_persist_track_funcs().
 

Functions

void coap_resource_set_get_observable (coap_resource_t *resource, int mode)
 Set whether a resource is observable.
 
COAP_API int coap_resource_notify_observers (coap_resource_t *resource, const coap_string_t *query)
 Initiate the sending of an Observe packet for all observers of resource, optionally matching query if not NULL.
 
COAP_API void coap_check_notify (coap_context_t *context)
 Checks all known resources to see if they are dirty and then notifies subscribed observers.
 
void coap_persist_track_funcs (coap_context_t *context, coap_observe_added_t observe_added, coap_observe_deleted_t observe_deleted, coap_track_observe_value_t track_observe_value, coap_dyn_resource_added_t dyn_resource_added, coap_resource_deleted_t resource_deleted, uint32_t save_freq, void *user_data)
 Set up callbacks to handle persist tracking so on a coap-server inadvertent restart, existing observe subscriptions can continue.
 
COAP_API coap_subscription_tcoap_persist_observe_add (coap_context_t *context, coap_proto_t e_proto, const coap_address_t *e_listen_addr, const coap_addr_tuple_t *s_addr_info, const coap_bin_const_t *raw_packet, const coap_bin_const_t *oscore_info)
 Set up an active subscription for an observe that was previously active over a coap-server inadvertant restart.
 
COAP_API int coap_persist_startup (coap_context_t *context, const char *dyn_resource_save_file, const char *observe_save_file, const char *obs_cnt_save_file, uint32_t save_freq)
 Start up persist tracking using the libcoap module.
 
COAP_API void coap_persist_stop (coap_context_t *context)
 Stop tracking persist information, leaving the current persist information in the files defined in coap_persist_startup().
 
void coap_persist_set_observe_num (coap_resource_t *resource, uint32_t observe_num)
 Sets the current observe number value.
 
COAP_API int coap_cancel_observe (coap_session_t *session, coap_binary_t *token, coap_pdu_type_t message_type)
 Cancel an observe that is being tracked by the client large receive logic.
 

Detailed Description

Defines the application visible subscribe information.

Definition in file coap_subscribe.h.