Use CoAP over the UDP transport protocol, with optional reliability. More...
Use CoAP over the UDP transport protocol, with optional reliability.
Module. Specify USEMODULE += unicoap_driver_udp in your application's Makefile.
To change the UDP port unicoap is listening on, modify CONFIG_UNICOAP_UDP_PORT. The CoAP over UDP driver uses the same socket both for client and server functionality.
This is the dependency graph of this driver:
Sockets | |
| sock_udp_t * | unicoap_transport_udp_get_socket (void) |
| Returns the internal UDP socket. | |
| int | unicoap_transport_udp_add_socket (sock_udp_t *socket, sock_udp_ep_t *local) |
| Adds UDP socket for client and server functionality. | |
| int | unicoap_transport_udp_remove_socket (sock_udp_t *socket) |
| Removes UDP socket previously added manually. | |
| sock_dtls_t * | unicoap_transport_dtls_get_socket (void) |
| Returns the internal DTLS socket. | |
| int | unicoap_transport_dtls_add_socket (sock_dtls_t *socket, sock_udp_t *base_socket, sock_udp_ep_t *local) |
| Adds DTLS socket for client and server functionality. | |
| int | unicoap_transport_dtls_remove_socket (sock_dtls_t *socket) |
| Removes DTLS socket previously added manually. | |
Ports | |
| #define | CONFIG_UNICOAP_UDP_PORT UNICOAP_DEFAULT_COAP_PORT |
| UDP port. | |
| #define CONFIG_UNICOAP_UDP_PORT UNICOAP_DEFAULT_COAP_PORT |
| int unicoap_transport_dtls_add_socket | ( | sock_dtls_t * | socket, |
| sock_udp_t * | base_socket, | ||
| sock_udp_ep_t * | local ) |
Adds DTLS socket for client and server functionality.
| [in,out] | socket | Pre-allocated socket to use |
| [in,out] | base_socket | Pre-allocated UDP base socket to use |
| [in] | local | Initialized endpoint, does not need to outlive this function call |
You can call this function at any time after unicoap has been initialized.
0 on success or negative error value otherwise. The error value depends on the DTLS implementation. | int unicoap_transport_dtls_remove_socket | ( | sock_dtls_t * | socket | ) |
Removes DTLS socket previously added manually.
| [in,out] | socket | The socket pointer you have previously passed to unicoap_transport_dtls_add_socket |
0, indicating a success. Future versions of this API may return a negative error. | int unicoap_transport_udp_add_socket | ( | sock_udp_t * | socket, |
| sock_udp_ep_t * | local ) |
Adds UDP socket for client and server functionality.
socket must be pre-allocated and must remain allocated until the UDP driver has been deinitialized or the socket is closed by you.| [in,out] | socket | Pre-allocated socket to use |
| [in] | local | Initialized endpoint, does not need to outlive this function call |
You can call this function at any time after unicoap has been initialized.
0 on success or negative error value otherwise. | int unicoap_transport_udp_remove_socket | ( | sock_udp_t * | socket | ) |
Removes UDP socket previously added manually.
| [in,out] | socket | The socket pointer you have previously passed to unicoap_transport_udp_add_socket |
0, indicating a success. Future versions of this API may return a negative error.