zephyr/samples/net/sockets/sntp_client
Hein Wessels 9ea250a445 samples: net: sockets: sntp_client: build for native_posix
Extend the sample to be built with native_posix
prevent issues like #57133 in the future. Also extends the qemu
build to build a "raw" configurationw without POSIX_API or
NET_SOCKETS_POSIX_NAMES.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-04-24 09:23:17 -04:00
..
boards
src net: sntp: support building without NET_SOCKETS_POSIX_NAMES 2023-04-24 09:23:17 -04:00
CMakeLists.txt
prj.conf samples: net: sockets: sntp_client: build for native_posix 2023-04-24 09:23:17 -04:00
README.rst
sample.yaml samples: net: sockets: sntp_client: build for native_posix 2023-04-24 09:23:17 -04:00

.. _sntp-client-sample:

SNTP client sample
##################

Overview
********

This sample is a simple SNTP client showing how to retrieve the current
time in seconds since 1st January 1970.

This demo assumes that the platform of choice has networking support,
some adjustments to the configuration may be needed. It also assumes
SNTP server is running on the host.

Building and Running
********************

When the application runs, it issues an SNTP request to the host and waits
for a response. When the response is received, the current epoch time, in
seconds, as well as the status code of the response (0 on success), is
printed.

See the `net-tools`_ project for more details.

This sample can be built and executed on QEMU or native_posix board as
described in :ref:`networking_with_qemu`.

.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools