Skip to content

Commit

Permalink
samples: net: udp: Fix build with POSIX_API
Browse files Browse the repository at this point in the history
Supplicant now enables POSIX_API so we need to be able to build with
POSIX enabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
  • Loading branch information
rlubos committed Mar 7, 2024
1 parent 6d3f855 commit 847188c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/net/udp/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_IPV4=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y
CONFIG_NET_CONNECTION_MANAGER=y

# Heap and stacks
Expand Down
6 changes: 6 additions & 0 deletions samples/net/udp/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#include <zephyr/net/conn_mgr_connectivity.h>
#include <zephyr/net/conn_mgr_monitor.h>

#if defined(CONFIG_POSIX_API)
#include <zephyr/posix/arpa/inet.h>
#include <zephyr/posix/unistd.h>
#include <zephyr/posix/sys/socket.h>
#endif

LOG_MODULE_REGISTER(udp_sample, CONFIG_UDP_SAMPLE_LOG_LEVEL);

#define UDP_IP_HEADER_SIZE 28
Expand Down

0 comments on commit 847188c

Please sign in to comment.