this will make reading the ifdefed sections easier.
as the typedef struct __coap_address_t {...}; /
define coap_address_t __coap_address_t trick is not needed any more to
detect whether a WITH defined coap_address_t or not, it was removed.
the coap_add_option_later works like coap_add_option, but does not take
data. instead, it allocates the option empty, and returns an address the
application has to fill with data later.
this is especially useful for the etag and block options; the
application can write out its variable data, generate a checksum while
writing, and fill the etag when the data is already written to the pdu.
with the block options, the more flag can be set at the last moment.
this change spreads the concept of "dirty" from resources to
subscriptions. this allows queuing up notifications in case not all of
them can be transmitted at the same time (which can happen due to
constraints in pdu or node space).
when a dirty resource's notifications can not be sent, the resource is
marked as partiallydirty, and on the subscriptions that could not be
sent out, the dirty flag is set. they get cleared later when
coap_notify_observers gets run again, as it not only looks for dirty,
but also for partiallydirty resources.
note that there is currently no facility that prevents that all the
nodes get assigned to the send queue, leaving no room for receiving
packages (which happens in mass notifications, blocks all incoming
packages and is only resolved by the transmissions timing out). my
current test setup always leaves at least one node free for reception by
over-allocating and freeing a node on sending.
it is the idea of the relative-timestamps branch that such asserts are
not necessary any more, and that if timestamps wrap, they just may.
rephrased expression for determining t for clarity.
This change addresses bug #27 "_order_timestamp can't handle time wraps".
t in struct coap_queue_t now is the time (in ticks) relative to the
previous entry in the queue. The first entry is relative to sendqueue_basetime
in struct coap_context_t (TODO: possibly make the first entry in the
queue relative to 0, eliding the need for sendqueue_basetime).
As no other ordering of nodes except for timestamps is used, the function
parameter for coap_insert_node() has been removed.
Fixed calculation of option size in coap_new_error_response(). As
only some options are copied from the request, the delta value can
increase and thus require more space to encode. This fix closes
https://sourceforge.net/p/libcoap/bugs/17/ (thanks to chrysn and
tbahls for pointing this out).
an `inline int opt_finished` causes GCC to spew this error when used
with -std=gnu99:
libcoap/option.c:165: undefined reference to `opt_finished'
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>