diff --git a/sys/suit/handlers_command_seq.c b/sys/suit/handlers_command_seq.c index 13c14abe96..1b4d56104c 100644 --- a/sys/suit/handlers_command_seq.c +++ b/sys/suit/handlers_command_seq.c @@ -49,8 +49,8 @@ static int _get_component_size(suit_manifest_t *manifest, { nanocbor_value_t param_size; if ((suit_param_ref_to_cbor(manifest, &comp->param_size, ¶m_size) == 0) - || (nanocbor_get_uint32(¶m_size, img_size) < 0)) { return - SUIT_ERR_INVALID_MANIFEST; + || (nanocbor_get_uint32(¶m_size, img_size) < 0)) { + return SUIT_ERR_INVALID_MANIFEST; } return SUIT_OK; } @@ -359,9 +359,8 @@ 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) { - uint8_t buffer[NANOCOAP_BLOCKWISE_BUF(CONFIG_SUIT_COAP_BLOCKSIZE)]; res = nanocoap_get_blockwise_url(manifest->urlbuf, CONFIG_SUIT_COAP_BLOCKSIZE, - buffer, suit_storage_helper, + suit_storage_helper, manifest); } #endif diff --git a/sys/suit/transport/coap.c b/sys/suit/transport/coap.c index 43ce661364..44f24367f7 100644 --- a/sys/suit/transport/coap.c +++ b/sys/suit/transport/coap.c @@ -112,10 +112,10 @@ ssize_t coap_subtree_handler(coap_pkt_t *pkt, uint8_t *buf, size_t len, subtree->resources_numof); } -static void _suit_handle_url(const char *url, coap_blksize_t blksize, void *work_buf) +static void _suit_handle_url(const char *url, coap_blksize_t blksize) { LOG_INFO("suit_coap: downloading \"%s\"\n", url); - ssize_t size = nanocoap_get_blockwise_url_to_buf(url, blksize, work_buf, + ssize_t size = nanocoap_get_blockwise_url_to_buf(url, blksize, _manifest_buf, SUIT_MANIFEST_BUFSIZE); if (size >= 0) { @@ -204,8 +204,6 @@ static void *_suit_coap_thread(void *arg) { (void)arg; - uint8_t buffer[NANOCOAP_BLOCKWISE_BUF(CONFIG_SUIT_COAP_BLOCKSIZE)]; - LOG_INFO("suit_coap: started.\n"); msg_t msg_queue[4]; msg_init_queue(msg_queue, 4); @@ -219,7 +217,7 @@ static void *_suit_coap_thread(void *arg) switch (m.content.value) { case SUIT_MSG_TRIGGER: LOG_INFO("suit_coap: trigger received\n"); - _suit_handle_url(_url, CONFIG_SUIT_COAP_BLOCKSIZE, buffer); + _suit_handle_url(_url, CONFIG_SUIT_COAP_BLOCKSIZE); break; default: LOG_WARNING("suit_coap: warning: unhandled msg\n"); diff --git a/tests/nanocoap_cli/nanocli_client.c b/tests/nanocoap_cli/nanocli_client.c index ebc2a96bc8..d0ce7ce024 100644 --- a/tests/nanocoap_cli/nanocli_client.c +++ b/tests/nanocoap_cli/nanocli_client.c @@ -204,9 +204,8 @@ int nanotest_client_url_cmd(int argc, char **argv) return -1; } - uint8_t buffer[NANOCOAP_BLOCKWISE_BUF(COAP_BLOCKSIZE_32)]; - return nanocoap_get_blockwise_url(argv[2], COAP_BLOCKSIZE_32, buffer, - _blockwise_cb, NULL); + return nanocoap_get_blockwise_url(argv[2], COAP_BLOCKSIZE_32, + _blockwise_cb, NULL); error: printf("usage: %s [data]\n", argv[0]); return -1;