mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 02:22:54 +03:00
If we correctly determine the presence of the sys/time.h and time.h files using the HAVE_TIME_H and HAVE_SYS_TIME_H macros, then the LWIP compilation will result in a duplicate function error. Perhaps previous versions of LWIP did not have these files, in which case everything would have worked correctly. These changes add the necessary ifdefs and keep the optimal timer function for LWIP. Adds missed #include <time.h> lines to examples and documentation. Adds the detection of the sys/select.h header to the CMake and autoconf.
Example of libcoap running on Contiki-NG
========================================
To run the example, do
$ make
$ sudo ./server.native
and query `coap://[fd00::302:304:506:708]/time?ticks` with any coap tool,
or query `coap://[fd00::302:304:506:708]/.well-known/core`
This will
* download Contiki-NG from the upstream git sources
* build the server application
* run the server application, creating a virtual network device tap0 (unless
that exists)
* configure your network interface to make the server accessible.
* return the appropriate response from the server to the client.
The server creates a resource for 'time' with a query 'ticks'. This is
reported for `.well-known/core`. The work flow for adding more resources does
not differ from regular libcoap usage.