• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// -*- mode:doc; -*-
2// vim: set syntax=asciidoc tw=0
3
4coap_deprecated(3)
5==================
6:doctype: manpage
7:man source:   coap_deprecated
8:man version:  @PACKAGE_VERSION@
9:man manual:   libcoap Manual
10
11NAME
12----
13coap_deprecated,
14coap_clear_event_handler,
15coap_context_set_psk,
16coap_encode_var_bytes,
17coap_new_client_session_psk,
18coap_option_clrb,
19coap_option_getb,
20coap_option_setb,
21coap_read,
22coap_register_handler,
23coap_resource_set_dirty,
24coap_run_once,
25coap_set_event_handler,
26coap_write
27- Work with CoAP deprecated functions
28
29SYNOPSIS
30--------
31*#include <coap@LIBCOAP_API_VERSION@/coap.h>*
32
33*void coap_clear_event_handler(coap_context_t *_context_);*
34
35*int coap_context_set_psk(coap_context_t *_context_, const char *_hint_,
36const uint8_t *_key_, size_t _key_len_);*
37
38*int coap_encode_var_bytes(uint8_t *_buffer_, unsigned int _value_);*
39
40*coap_session_t *coap_new_client_session_psk(coap_context_t *_context_,
41const coap_address_t *_local_if_, const coap_address_t *_server_,
42coap_proto_t _proto_, const char *_identity_, const uint8_t *_key_,
43unsigned _key_len_);*
44
45*int coap_option_clrb(coap_opt_filter_t *_filter_, uint16_t _type_);*
46
47*int coap_option_getb(coap_opt_filter_t *_filter_, uint16_t _type_);*
48
49*int coap_option_setb(coap_opt_filter_t *_filter_, uint16_t _type_);*
50
51*void coap_read(coap_context_t *_context_, coap_tick_t _now_);*
52
53*void coap_register_handler(coap_resource_t *_resource_,
54coap_request_t _method_, coap_method_handler_t _handler_);*
55
56*int coap_resource_set_dirty(coap_resource_t *_resource_,
57const coap_string_t *_query_);*
58
59*int coap_run_once(coap_context_t *_context_, uint32_t _timeout_ms_);*
60
61*void coap_set_event_handler(coap_context_t *_context_,
62coap_event_handler_t _handler_);*
63
64*unsigned int coap_write(coap_context_t *_context_, coap_socket_t *_sockets_[],
65unsigned int _max_sockets_, unsigned int *_num_sockets_, coap_tick_t _now_);*
66
67For specific (D)TLS library support, link with
68*-lcoap-@LIBCOAP_API_VERSION@-notls*, *-lcoap-@LIBCOAP_API_VERSION@-gnutls*,
69*-lcoap-@LIBCOAP_API_VERSION@-openssl*, *-lcoap-@LIBCOAP_API_VERSION@-mbedtls*
70or *-lcoap-@LIBCOAP_API_VERSION@-tinydtls*.   Otherwise, link with
71*-lcoap-@LIBCOAP_API_VERSION@* to get the default (D)TLS library support.
72
73DESCRIPTION
74-----------
75
76Several of the existing CoAP API functions have been deprecated.  These are
77listed here, along with the functions that should now be used instead.
78
79FUNCTIONS
80---------
81
82*Function: coap_clear_event_handler()*
83
84The *coap_clear_event_handler*() function is replaced by
85*coap_register_event_handler*(3), using NULL for _handler_.
86
87*Function: coap_context_set_psk()*
88
89The *coap_context_set_psk*() function is replaced by
90*coap_context_set_psk2*(3) which gives additional PSK configuration capability
91by the use of the coap_dtls_spsk_t structure.
92
93*Function: coap_encode_var_bytes()*
94
95The *coap_encode_var_bytes*() function is replaced by
96*coap_encode_var_safe*(3).
97
98*Function: coap_new_client_session_psk()*
99
100The *coap_new_client_session_psk*() function is replaced by
101*coap_new_client_session_psk2*(3) which gives additional PSK configuration capability
102by the use of the coap_dtls_cpsk_t structure.
103
104*Function: coap_option_clrb()*
105
106The *coap_option_clrb*() function is replaced by
107*coap_option_filter_unset*(3).
108
109*Function: coap_option_getb()*
110
111The *coap_option_getb*() function is replaced by
112*coap_option_filter_get*(3).
113
114*Function: coap_option_setb()*
115
116The *coap_option_setb*() function is replaced by
117*coap_option_filter_set*(3).
118
119*Function: coap_read()*
120
121The *coap_read*() function is replaced by
122*coap_io_do_io*(3).
123
124*Function: coap_register_handler()*
125
126The *coap_register_handler*() function is replaced by
127*coap_register_request_handler*(3).
128
129*Function: coap_resource_set_dirty()*
130
131The *coap_resource_set_dirty*() function is replaced by
132*coap_resource_notify_observers*(3).
133
134*Function: coap_run_once()*
135
136The *coap_run_once*() function is replaced by
137*coap_io_process*(3).
138
139*Function: coap_set_event_handler()*
140
141The *coap_set_event_handler*() function is replaced by
142*coap_register_event_handler*(3).
143
144*Function: coap_clear_event_handler()*
145
146The *coap_write*() function is replaced by
147*coap_io_prepare_io*(3).
148
149RETURN VALUES
150-------------
151*coap_context_set_psk*() returns 1 if success, 0 on failure.
152
153*coap_encode_var_bytes*() returns either the length of bytes encoded (which can
154be 0 when encoding 0) or 0 on failure.
155
156*coap_new_client_session_psk*() returns a new session if success, NULL on
157failure.
158
159*coap_option_clrb*() returns  1 if bit was set, -1 otherwise.
160
161*coap_option_getb*() returns  1 if bit was set, 0 if not.
162
163*coap_option_setb*() returns  1 if bit was set, -1 otherwise.
164
165*coap_resource_set_dirty*() returns 1 if success, 0 on failure.
166
167*coap_run_once*() returns number of milliseconds spent in function or -1
168if there was an error.
169
170*coap_write*() returns the number of milli-seconds that need to be waited
171before the function should next be called.
172
173SEE ALSO
174--------
175*coap_endpoint_client*(3), *coap_endpoint_server*(3), *coap_handler*(3),
176*coap_io*(3), *coap_observe*(3), *coap_pdu_access*(3) and *coap_pdu_setup*(3).
177
178FURTHER INFORMATION
179-------------------
180See
181
182"https://rfc-editor.org/rfc/rfc7252[RFC7252: The Constrained Application Protocol (CoAP)]"
183
184for further information.
185
186BUGS
187----
188Please report bugs on the mailing list for libcoap:
189libcoap-developers@lists.sourceforge.net or raise an issue on GitHub at
190https://github.com/obgm/libcoap/issues
191
192AUTHORS
193-------
194The libcoap project <libcoap-developers@lists.sourceforge.net>
195