Skip to content

Commit

Permalink
Merge pull request #11779 from miri64/gcoap/doc/rm-req_send2
Browse files Browse the repository at this point in the history
gcoap: remove all references to `gcoap_req_send2()`
  • Loading branch information
kb2ma committed Jul 3, 2019
2 parents cd6544e + 7e70bf3 commit 3d33400
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/gcoap/gcoap_cli.c
Expand Up @@ -196,7 +196,7 @@ static size_t _send(uint8_t *buf, size_t len, char *addr_str, char *port_str)
return 0;
}

bytes_sent = gcoap_req_send2(buf, len, &remote, _resp_handler);
bytes_sent = gcoap_req_send(buf, len, &remote, _resp_handler);
if (bytes_sent > 0) {
req_count++;
}
Expand Down
2 changes: 1 addition & 1 deletion sys/include/net/gcoap.h
Expand Up @@ -110,7 +110,7 @@
* If no payload, call only gcoap_request() to write the full request. If you
* need to add Options, follow the first four steps in the list above instead.
*
* Finally, call gcoap_req_send2() with the sum of the metadata length and
* Finally, call gcoap_req_send() with the sum of the metadata length and
* payload length, the destination endpoint, and a callback function for the
* host's response.
*
Expand Down
6 changes: 3 additions & 3 deletions sys/net/application_layer/cord/ep/cord_ep.c
Expand Up @@ -149,7 +149,7 @@ static int _update_remove(unsigned code, gcoap_resp_handler_t handle)
ssize_t pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_NONE);

/* send request */
gcoap_req_send2(buf, pkt_len, &_rd_remote, handle);
gcoap_req_send(buf, pkt_len, &_rd_remote, handle);

/* synchronize response */
return _sync();
Expand Down Expand Up @@ -221,7 +221,7 @@ static int _discover_internal(const sock_udp_ep_t *remote,
coap_hdr_set_type(pkt.hdr, COAP_TYPE_CON);
gcoap_add_qstring(&pkt, "rt", "core.rd");
size_t pkt_len = coap_opt_finish(&pkt, COAP_OPT_FINISH_NONE);
res = gcoap_req_send2(buf, pkt_len, remote, _on_discover);
res = gcoap_req_send(buf, pkt_len, remote, _on_discover);
if (res < 0) {
return CORD_EP_ERR;
}
Expand Down Expand Up @@ -288,7 +288,7 @@ int cord_ep_register(const sock_udp_ep_t *remote, const char *regif)
pkt_len += res;

/* send out the request */
res = gcoap_req_send2(buf, pkt_len, remote, _on_register);
res = gcoap_req_send(buf, pkt_len, remote, _on_register);
if (res < 0) {
retval = CORD_EP_ERR;
goto end;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/application_layer/cord/epsim/cord_epsim.c
Expand Up @@ -67,7 +67,7 @@ int cord_epsim_register(const sock_udp_ep_t *rd_ep)
/* finish, we don't have any payload */
ssize_t len = gcoap_finish(&pkt, 0, COAP_FORMAT_NONE);
_state = CORD_EPSIM_BUSY;
if (gcoap_req_send2(buf, len, rd_ep, _req_handler) == 0) {
if (gcoap_req_send(buf, len, rd_ep, _req_handler) == 0) {
return CORD_EPSIM_ERROR;
}

Expand Down
4 changes: 2 additions & 2 deletions sys/net/application_layer/gcoap/gcoap.c
Expand Up @@ -172,7 +172,7 @@ static void _listen(sock_udp_t *sock)
uint8_t open_reqs = gcoap_op_state();

/* We expect a -EINTR response here when unlimited waiting (SOCK_NO_TIMEOUT)
* is interrupted when sending a message in gcoap_req_send2(). While a
* is interrupted when sending a message in gcoap_req_send(). While a
* request is outstanding, sock_udp_recv() is called here with limited
* waiting so the request's timeout can be handled in a timely manner in
* _event_loop(). */
Expand Down Expand Up @@ -783,7 +783,7 @@ size_t gcoap_req_send(const uint8_t *buf, size_t len,

/* timeout may be zero for non-confirmable */
if ((memo != NULL) && (res > 0) && (timeout > 0)) {
/* We assume gcoap_req_send2() is called on some thread other than
/* We assume gcoap_req_send() is called on some thread other than
* gcoap's. First, put a message in the mbox for the sock udp object,
* which will interrupt listening on the gcoap thread. (When there are
* no outstanding requests, gcoap blocks indefinitely in _listen() at
Expand Down

0 comments on commit 3d33400

Please sign in to comment.