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

example/nanocoap: fix block2 example [backport 2018.10] #10298

Merged

Conversation

kb2ma
Copy link
Member

@kb2ma kb2ma commented Oct 30, 2018

Backport of #10293

Contribution description

The recent addition of Block2 support in nanocoap included a new resource for the nanocoap_server example, /riot/ver. This resource provides a description of the version of RIOT as well as the board and MCU. However, the construction of the payload includes the null terminator for the component strings. This PR reworks the construction to avoid addition of the \0 bytes.

Testing procedure

To reproduce, send a GET request to the /riot/ver resource. Your implementation may require you to set a block size for the request. You also can use the attached Python script task04_py.txt (renamed to satisfy GitHub), which requires a recent copy of aiocoap.

With aiocoap, the faulty response looks like:

Result: 2.05 Content
b'This is RIOT (Version: \x002018.04-devel-3293-g289e6\x00) running on a \x00native\x00 board with a \x00native\x00 MCU.'

The fixed response looks like:

Result: 2.05 Content
b'This is RIOT (Version: 2018.04-devel-3293-g289e6) running on a native board with a native MCU.'

Issues/PRs references

N/A

@kb2ma kb2ma added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Area: CoAP Area: Constrained Application Protocol implementations labels Oct 30, 2018
@kb2ma kb2ma requested a review from jia200x October 30, 2018 09:36
@kb2ma kb2ma changed the title Nanocoap/fix block2 example [backport 2018.10] example/nanocoap: fix block2 example [backport 2018.10] Oct 30, 2018
@jia200x jia200x added Process: release backport Integration Process: The PR is a release backport of a change previously provided to master and removed Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch labels Nov 1, 2018
@jia200x
Copy link
Member

jia200x commented Nov 2, 2018

Matches #10293 as expected. Thanks!

Copy link
Member

@jia200x jia200x left a comment

Choose a reason for hiding this comment

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

ACK

@jia200x jia200x merged commit 82be92a into RIOT-OS:2018.10-branch Nov 2, 2018
@jia200x jia200x added this to the Release 2018.10 milestone Nov 13, 2018
@kb2ma kb2ma deleted the nanocoap/fix_block2_example_2018.10 branch February 4, 2019 17:34
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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants