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

net/nanocoap: write struct-based block1 option #10702

Closed
wants to merge 1 commit into from

Conversation

kb2ma
Copy link
Member

@kb2ma kb2ma commented Jan 5, 2019

Contribution description

Adds a function to write a block1 option using the struct-based nanocoap API.

Testing procedure

See the gcoap-block server app. It is equivalent to the nanocoap_server example, and includes an /sha256 resource. The handler writes a block1 option in the responses. Note that the RIOTBASE variable in Makefile does not use the RIOT submodule.

For a more complete test, see pytest-based block1_test.

Issues/PRs references

Part of the implementation of #9309.

@kb2ma kb2ma added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: CoAP Area: Constrained Application Protocol implementations labels Jan 5, 2019
@kb2ma
Copy link
Member Author

kb2ma commented Jan 5, 2019

This PR unfortunately was premature. My original intention was to allow writing a block1 option in control usage using the struct-based API, similar to coap_put_block1_ok(). It seemed an easy thing to do, and it was.

However, my larger goal is to complete the block implementation, which means addition of the client side for block1 and block2. I just started to look at this after I posted this PR. In this case, I think that the function coap_opt_add_block1() added in this PR instead will be used to write a message with the content, which uses a coap_block_slicer_t.

So, closing for now. My next step is to open an issue to describe the function names for the complete block implementation. Then I can revisit/rework this PR in that larger context.

@kb2ma kb2ma closed this Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CoAP Area: Constrained Application Protocol implementations Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant