1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-23 21:43:51 +01:00

Merge pull request #15548 from benpicco/suit/transport/coap_blocksize

suit/transport/coap: make blocksize configurable
This commit is contained in:
Francisco 2020-12-08 10:14:34 +01:00 committed by GitHub
commit 1d8c541b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {