[mle] introduce Connectivity and ConnectivityTlvValue types - #12300
Conversation
This change separates the Connectivity TLV value format from its logical structure by introducing `ConnectivityTlvValue` (raw format) and `Connectivity` (parsed info). This replaces the `ConnectivityTlv` class and enables value format sharing between MLE and Network Diagnostics (without improper TLV inheritance). It also updates `ParentCandidate` to use the new `Connectivity` class for better field encapsulation. It also updates `ConnectivityTlvValue` parsing to handle optional fields and enforce spec-defined minimums for these fields.
Summary of ChangesHello @abtink, 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 introduces a significant architectural improvement by decoupling the logical representation of connectivity data from its on-wire TLV format. This separation enhances code clarity, improves data encapsulation within key structures like Highlights
🧠 New Feature in Public Preview: You can now enable Memory 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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a well-executed refactoring that separates the Connectivity TLV's raw format from its logical structure. The introduction of ConnectivityTlvValue for the raw format and Connectivity for the parsed information is a clean design choice that effectively replaces the old ConnectivityTlv class. This change successfully enables the sharing of the value format between MLE and Network Diagnostics, which reduces code duplication. Additionally, updating ParentCandidate to use the new Connectivity class improves encapsulation. The parsing logic for ConnectivityTlvValue has also been enhanced to handle optional fields, making it more robust. The changes are consistently applied across all relevant files, resulting in cleaner and more maintainable code. I have no specific comments as the implementation is solid.
Library files
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12300 +/- ##
==========================================
+ Coverage 76.09% 76.59% +0.50%
==========================================
Files 680 677 -3
Lines 92485 93932 +1447
==========================================
+ Hits 70378 71949 +1571
+ Misses 22107 21983 -124
🚀 New features to boost your workflow:
|
This change separates the Connectivity TLV value format from its logical structure by introducing
ConnectivityTlvValue(raw format) andConnectivity(parsed info). This replaces theConnectivityTlvclass and enables value format sharing between MLE and Network Diagnostics (without improper TLV inheritance).It also updates
ParentCandidateto use the newConnectivityclass for better field encapsulation. It also updatesConnectivityTlvValueparsing to handle optional fields and enforce spec-defined minimums for these fields.