Repository navigation
Fixed return type of GetPayloadLength - #235
Merged
nayakned merged 1 commit intoNov 10, 2026
Merged
Conversation
GragonGit
force-pushed
the
234-Fix-return-type-of-GetPayloadLength
branch
from
November 5, 2026 13:04
d985dd7 to
a96e371
Compare
Signed-off-by: Tristan Nußbaum <tnussbaum@stud.hs-heilbronn.de>
GragonGit
force-pushed
the
234-Fix-return-type-of-GetPayloadLength
branch
from
November 5, 2026 13:12
a96e371 to
ad8e445
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
==========================================
+ Coverage 99.55% 99.56% +0.01%
==========================================
Files 61 61
Lines 9342 9489 +147
Branches 329 334 +5
==========================================
+ Hits 9300 9448 +148
+ Misses 41 40 -1
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the payload-length getter changes.
No open issues 🎉
What changed in this PR
Fixes #234 by widening payload-length getters for five Open1722 ACF formats, preventing truncation of lengths above 255 bytes.
Changes:
- Changes getter return types and result casts from
uint8_ttouint16_tfor ABB, CANXL, CANXL-Brief, GBB, and MOST. - Adds regression tests for large payloads, the 255/256-byte boundary, and maximum ACF message lengths.
- Adds large-message creation tests covering payload contents, padding, and validity.
| File | Description |
|---|---|
unit/test-most.c |
Adds MOST length and large-message regression tests. |
unit/test-gbb.c |
Adds GBB length and large-message regression tests. |
unit/test-canxl.c |
Adds CANXL length and large-message regression tests. |
unit/test-canxl-brief.c |
Adds CANXL-Brief length and large-message regression tests. |
unit/test-abb.c |
Adds ABB length and large-message regression tests. |
include/avtp/acf/Most.h |
Widens the MOST payload-length getter to uint16_t. |
include/avtp/acf/Gbb.h |
Widens the GBB payload-length getter to uint16_t. |
include/avtp/acf/CanXlBrief.h |
Widens the CANXL-Brief payload-length getter to uint16_t. |
include/avtp/acf/CanXl.h |
Widens the CANXL payload-length getter to uint16_t. |
include/avtp/acf/Abb.h |
Widens the ABB payload-length getter to uint16_t. |
Review effort: Balanced
nayakned
approved these changes
Nov 10, 2026
nayakned
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me.
Thank you for the fix and the new tests.
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.
Fixed return type of
Avtp_<type>_GetPayloadLengthto beuint16_tfor data formats whose payload length may succeed 255 bytes. Namely:Also added related tests regarding large payloads for these types.
Fixes #234