Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/coap: deprecate gcoap_add_qstring() and update uses #13240

Merged
merged 2 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sys/include/net/gcoap.h
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ ssize_t gcoap_encode_link(const coap_resource_t *resource, char *buf,
* To add multiple Uri-Query options, simply call this function multiple times.
* The Uri-Query options will be added in the order those calls.
*
* @deprecated Will not be available after the 2020.10 release. Use
* coap_opt_add_uquery() instead.
*
* @param[out] pdu The package that is being build
* @param[in] key Key to add to the query string
* @param[in] val Value to assign to @p key (may be NULL)
Expand Down
6 changes: 3 additions & 3 deletions sys/net/application_layer/cord/common/cord_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void cord_common_init(void)
int cord_common_add_qstring(coap_pkt_t *pkt)
{
/* extend the url with some query string options */
int res = gcoap_add_qstring(pkt, "ep", cord_common_ep);
int res = coap_opt_add_uquery(pkt, "ep", cord_common_ep);
if (res < 0) {
return res;
}
Expand All @@ -66,15 +66,15 @@ int cord_common_add_qstring(coap_pkt_t *pkt)
#if CORD_LT
char lt[11];
lt[fmt_u32_dec(lt, CORD_LT)] = '\0';
res = gcoap_add_qstring(pkt, "lt", lt);
res = coap_opt_add_uquery(pkt, "lt", lt);
if (res < 0) {
return res;
}
#endif

/* [optional] set the domain parameter */
#ifdef CORD_D
res = gcoap_add_qstring(pkt, "d", CORD_D);
res = coap_opt_add_uquery(pkt, "d", CORD_D);
if (res < 0) {
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/cord/ep/cord_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int _discover_internal(const sock_udp_ep_t *remote,
return CORD_EP_ERR;
}
coap_hdr_set_type(pkt.hdr, COAP_TYPE_CON);
gcoap_add_qstring(&pkt, "rt", "core.rd");
coap_opt_add_uquery(&pkt, "rt", "core.rd");
size_t pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_NONE);
res = gcoap_req_send(buf, pkt_len, remote, _on_discover, NULL);
if (res < 0) {
Expand Down