libcoap  4.2.0
subscribe.h
Go to the documentation of this file.
1 /*
2  * subscribe.h -- subscription handling for CoAP
3  * see RFC7641
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 #include "block.h"
18 
29 #define COAP_OBSERVE_ESTABLISH 0
30 
35 #define COAP_OBSERVE_CANCEL 1
36 
37 #ifndef COAP_OBS_MAX_NON
38 
43 #define COAP_OBS_MAX_NON 5
44 #endif /* COAP_OBS_MAX_NON */
45 
46 #ifndef COAP_OBS_MAX_FAIL
47 
52 #define COAP_OBS_MAX_FAIL 3
53 #endif /* COAP_OBS_MAX_FAIL */
54 
56 typedef struct coap_subscription_t {
60  unsigned int non_cnt:4;
61  unsigned int fail_cnt:2;
62  unsigned int dirty:1;
65  unsigned int has_block2:1;
67  size_t token_length;
68  unsigned char token[8];
71 
73 
76 #endif /* COAP_SUBSCRIBE_H_ */
struct coap_subscription_t * next
next element in linked list
Definition: subscribe.h:57
Coap string data definition.
Definition: str.h:25
size_t token_length
actual length of token
Definition: subscribe.h:67
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:60
coap_block_t block2
GET request Block2 definition.
Definition: subscribe.h:66
Subscriber information.
Definition: subscribe.h:56
Structure of Block options.
Definition: block.h:36
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:62
coap_session_t * session
subscriber session
Definition: subscribe.h:58
unsigned int has_block2
GET request had Block2 definition.
Definition: subscribe.h:65
coap_string_t * query
query string used for subscription, if any
Definition: subscribe.h:69
unsigned int fail_cnt
up to 3 confirmable notifies can fail
Definition: subscribe.h:61
unsigned char token[8]
token used for subscription
Definition: subscribe.h:68
void coap_subscription_init(coap_subscription_t *)
Definition: subscribe.c:20