Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcoap: block-upload: allow server-negotiated block size #648

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

szczys
Copy link
Contributor

@szczys szczys commented Oct 4, 2024

When performing a block upload, honor requests from the server for a smaller block size.

Resolves: https://github.com/golioth/firmware-issue-tracker/issues/670

Copy link

github-actions bot commented Oct 4, 2024

Visit the preview URL for this PR (updated for commit 8d12cab):

https://golioth-firmware-sdk-doxygen-dev--pr648-szczys-libcoap-wzm2hfhb.web.app

(expires Mon, 14 Oct 2024 21:44:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

When the server responds to a block upload request with a different
block size, supply the new value to the callback so it may be used to set
up the size of the  next block.

Signed-off-by: Mike Szczys <[email protected]>
Use the negotiated block size when initializing the block1 option of the
coap packet.

This moves the use of the compiled-in
CONFIG_GOLIOTH_BLOCKWISE_UPLOAD_MAX_BLOCK_SIZE value to the initialization
step of the negotiated value, and allows for the negotiated value to be
updated based on the server preference, then used for all subsequent coap
requests in the block upload process.

Signed-off-by: Mike Szczys <[email protected]>
@szczys szczys force-pushed the szczys/libcoap-server-suggests branch from 023c0ba to 8d12cab Compare October 7, 2024 21:44
Copy link

github-actions bot commented Oct 7, 2024

Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
include.golioth 75% 50%
port.linux 53% 28%
port.zephyr 49% 14%
src 69% 31%
Summary 67% (2498 / 3725) 30% (1072 / 3571)

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/coap_client_libcoap.c 50.00% 0 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
src/coap_client_libcoap.c 54.61% <50.00%> (+0.14%) ⬆️

... and 4 files with indirect coverage changes

@szczys szczys merged commit 909ff52 into main Oct 8, 2024
64 of 74 checks passed
@szczys szczys deleted the szczys/libcoap-server-suggests branch October 8, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants