mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-27 09:17:08 +03:00
Move coap_context_t and coap_queue_t to coap_net_internal.h. Move internal context and queue based function definitions to coap_net_internal.h. Replace most references to "struct coap_context_t" with "coap_context_t". Provide new functions to allow applications to access parts of coap_context_t as appropriate and document these functions. Update examples to use these new access functions where appropriate. For the man documentation, move the server session setup functions to (new) coap_endpoint_server(3) and update coap_context(3) with all the context access functions as these are common to both the client and server.
Example of libcoap running on contiki
=====================================
To run the example, do
$ make
$ sudo ./server.minimal-net
(and in a second terminal)
$ sudo ip -6 a a aaaa::1/64 dev tap0
and query `coap://[aaaa::1000]/time?ticks` with any coap tool,
or query `coap://[aaaa::1000]/.well-known/core`
This will
* download contiki 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. If you seem to run out of memory
creating the resources, tweak the number of pre-allocated resources
in `coap_config.h.contiki`.