ece552c644
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API registration. Including the following fixes from the review: * The fd returned by the socket accept call needs to be finalized, similar to how it is done for socket creation. * sl_RecvFrom() in TI SimpleLink Host driver does not support NULL pointers for 'from' address and address length, and sl_SendTo() does not ignore the destination address when in connection mode, so passing NULL would cause a failure. These issues have been reported to TI (CC3X20SDK-1970, CC3X20SDK-1971). Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case of NULL addresses. * simplelink_poll() should not process negative file descriptors in the fds array after sl_Selecti() returns. A negative fd value indicates that the entry is invalid and should be ignored. Signed-off-by: Vincent Wan <vincent.wan@linaro.org> Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no> |
||
---|---|---|
.. | ||
boards | ||
src | ||
CMakeLists.txt | ||
README.rst | ||
prj.conf | ||
sample.yaml |
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