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

SHDLC: Separate error value for too long frames #50

Merged
merged 1 commit into from
Jan 27, 2020

Conversation

abrauchli
Copy link
Contributor

@abrauchli abrauchli commented Nov 28, 2019

Better error handling when decoding incorrect SHDLC frames:

  • Add a new error constant SENSIRION_SHDLC_ERR_FRAME_TOO_LONG which
    is returned when the frame contains more data than expected (the
    length field)
  • When a CRC is supplied, it is now checked before checking if the
    frame is too long, causing the exit path (CRC error) to be
    backtraceable.

Check the following:

  • Changelog updated
  • Code style cleaned (ran make style-fix)

Copy link
Contributor

@rnestler rnestler left a comment

Choose a reason for hiding this comment

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

Nice! Small change with a big usability and debugging improvement 🙂

@rnestler
Copy link
Contributor

Breaking changes marked in commit message

While an added error value may be considered a breaking change, I wouldn't call it breaking, since we make no guarantee about it.

Copy link
Contributor

@rnestler rnestler left a comment

Choose a reason for hiding this comment

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

Update changelog?

@abrauchli abrauchli force-pushed the separately-handle-frame-too-long-error branch from 5f11941 to c312ab0 Compare January 24, 2020 07:41
@abrauchli abrauchli changed the title SHDLC: Better error handling SHDLC: Separate error value for too long frames Jan 24, 2020
@abrauchli
Copy link
Contributor Author

Update changelog?

done

Better error handling when decoding incorrect SHDLC frames:

* Add a new error constant `SENSIRION_SHDLC_ERR_FRAME_TOO_LONG` which
  is returned when the frame contains more data than expected (the
  length field)
* When a CRC is supplied, it is now checked before checking if the
  frame is too long, causing the exit path (CRC error) to be
  backtraceable.
@abrauchli abrauchli force-pushed the separately-handle-frame-too-long-error branch from c312ab0 to d599ad1 Compare January 24, 2020 07:43
@abrauchli abrauchli merged commit cc09c84 into master Jan 27, 2020
@abrauchli abrauchli deleted the separately-handle-frame-too-long-error branch January 27, 2020 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants