drivers/xbee: prevent 0 length packet sent to UART#11332
Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom Apr 2, 2019
Merged
drivers/xbee: prevent 0 length packet sent to UART#11332miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
Since the API doc doesn't specify what to do with 0 len writings into UART, we cannot assume that is safe to do it, so this commit prevents it by checking the length prior to the `uart_write()` operation.
24 tasks
miri64
approved these changes
Apr 2, 2019
Member
miri64
left a comment
There was a problem hiding this comment.
Can't get my hands on some hardware at the moment to test. But the code change is simple enough that I don't believe that it will break anything even if merged untested.
Contributor
Author
|
Thanks! |
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.
Contribution description
This PR prevents the xbee driver to write 0 len frames into UART, for which is not specified if it's valid or not. It also spares a
uart_write()operation if it's not needed.Testing procedure
See #11163.
Issues/PRs references
#11163