mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-02 19:29:30 +00:00
Keep CoAP 'observe' option length <= 3 bytes
This commit is contained in:
parent
d0ddb7221e
commit
f83f035855
@ -249,6 +249,8 @@ coap_notify_observers_sub(resource_t *resource, const char *subpath)
|
|||||||
|
|
||||||
if(notification->code < BAD_REQUEST_4_00) {
|
if(notification->code < BAD_REQUEST_4_00) {
|
||||||
coap_set_header_observe(notification, (obs->obs_counter)++);
|
coap_set_header_observe(notification, (obs->obs_counter)++);
|
||||||
|
/* mask out to keep the CoAP observe option length <= 3 bytes */
|
||||||
|
obs->obs_counter &= 0xffffff;
|
||||||
}
|
}
|
||||||
coap_set_token(notification, obs->token, obs->token_len);
|
coap_set_token(notification, obs->token, obs->token_len);
|
||||||
|
|
||||||
@ -276,6 +278,8 @@ coap_observe_handler(resource_t *resource, void *request, void *response)
|
|||||||
coap_req->uri_path, coap_req->uri_path_len);
|
coap_req->uri_path, coap_req->uri_path_len);
|
||||||
if(obs) {
|
if(obs) {
|
||||||
coap_set_header_observe(coap_res, (obs->obs_counter)++);
|
coap_set_header_observe(coap_res, (obs->obs_counter)++);
|
||||||
|
/* mask out to keep the CoAP observe option length <= 3 bytes */
|
||||||
|
obs->obs_counter &= 0xffffff;
|
||||||
/*
|
/*
|
||||||
* Following payload is for demonstration purposes only.
|
* Following payload is for demonstration purposes only.
|
||||||
* A subscription should return the same representation as a normal GET.
|
* A subscription should return the same representation as a normal GET.
|
||||||
|
Loading…
Reference in New Issue
Block a user