coap_send(): Consolidate coap_send() and coap_send_large() for applications

As it is not that intuitive when to use coap_send() or coap_send_large()
in applications, rename libcoap usage of coap_send() to coap_send_internal()
and then all usages of coap_send_large() to coap_send() so that only
coap_send() is required in applications.

Documentation updated accordingly.
This commit is contained in:
Jon Shallow committed 2021-05-29 14:08:00 +01:00
1 parent 62b2be4da1
commit 8d73044579
15 files changed
+81 -92

No files matched your search

+2 -2
View File
@@ -305,7 +305,7 @@ nack_handler(coap_session_t *session COAP_UNUSED,
}
/*
* Response handler used for coap_send_large() responses
* Response handler used for coap_send() responses
*/
static coap_response_t
message_handler(coap_session_t *session COAP_UNUSED,
@@ -1675,7 +1675,7 @@ main(int argc, char **argv) {
if (coap_get_log_level() < LOG_DEBUG)
coap_show_pdu(LOG_INFO, pdu);
coap_send_large(session, pdu);
coap_send(session, pdu);
wait_ms = wait_seconds * 1000;
coap_log(LOG_DEBUG, "timeout is set to %u seconds\n", wait_seconds);
+3 -3
View File
@@ -857,7 +857,7 @@ remove_proxy_association(coap_session_t *session, int send_failure) {
"Cannot add token to incoming proxy response PDU\n");
}
if (coap_send_large(proxy_list[i].incoming, response) ==
if (coap_send(proxy_list[i].incoming, response) ==
COAP_INVALID_MID) {
coap_log(LOG_INFO, "Failed to send PDU with 5.02 gateway issue\n");
}
@@ -1204,7 +1204,7 @@ hnd_proxy_uri(coap_resource_t *resource COAP_UNUSED,
if (coap_get_log_level() < LOG_DEBUG)
coap_show_pdu(LOG_INFO, pdu);
coap_send_large(ongoing, pdu);
coap_send(ongoing, pdu);
goto cleanup;
}
else {
@@ -1707,7 +1707,7 @@ proxy_message_handler(coap_session_t *session,
if (coap_get_log_level() < LOG_DEBUG)
coap_show_pdu(LOG_INFO, pdu);
coap_send_large(incoming, pdu);
coap_send(incoming, pdu);
return COAP_RESPONSE_OK;
}