Adding and removal of observes is now handled by libcoap. The application's
GET handler only needs to add the Observe option (see server.c:hnd_get_time()).
In case the ACK of a separate message is lost, the request would be
retransmitted until the maximum number of transmissions is reached because
the response usually has a different messsage id. The matching at this
point is done based on the response's source address and token.
This new behavior is described in Section 4.6 of draft-ietf-core-observe-12.
The idea is to send a response with code 7.31 and the token to identify
the subscription.
The macro did not respect zero-length option values hence a pointer
to the option byte itself was returned. This macro now returns NULL
for zero-length option values. Macros and functions that use this
macro have been updated accordingly. COAP_OPT_BLOCK_NUM has been
replaced by the function coap_opt_block_num().
The function wellknown_response() now honors a Block2 option when present
in the request or adds a new Block2 option to the response when the resource
description does not fit.
Bug: get_wkc_len() currently returns a hard-coded value instead of calculating
the size of the resource description (which requires changes in resource.c).
This change provides basic support for block-wise transfer of resource
descriptions. print_wellknown() now takes an additional parameter that
specifies the offset in the resource description where output shall start.
coap_print_link() has been modified to truncate resource descriptions that
do not fit in the given buffer (instead of failing with an error code as
was the case before).
if the coap pdu struct is larger than the headers that are stripped off
a datagram by the time it arrives at coap, all the nice zero-copying
stops working. instead of working around by allocating bigger headers
(which would go untested), it was decided to lock up. given how
reproducible the header calculations are, this will let the developer
know what's up early, if this ever happens to be critical at all.
there are two plausible causes for this to happen:
* the pdu struct grows, eg. because of additional fields or becaus it is
used on architecture with large alignment requirements
* packages "come in shallow", that is, are created from an interface
that barely has headers. such an interface could be a network
interfaces created from a hardware network stack.
this also changes the sizes of allocated pdus, in which previously, the
probelm was not considered and covered by overallocation.