Commit 29f883a7 authored by Gerson Fernando Budke's avatar Gerson Fernando Budke Committed by Anas Nashif
Browse files

lib: updatehub: Kconfig: Add coap block size option

Allow select max CoAP block size for exchange data using coap protocol.

Signed-off-by: default avatarGerson Fernando Budke <gerson.budke@ossystems.com.br>
parent f0fb867b
Loading
Loading
Loading
Loading
+17 −0
Changes for lib/updatehub/Kconfig: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -95,6 +95,23 @@ config UPDATEHUB_COAP_MAX_RETRY
	  Set the maximum number of retries attempts to download a packet
	  before abort a current update.

config UPDATEHUB_COAP_BLOCK_SIZE_EXP
	int "Max CoAP block size defined as 2^(4 + EXP)"
	default 6
	range 0 6
	depends on UPDATEHUB
	help
	  Configure the max size of a data payload were value:
	    0 - COAP_BLOCK_16
	    1 - COAP_BLOCK_32
	    2 - COAP_BLOCK_64
	    3 - COAP_BLOCK_128
	    4 - COAP_BLOCK_256
	    5 - COAP_BLOCK_512
	    6 - COAP_BLOCK_1024

	  This value is mapped directly to enum coap_block_size.

module = UPDATEHUB
module-str = Log level for UpdateHub
module-help = Enables logging for UpdateHub code.
+2 −1
Changes for lib/updatehub/updatehub.c: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -458,7 +458,8 @@ static enum updatehub_response install_update(void)
		goto error;
	}

	if (coap_block_transfer_init(&ctx.block, COAP_BLOCK_1024,
	if (coap_block_transfer_init(&ctx.block,
				     CONFIG_UPDATEHUB_COAP_BLOCK_SIZE_EXP,
				     update_info.image_size) < 0) {
		LOG_ERR("Unable init block transfer");
		ctx.code_status = UPDATEHUB_NETWORKING_ERROR;