Update component/coap to libcoap version release-4.2.0

This takes the code up to the latest released version of libcoap.

As there have been API changes, coap_client and coap_server in
examples/protocols have been updated to use the new APIs.

Further information on the new libcoap APIs can be found at
https://libcoap.net/doc/reference/4.2.0/

coap_client has been updated to handle BLOCK2 responses from
"coap://californium.eclipse.org"
coap_client has been modified to only send out one request (and wait for
the response)

coap_server has been updated to support Observe subscriptions, and well as
adding in PUT and DELETE handlers to work on the Espressif resource

coap_server and coap_client have had their stack sizes increased.

port/coap_io.c has been added, a copy of libcoap/src/coap_io.c with support
added for systems that do not have RFC 3542 section 20 support.

port/coap_io_socket.c has been removed as a lot of the code is now
replicated in different libcoap files.

Once this PR is place, then adding in DTLS will be a lot simpler (as a
separate PR)

Signed-off-by: Jitin George <jitin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/3148
This commit is contained in:
Jon Shallow
2019-03-08 20:22:17 +00:00
committed by bot
parent 96aa08a0ff
commit bc9d1a65d7
11 changed files with 1760 additions and 631 deletions
+10 -5
View File
@@ -51,13 +51,18 @@ I (1692) wifi: pm start, type: 1
I (2622) event: sta ip: 192.168.3.84, mask: 255.255.255.0, gw: 192.168.3.1
I (2622) CoAP_server: Connected to AP
E (7622) CoAP_server: select timeout
E (12622) CoAP_server: select timeout
E (17622) CoAP_server: select timeout
...
```
if a CoAP client query `/Espressif` resource, CoAP server would return `"Hello World!"`
if a CoAP client query `/Espressif` resource, CoAP server would return `"no data"`
until a CoAP client does a PUT with some data.
## libcoap Documentation
This can be found at https://libcoap.net/doc/reference/4.2.0/
## Troubleshooting
* Please make sure CoAP client fetchs data under path: `/Espressif`
* Please make sure CoAP client fetchs or puts data under path: `/Espressif` or
fetches `/.well-known/core`
* libcoap logging can be increased by changing `#define COAP_LOGGING_LEVEL 0`
to `#define COAP_LOGGING_LEVEL 9`