cc110x: fix netdev get/set according to netopt_t doc#8026
Merged
kaspar030 merged 1 commit intoRIOT-OS:masterfrom Apr 16, 2018
Merged
cc110x: fix netdev get/set according to netopt_t doc#8026kaspar030 merged 1 commit intoRIOT-OS:masterfrom
netopt_t doc#8026kaspar030 merged 1 commit intoRIOT-OS:masterfrom
Conversation
cgundogan
reviewed
Dec 1, 2017
drivers/cc110x/cc110x-netdev.c
Outdated
| case NETOPT_ADDRESS: | ||
| assert(value_len > 0); | ||
| *((uint8_t *)value) = cc110x->radio_address; | ||
| return 1; |
Member
Author
There was a problem hiding this comment.
Addresses for the cc11xx are 1 byte long, so I'm not sure I understand your unspecific question ;)
Member
There was a problem hiding this comment.
So, why not use sizeof(cc110x->radio_channel) here? Or sizeof(uint8_t)? At least this seemed to be your motiviation when I look at your change a few lines above.
Member
Author
There was a problem hiding this comment.
Typical "while you're at it" comment, but fine... will fix.
netopt_t doc
Member
Author
|
Done (and changed the topic of this PR accordingly). |
9ec1e1d to
230417d
Compare
Member
Author
|
Rebased and squashed to current master. |
Contributor
|
|
Member
Author
|
Fixed and amended. |
230417d to
247b1a0
Compare
maxvankessel
pushed a commit
to maxvankessel/RIOT
that referenced
this pull request
Apr 20, 2018
…-size-width cc110x: fix netdev get/set according to `netopt_t` doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the doc of
NETOPT_MAX_PACKET_SIZEthe type should beuint16_tand thusgnrc_netif2assumes that. The cc110x radio currently returns this option as auint8_twhich causesgnrc_netif2to work with it error-prone. This PR fixes that.Edit: as @cgundogan pointed out: other options were also wrong/defined by magic numbers, so I changed the topic of this PR to reflect the other changes.