1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
* coap_subscribe_internal.h -- Structures, Enums & Functions that are not
* exposed to application programming
*
* Copyright (C) 2010-2022 Olaf Bergmann <bergmann@tzi.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
/**
* @file coap_subscribe_internal.h
* @brief CoAP subscribe internal information
*/
/**
* @ingroup internal_api
* @defgroup subscribe_internal Observe Subscription
* Internal API for handling CoAP Observe Subscriptions (RFC7641)
* @{
*/
/**
* Number of notifications that may be sent non-confirmable before a confirmable
* message is sent to detect if observers are alive. The maximum allowed value
* here is @c 255.
*/
/* COAP_OBS_MAX_NON */
/* COAP_OBS_MAX_NON > 255 */
/**
* Number of different confirmable notifications that may fail (i.e. those
* that have hit MAX_RETRANSMIT multiple times) before an observer is removed.
* The maximum value for COAP_OBS_MAX_FAIL is @c 255.
*/
/* COAP_OBS_MAX_FAIL */
/* COAP_OBS_MAX_FAIL > 255 */
/** Subscriber information */
;
void ;
/**
* Handles a failed observe notify.
*
* @param context The context holding the resource.
* @param session The session that the observe notify failed on.
* @param token The token used when the observe notify failed.
*/
void
;
/**
* Checks all known resources to see if they are dirty and then notifies
* subscribed observers.
*
* @param context The context to check for dirty resources.
*/
void ;
/**
* Adds the specified peer as observer for @p resource. The subscription is
* identified by the given @p token. This function returns the registered
* subscription information if the @p observer has been added, or @c NULL on
* error.
*
* @param resource The observed resource.
* @param session The observer's session
* @param token The token that identifies this subscription.
* @param pdu The requesting pdu.
*
* @return A pointer to the added/updated subscription
* information or @c NULL on error.
*/
coap_subscription_t *;
/**
* Returns a subscription object for given @p peer.
*
* @param resource The observed resource.
* @param session The observer's session
* @param token The token that identifies this subscription or @c NULL for
* any token.
* @return A valid subscription if exists or @c NULL otherwise.
*/
coap_subscription_t *;
/**
* Flags that data is ready to be sent to observers.
*
* @param context The CoAP context to use.
* @param session The observer's session
* @param token The corresponding token that has been used for the
* subscription.
*/
void ;
/**
* Removes any subscription for @p observer from @p resource and releases the
* allocated storage. The result is @c 1 if an observation relationship with @p
* observer and @p token existed, @c 0 otherwise.
*
* @param resource The observed resource.
* @param session The observer's session.
* @param token The token that identifies this subscription or @c NULL for
* any token.
* @return @c 1 if the observer has been deleted, @c 0 otherwise.
*/
int ;
/**
* Removes any subscription for @p session and releases the allocated storage.
*
* @param context The CoAP context to use.
* @param session The observer's session.
*/
void ;
/** @} */
/* COAP_SERVER_SUPPORT */
/* COAP_SUBSCRIBE_INTERNAL_H_ */