libcoap  4.1.2
subscribe.h
Go to the documentation of this file.
1 /*
2  * subscribe.h -- subscription handling for CoAP
3  * see draft-ietf-core-observe-16
4  *
5  * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann <bergmann@tzi.org>
6  *
7  * This file is part of the CoAP library libcoap. Please see README for terms
8  * of use.
9  */
10 
11 
12 #ifndef _COAP_SUBSCRIBE_H_
13 #define _COAP_SUBSCRIBE_H_
14 
15 #include "address.h"
16 #include "coap_io.h"
17 
27 #define COAP_OBSERVE_ESTABLISH 0
28 
33 #define COAP_OBSERVE_CANCEL 1
34 
35 #ifndef COAP_OBS_MAX_NON
36 
41 #define COAP_OBS_MAX_NON 5
42 #endif /* COAP_OBS_MAX_NON */
43 
44 #ifndef COAP_OBS_MAX_FAIL
45 
50 #define COAP_OBS_MAX_FAIL 3
51 #endif /* COAP_OBS_MAX_FAIL */
52 
54 typedef struct coap_subscription_t {
59  unsigned int non_cnt:4;
60  unsigned int fail_cnt:2;
61  unsigned int dirty:1;
64  size_t token_length;
65  unsigned char token[8];
67 
69 
72 #endif /* _COAP_SUBSCRIBE_H_ */
multi-purpose address abstraction
Definition: address.h:59
struct coap_subscription_t * next
next element in linked list
Definition: subscribe.h:55
Abstraction of virtual endpoint that can be attached to coap_context_t.
Definition: coap_io.h:35
size_t token_length
actual length of token
Definition: subscribe.h:64
struct coap_subscription_t coap_subscription_t
Subscriber information.
Representation of network addresses.
unsigned int non_cnt
up to 15 non-confirmable notifies allowed
Definition: subscribe.h:59
Subscriber information.
Definition: subscribe.h:54
unsigned int dirty
set if the notification temporarily could not be sent (in that case, the resource&#39;s partially dirty f...
Definition: subscribe.h:61
unsigned int fail_cnt
up to 3 confirmable notifies can fail
Definition: subscribe.h:60
unsigned char token[8]
token used for subscription
Definition: subscribe.h:65
coap_endpoint_t local_if
local communication interface
Definition: subscribe.h:56
void coap_subscription_init(coap_subscription_t *)
Definition: subscribe.c:20
coap_address_t subscriber
address and port of subscriber
Definition: subscribe.h:57