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

Block-wise transfer on observe response? #730

Open
H732948 opened this issue Oct 13, 2023 · 1 comment
Open

Block-wise transfer on observe response? #730

H732948 opened this issue Oct 13, 2023 · 1 comment

Comments

@H732948
Copy link

H732948 commented Oct 13, 2023

Hello,

I have a wakaama client that sometimes sends large responses as the result of observation notifications, and there is no block-wise transfer initiated. I see that block2 is implemented on the server side for observe, but I couldn't see that it was implemented on the client side. I'm not sure if I missed something or misunderstand how it's supposed to work?

I added this in observe.c, line 807, to make my client initiate block-wise transfer for payloads larger than REST_MAX_CHUNK_SIZE:

if (length > REST_MAX_CHUNK_SIZE){
coap_set_header_block2(message, 0, (length > REST_MAX_CHUNK_SIZE), REST_MAX_CHUNK_SIZE);
coap_set_payload(message, buffer, REST_MAX_CHUNK_SIZE);
}
else
{
coap_set_payload(message, buffer, length);
}

It seems to work well. Am I missing something or might this be a good addition to observe.c?

@LukasWoodtli
Copy link
Contributor

@H732948 It's possible that something is missing. Would you consider providing a PR?

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

No branches or pull requests

2 participants