Skip to content

Commit

Permalink
cord/ep: Update for gcoap API change
Browse files Browse the repository at this point in the history
  • Loading branch information
kb2ma committed Nov 24, 2018
1 parent 424a01d commit 8fa6f10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sys/net/application_layer/cord/ep/cord_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,19 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif)
}
/* set some packet options and write query string */
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);

pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_PAYLOAD);

/* add the resource description as payload */
res = gcoap_get_resource_list(pkt.payload, pkt.payload_len,
COAP_FORMAT_LINK);
if (res < 0) {
retval = CORD_EP_ERR;
goto end;
}

/* finish up the packet */
pkt_len = gcoap_finish(&pkt, res, COAP_FORMAT_LINK);
pkt_len += res;

/* send out the request */
res = gcoap_req_send2(buf, pkt_len, remote, _on_register);
Expand Down

0 comments on commit 8fa6f10

Please sign in to comment.