zephyr/samples/net/sockets/sntp_client
Paul Sokolovsky 08be81d949 samples: sntp_client: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
..
boards samples: sockets: sntp_client: Add support for cc3220sf_launchxl 2019-04-19 13:54:21 -05:00
src samples: sntp_client: Switch from sntp_request() to sntp_query() 2019-05-11 13:25:58 +03:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
README.rst
prj.conf samples: sntp_client: Elaborate sample to workable state 2019-04-24 12:50:12 +03:00
sample.yaml samples: add test identifier 2019-03-29 17:44:11 -04:00

README.rst

.. _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