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
/*
* coap_subscribe.h -- subscription handling for CoAP
* see RFC7641
*
* Copyright (C) 2010-2012,2014-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.h
* @brief Defines the application visible subscribe information
*/
/**
* @ingroup application_api
* @defgroup observe Resource Observation
* API for interfacing with the observe handling (RFC7641)
* @{
*/
/**
* 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.
*/
/**
* 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.
*/
/**
* Set whether a @p resource is observable. If the resource is observable
* and the client has set the COAP_OPTION_OBSERVE in a request packet, then
* whenever the state of the resource changes (a call to
* coap_resource_trigger_observe()), an Observer response will get sent.
*
* @param resource The CoAP resource to use.
* @param mode @c 1 if Observable is to be set, @c 0 otherwise.
*
*/
void ;
/**
* Initiate the sending of an Observe packet for all observers of @p resource,
* optionally matching @p query if not NULL
*
* @param resource The CoAP resource to use.
* @param query The Query to match against or NULL
*
* @return @c 1 if the Observe has been triggered, @c 0 otherwise.
*/
int
;
/** @} */
/* COAP_SUBSCRIBE_H_ */