mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 17:52:54 +03:00
Move coap_pdu_t to coap_pdu_internal.h. Move internal PDU based function definitions to coap_pdu_internal.h. Replace most references to "struct coap_pdu_t" with "coap_pdu_t". Create new enum coap_pdu_type_t, enum coap_pdu_code_t and coap_option_num_t, using them where appropriate for clarity of documentation. Provide new functions to allow applications to access/update parts of coap_pdu_t as appropriate and document as appropriate. Update examples to use these new access functions where appropriate.
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`.