Skip to content

examples/gcoap_block_server: add gcoap block server example#17843

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:gcoap-block-server
Apr 2, 2022
Merged

examples/gcoap_block_server: add gcoap block server example#17843
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:gcoap-block-server

Conversation

@benpicco
Copy link
Copy Markdown
Contributor

Contribution description

This adds the gcoap block server example to mainline RIOT.

It existed as an external application that is hard to discover and failed to compile with the latest upstream RIOT.

Testing procedure

% aiocoap-client -m GET "coap://[fe80::7837:fcff:fe7d:1aaf%tapbr0]/riot/ver"  
This is RIOT (Version: 2022.04-devel-911-gdd8b3f) running on a native board with a native MCU.

Issues/PRs references

#17544 (comment)

@benpicco benpicco requested a review from jia200x as a code owner March 22, 2022 15:32
@benpicco benpicco requested review from kaspar030, kb2ma and kfessel March 22, 2022 15:33
@github-actions github-actions bot added Area: doc Area: Documentation Area: examples Area: Example Applications labels Mar 22, 2022
@benpicco benpicco requested a review from miri64 March 22, 2022 15:39
@benpicco benpicco force-pushed the gcoap-block-server branch from 25efef5 to b27ba66 Compare March 22, 2022 16:19
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 22, 2022
@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 23, 2022

Mhhh, instead of adding examples how to make a very complicated process usable, I would prefer to have API support to send large payloads (bodies), without having the user do all the hassle of slicing and reassembling the blocks, similar to (or inspired by) libcoap is allowing. Just my two cents... but maybe in the meantime, having this example would be beneficial.

@benpicco
Copy link
Copy Markdown
Contributor Author

Some context: in #17544 I want to refactor the nanocoap API and was happy to have found a solution that allowed me not to also to the same changes to GCoap.

Then @kfessel pointed out that this would break gcoap blockwise response. I was confused as I tested all gcoap applications and they worked fine - in particular, gcoap would not do blockwise responses to begin with.

Then @kfessel pointed me to this example that is linked in the documentation. It does not compile anymore with upstream RIOT, but was made to work easily enough.

So the idea is to have this in tree to have something to test against when doing refactoring.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Mar 23, 2022

Ok, yeah, then better have a working example than no example at all ^^

Copy link
Copy Markdown
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should get this in to ensure this interaction gcoap <-> nanocoap is always kept in mind.

@benpicco benpicco force-pushed the gcoap-block-server branch from 2de51bb to 4702ac0 Compare April 2, 2022 21:51
@benpicco benpicco force-pushed the gcoap-block-server branch from 4702ac0 to f04cf57 Compare April 2, 2022 21:51
@benpicco benpicco merged commit ac4ac64 into RIOT-OS:master Apr 2, 2022
@benpicco benpicco deleted the gcoap-block-server branch April 2, 2022 22:19
@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Area: examples Area: Example Applications CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants