1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 23:41:18 +01:00

suit/transport/coap: make blocksize configurable

When using SUIT over a link-layer that supports larger PDU, a larger
CoAP blocksize is desirable to speed up firmware downloads.

To support this, make the CoAP blocksize used by SUIT configurable.
This commit is contained in:
Benjamin Valentin 2020-12-03 10:51:42 +01:00
parent 72621bcfcf
commit 191c91ce18
3 changed files with 9 additions and 2 deletions

View File

@ -121,6 +121,13 @@ typedef enum {
COAP_BLOCKSIZE_1024,
} coap_blksize_t;
/**
* @brief Coap block-wise-transfer size used for SUIT
*/
#ifndef CONFIG_SUIT_COAP_BLOCKSIZE
#define CONFIG_SUIT_COAP_BLOCKSIZE COAP_BLOCKSIZE_64
#endif
/**
* @brief Performs a blockwise coap get request to the specified url.
*

View File

@ -358,7 +358,7 @@ static int _dtv_fetch(suit_manifest_t *manifest, int key,
if (0) {}
#ifdef MODULE_SUIT_TRANSPORT_COAP
else if (strncmp(manifest->urlbuf, "coap://", 7) == 0) {
res = suit_coap_get_blockwise_url(manifest->urlbuf, COAP_BLOCKSIZE_64,
res = suit_coap_get_blockwise_url(manifest->urlbuf, CONFIG_SUIT_COAP_BLOCKSIZE,
suit_storage_helper,
manifest);
}

View File

@ -346,7 +346,7 @@ ssize_t suit_coap_get_blockwise_url_buf(const char *url,
static void _suit_handle_url(const char *url)
{
LOG_INFO("suit_coap: downloading \"%s\"\n", url);
ssize_t size = suit_coap_get_blockwise_url_buf(url, COAP_BLOCKSIZE_64,
ssize_t size = suit_coap_get_blockwise_url_buf(url, CONFIG_SUIT_COAP_BLOCKSIZE,
_manifest_buf,
SUIT_MANIFEST_BUFSIZE);
if (size >= 0) {