cord/ep: Update for gcoap API change
This commit is contained in:
parent
424a01ddc1
commit
8fa6f10f97
@ -273,8 +273,11 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif)
|
|||||||
}
|
}
|
||||||
/* set some packet options and write query string */
|
/* set some packet options and write query string */
|
||||||
coap_hdr_set_type(pkt.hdr, COAP_TYPE_CON);
|
coap_hdr_set_type(pkt.hdr, COAP_TYPE_CON);
|
||||||
|
coap_opt_add_uint(&pkt, COAP_OPT_CONTENT_FORMAT, COAP_FORMAT_LINK);
|
||||||
cord_common_add_qstring(&pkt);
|
cord_common_add_qstring(&pkt);
|
||||||
|
|
||||||
|
pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_PAYLOAD);
|
||||||
|
|
||||||
/* add the resource description as payload */
|
/* add the resource description as payload */
|
||||||
res = gcoap_get_resource_list(pkt.payload, pkt.payload_len,
|
res = gcoap_get_resource_list(pkt.payload, pkt.payload_len,
|
||||||
COAP_FORMAT_LINK);
|
COAP_FORMAT_LINK);
|
||||||
@ -282,9 +285,7 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif)
|
|||||||
retval = CORD_EP_ERR;
|
retval = CORD_EP_ERR;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
pkt_len += res;
|
||||||
/* finish up the packet */
|
|
||||||
pkt_len = gcoap_finish(&pkt, res, COAP_FORMAT_LINK);
|
|
||||||
|
|
||||||
/* send out the request */
|
/* send out the request */
|
||||||
res = gcoap_req_send2(buf, pkt_len, remote, _on_register);
|
res = gcoap_req_send2(buf, pkt_len, remote, _on_register);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user