nanocoap_sock.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
3  * 2018 Inria
4  * 2018 Freie Universität Berlin
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
129 #ifndef NET_NANOCOAP_SOCK_H
130 #define NET_NANOCOAP_SOCK_H
131 
132 #include <stdint.h>
133 #include <unistd.h>
134 
135 #include "net/nanocoap.h"
136 #include "net/sock/udp.h"
137 
138 #ifdef __cplusplus
139 extern "C" {
140 #endif
141 
154 int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize);
155 
167 ssize_t nanocoap_get(sock_udp_ep_t *remote, const char *path, uint8_t *buf,
168  size_t len);
169 
183 ssize_t nanocoap_request(coap_pkt_t *pkt, sock_udp_ep_t *local,
184  sock_udp_ep_t *remote, size_t len);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 #endif /* NET_NANOCOAP_SOCK_H */
190 
nanocoap.h
nanocoap API
udp.h
UDP sock definitions.
nanocoap_request
ssize_t nanocoap_request(coap_pkt_t *pkt, sock_udp_ep_t *local, sock_udp_ep_t *remote, size_t len)
Simple synchronous CoAP request.
_sock_tl_ep
Common IP-based transport layer end point.
Definition: sock.h:213
nanocoap_get
ssize_t nanocoap_get(sock_udp_ep_t *remote, const char *path, uint8_t *buf, size_t len)
Simple synchronous CoAP (confirmable) get.
nanocoap_server
int nanocoap_server(sock_udp_ep_t *local, uint8_t *buf, size_t bufsize)
Start a nanocoap server instance.
coap_pkt_t
CoAP PDU parsing context structure.
Definition: nanocoap.h:185