[radio] introduce secured Enh-ACK properties to RxFrameProperties - #13361
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the codebase by enforcing better encapsulation of radio frame properties. By introducing dedicated helper methods for accessing secured Enh-ACK information and standardizing access to transmission properties, the changes reduce direct dependencies on internal struct members, leading to cleaner and more maintainable code. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors direct accesses to internal frame fields (such as transmission delay, retransmission flags, and ACK properties) across several MAC and radio files, replacing them with cleaner getter and setter helper methods. A critical issue was identified in SubMac::BeginTransmit(), where calling the new GetTxDelay, SetTxDelay, and SetTxDelayBaseTime methods unconditionally will cause compilation failures when building for Thread 1.1 or lower; wrapping this block in a preprocessor check is recommended.
Library files
|
This commit introduces `IsAckedWithSecEnhAck()`, `GetAckFrameCounter()`, and `GetAckKeyIndex()` helper methods in `RxFrameProperties` class to encapsulate raw received Enh-ACK security information. This commit also updates the remaining direct struct member accesses of `mInfo.mTxInfo` across `data_poll_sender.cpp`, `sub_mac.cpp`, and `radio_platform.cpp` to use the matching `TxFrameProperties` helper methods.
363a372 to
99c9ca0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13361 +/- ##
==========================================
- Coverage 75.17% 70.20% -4.98%
==========================================
Files 710 710
Lines 95168 96492 +1324
==========================================
- Hits 71540 67739 -3801
- Misses 23628 28753 +5125
🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors direct member accesses to frame properties with cleaner getter and setter methods (such as IsAckedWithSecEnhAck, GetAckFrameCounter, GetAckKeyIndex, and GetTxDelay) in radio_frame.hpp and updates their usages across several files. It also removes conditional compilation guards around TX delay methods. There are no review comments, so I have no feedback to provide.
| * | ||
| * @returns The secured Enh-ACK key index. | ||
| */ | ||
| uint8_t GetAckKeyIndex(void) const { return AsFrame().mInfo.mRxInfo.mAckKeyId; } |
There was a problem hiding this comment.
Should we consider renaming mAckKeyId? It is part of the API, but it is a simple rename.
There was a problem hiding this comment.
That is possible, but it would break backward compatibility and cause build failures for all radio vendors (which use this) requiring platform provider to update their implementation. I'm generally a bit hesitant to introduce breaking changes unless we have a strong justification.
In any case, a radio API change like that should probably be handled in its own PR—where we can detail the motivation and rationale—and probably alongside some corresponding updates in the various platform (radio repositories).
This commit introduces
IsAckedWithSecEnhAck(),GetAckFrameCounter(), andGetAckKeyIndex()helper methods inRxFramePropertiesclass to encapsulate raw received Enh-ACK security information.This commit also updates the remaining direct struct member accesses of
mInfo.mTxInfoacrossdata_poll_sender.cpp,sub_mac.cpp, andradio_platform.cppto use the matchingTxFramePropertieshelper methods.