mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 18:13:49 +01:00
fixed insconsistencies in the doc for sock
fixed insconsistency concerning headers needed fixed insconsistency concerning headers needed fixed insconsistency concerning headers needed
This commit is contained in:
parent
e054ae85d3
commit
cab947b05a
@ -63,13 +63,11 @@
|
|||||||
* implementation (e.g. `gnrc_ipv6_default` for @ref net_gnrc GNRC) and at least
|
* implementation (e.g. `gnrc_ipv6_default` for @ref net_gnrc GNRC) and at least
|
||||||
* one network device.
|
* one network device.
|
||||||
*
|
*
|
||||||
* After including header files for the @ref net_af "address families" and
|
* After including the header file for @ref net_sock_udp "UDP sock", we create some
|
||||||
* the @ref net_sock_udp "UDP `sock`s" themselves, we create some buffer space
|
* buffer space `buf` to store the data received by the server:
|
||||||
* `buf` to store the data received by the server:
|
|
||||||
*
|
*
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.c}
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.c}
|
||||||
* #include "net/af.h"
|
* #include "net/sock/udp.h"
|
||||||
* #include "net/sock/ip.h"
|
|
||||||
*
|
*
|
||||||
* uint8_t buf[128];
|
* uint8_t buf[128];
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -167,7 +165,7 @@
|
|||||||
* IPV6_ADDR_MCAST_SCP_LINK_LOCAL);
|
* IPV6_ADDR_MCAST_SCP_LINK_LOCAL);
|
||||||
* if (sock_udp_send(&sock, "Hello!", sizeof("Hello!"), &remote) < 0) {
|
* if (sock_udp_send(&sock, "Hello!", sizeof("Hello!"), &remote) < 0) {
|
||||||
* puts("Error sending message");
|
* puts("Error sending message");
|
||||||
* sock_udp_close();
|
* sock_udp_close(&sock);
|
||||||
* return 1;
|
* return 1;
|
||||||
* }
|
* }
|
||||||
* if ((res = sock_udp_recv(&sock, buf, sizeof(buf), 1 * SEC_IN_USEC,
|
* if ((res = sock_udp_recv(&sock, buf, sizeof(buf), 1 * SEC_IN_USEC,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user