1COAP_DEPRECATED(3)              libcoap Manual              COAP_DEPRECATED(3)
2
3
4

NAME

6       coap_deprecated, coap_clear_event_handler, coap_context_set_psk,
7       coap_encode_var_bytes, coap_new_client_session_psk, coap_option_clrb,
8       coap_option_getb, coap_option_setb, coap_read, coap_register_handler,
9       coap_resource_set_dirty, coap_run_once, coap_set_event_handler,
10       coap_write - Work with CoAP deprecated functions
11

SYNOPSIS

13       #include <coap3/coap.h>
14
15       void coap_clear_event_handler(coap_context_t *context);
16
17       int coap_context_set_psk(coap_context_t *context, const char *hint,
18       const uint8_t *key, size_t key_len);
19
20       int coap_encode_var_bytes(uint8_t *buffer, unsigned int value);
21
22       coap_session_t *coap_new_client_session_psk(coap_context_t *context,
23       const coap_address_t *local_if, const coap_address_t *server,
24       coap_proto_t proto, const char *identity, const uint8_t *key, unsigned
25       key_len);
26
27       int coap_option_clrb(coap_opt_filter_t *filter, uint16_t type);
28
29       int coap_option_getb(coap_opt_filter_t *filter, uint16_t type);
30
31       int coap_option_setb(coap_opt_filter_t *filter, uint16_t type);
32
33       void coap_read(coap_context_t *context, coap_tick_t now);
34
35       void coap_register_handler(coap_resource_t *resource, coap_request_t
36       method, coap_method_handler_t handler);
37
38       int coap_resource_set_dirty(coap_resource_t *resource, const
39       coap_string_t *query);
40
41       int coap_run_once(coap_context_t *context, uint32_t timeout_ms);
42
43       void coap_set_event_handler(coap_context_t *context,
44       coap_event_handler_t handler);
45
46       unsigned int coap_write(coap_context_t *context, coap_socket_t
47       *sockets[], unsigned int max_sockets, unsigned int *num_sockets,
48       coap_tick_t now);
49
50       For specific (D)TLS library support, link with -lcoap-3-notls,
51       -lcoap-3-gnutls, -lcoap-3-openssl, -lcoap-3-mbedtls or
52       -lcoap-3-tinydtls. Otherwise, link with -lcoap-3 to get the default
53       (D)TLS library support.
54

DESCRIPTION

56       Several of the existing CoAP API functions have been deprecated. These
57       are listed here, along with the functions that should now be used
58       instead.
59

FUNCTIONS

61       Function: coap_clear_event_handler()
62
63       The coap_clear_event_handler() function is replaced by
64       coap_register_event_handler(3), using NULL for handler.
65
66       Function: coap_context_set_psk()
67
68       The coap_context_set_psk() function is replaced by
69       coap_context_set_psk2(3) which gives additional PSK configuration
70       capability by the use of the coap_dtls_spsk_t structure.
71
72       Function: coap_encode_var_bytes()
73
74       The coap_encode_var_bytes() function is replaced by
75       coap_encode_var_safe(3).
76
77       Function: coap_new_client_session_psk()
78
79       The coap_new_client_session_psk() function is replaced by
80       coap_new_client_session_psk2(3) which gives additional PSK
81       configuration capability by the use of the coap_dtls_cpsk_t structure.
82
83       Function: coap_option_clrb()
84
85       The coap_option_clrb() function is replaced by
86       coap_option_filter_unset(3).
87
88       Function: coap_option_getb()
89
90       The coap_option_getb() function is replaced by
91       coap_option_filter_get(3).
92
93       Function: coap_option_setb()
94
95       The coap_option_setb() function is replaced by
96       coap_option_filter_set(3).
97
98       Function: coap_read()
99
100       The coap_read() function is replaced by coap_io_do_io(3).
101
102       Function: coap_register_handler()
103
104       The coap_register_handler() function is replaced by
105       coap_register_request_handler(3).
106
107       Function: coap_resource_set_dirty()
108
109       The coap_resource_set_dirty() function is replaced by
110       coap_resource_notify_observers(3).
111
112       Function: coap_run_once()
113
114       The coap_run_once() function is replaced by coap_io_process(3).
115
116       Function: coap_set_event_handler()
117
118       The coap_set_event_handler() function is replaced by
119       coap_register_event_handler(3).
120
121       Function: coap_clear_event_handler()
122
123       The coap_write() function is replaced by coap_io_prepare_io(3).
124

RETURN VALUES

126       coap_context_set_psk() returns 1 if success, 0 on failure.
127
128       coap_encode_var_bytes() returns either the length of bytes encoded
129       (which can be 0 when encoding 0) or 0 on failure.
130
131       coap_new_client_session_psk() returns a new session if success, NULL on
132       failure.
133
134       coap_option_clrb() returns 1 if bit was set, -1 otherwise.
135
136       coap_option_getb() returns 1 if bit was set, 0 if not.
137
138       coap_option_setb() returns 1 if bit was set, -1 otherwise.
139
140       coap_resource_set_dirty() returns 1 if success, 0 on failure.
141
142       coap_run_once() returns number of milliseconds spent in function or -1
143       if there was an error.
144
145       coap_write() returns the number of milli-seconds that need to be waited
146       before the function should next be called.
147

SEE ALSO

149       coap_endpoint_client(3), coap_endpoint_server(3), coap_handler(3),
150       coap_io(3), coap_observe(3), coap_pdu_access(3) and coap_pdu_setup(3).
151

FURTHER INFORMATION

153       See
154
155       "RFC7252: The Constrained Application Protocol (CoAP)"
156
157       for further information.
158

BUGS

160       Please report bugs on the mailing list for libcoap:
161       libcoap-developers@lists.sourceforge.net or raise an issue on GitHub at
162       https://github.com/obgm/libcoap/issues
163

AUTHORS

165       The libcoap project <libcoap-developers@lists.sourceforge.net>
166
167
168
169coap_deprecated 4.3.4             10/09/2023                COAP_DEPRECATED(3)
Impressum