contiki-os/contiki — pull request #778 by alessandrelli (2014-08-24 17:29:16+00:00)
Title: er-coap (observe): fix possible duplicate value for observe option

Currently, the observe value of a response to a GET observe request is always set to zero. That may cause the subsequent notification to have the same observe value. In fact, that happens every time an observable resource is observed for the first time (since the obs_counter is implicitly initialized to zero).
This seems to me a violation of the IETF draft which mandates that the observe value be *"the 24 least-significant bits of a strictly increasing sequence number"*
This patch fixes such a problem by setting the observe option value of responses to obs_counter (and then incrementing it).