11 #ifndef _COAP_SUBSCRIBE_H_
12 #define _COAP_SUBSCRIBE_H_
22 #ifndef COAP_OBS_MAX_NON
28 #define COAP_OBS_MAX_NON 5
31 #ifndef COAP_OBS_MAX_FAIL
37 #define COAP_OBS_MAX_FAIL 3
68 #define COAP_INVALID_HASHKEY ((coap_key_t)-1)
74 unsigned char mediatype;
76 unsigned int writable:1;
79 unsigned char etag[4];
98 int (*data)(
coap_uri_t *
uri,
unsigned char *mediatype,
unsigned int offset,
unsigned char *buf,
unsigned int *buflen,
int *finished);
106 coap_address_t subscriber;
111 #define COAP_RESOURCE(node) ((coap_resource_t *)(node)->data)
112 #define COAP_SUBSCRIPTION(node) ((coap_subscription_t *)(node)->data)
139 const struct sockaddr *subscriber,
169 struct sockaddr *subscriber,
180 struct sockaddr *subscriber);
Representation of parsed URI.
unsigned char coap_key_t[4]
int coap_delete_resource(coap_context_t *context, coap_key_t key)
Deletes a resource identified by key.
struct coap_subscription_t * next
next element in linked list
size_t token_length
actual length of token
struct coap_subscription_t coap_subscription_t
Subscriber information.
representation of network addresses
void coap_add_resource(coap_context_t *context, coap_resource_t *resource)
Registers the given resource for context.
unsigned int non_cnt
up to 15 non-confirmable notifies allowed
struct coap_resource_t coap_resource_t
unsigned int dirty
set if the notification temporarily could not be sent (in that case, the resource's partiallydirty fl...
unsigned int fail_cnt
up to 3 confirmable notifies can fail
unsigned char token[8]
token used for subscription
void coap_subscription_init(coap_subscription_t *)
unsigned int non
send non-confirmable notifies if 1
coap_address_t subscriber
address and port of subscriber
The CoAP stack's global state is stored in a coap_context_t object.
coap_resource_t * coap_get_resource_from_key(coap_context_t *context, coap_key_t key)
Returns the resource identified by the unique string key.