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

[diag] add network diagnostic data definition and parsing #303

Merged
merged 17 commits into from
Nov 20, 2024

Conversation

ZhangLe2016
Copy link
Contributor

supported TLVs:

  • Ipv6addressList
  • ChildIpv6AddressList
  • Mode
  • ChildTable
  • LeaderData
  • Route64
  • MacCounters
  • Eui64
  • ExtMacAddress
  • MacAddress

supported TLVs:
- Ipv6addressList
- ChildIpv6AddressList
- Mode
- ChildTable
- LeaderData
- Route64
- MacCounters
- Eui64
- ExtMacAddress
- MacAddress
supported TLVs:
- Ipv6addressList
- ChildIpv6AddressList
- Mode
- ChildTable
- LeaderData
- Route64
- MacCounters
- Eui64
- ExtMacAddress
- MacAddress
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
ZhangLe2016 and others added 3 commits October 16, 2024 18:45
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
src/library/commissioner_impl.cpp Outdated Show resolved Hide resolved
src/library/commissioner_impl.cpp Outdated Show resolved Hide resolved
src/library/commissioner_impl.cpp Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
@wgtdkp wgtdkp changed the title [diag] Add network diagnostic data: definition and analysis [diag] Add network diagnostic data: definition and parsing Oct 16, 2024
@wgtdkp wgtdkp changed the title [diag] Add network diagnostic data: definition and parsing [diag] Add network diagnostic data definition and parsing Oct 16, 2024
@wgtdkp wgtdkp changed the title [diag] Add network diagnostic data definition and parsing [diag] add network diagnostic data definition and parsing Oct 16, 2024
Copy link
Member

@wgtdkp wgtdkp left a comment

Choose a reason for hiding this comment

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

Is it possible to add unit tests in commissioner_impl_test.cpp?

Co-authored-by: Kangping <wgtdkp@google.com>
Copy link
Member

@wgtdkp wgtdkp left a comment

Choose a reason for hiding this comment

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

Thanks for resolving the comments!
In internal code review, we asked to mark comments resolved when you followed the suggestion in it and leave the other open. This is useful for reviewers to re-review the code and skip comments which has been resolved. It makes the review much easier.

Can you follow that practice in GitHub as well? For example, you can and should only close comments which you replied "done" :)

Comment on lines 140 to 145
ByteArray mExtMacAddress;
uint16_t mMacAddress = 0;
Route64 mRoute64;
LeaderData mLeaderData;
MacCounters mMacCounters;
std::vector<std::string> mAddrs;
Copy link
Member

Choose a reason for hiding this comment

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

Some place we use "Addr" while some place we use "Address", it doesn't matter which one is used, but it would be better to make it consistent. Looking at existing code, "Addr" is always used for addresses. Can we update the code in PR to follow the existing naming? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, I changed addrs to address

Copy link
Member

Choose a reason for hiding this comment

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

No, if you look at include/commissioner/commissioner.hpp, "Addr" is used but not "Address"

src/library/commissioner_impl.cpp Outdated Show resolved Hide resolved
include/commissioner/network_diag_data.hpp Outdated Show resolved Hide resolved
ZhangLe2016 and others added 2 commits October 17, 2024 05:21
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
@ZhangLe2016
Copy link
Contributor Author

Is it possible to add unit tests in commissioner_impl_test.cpp?

Looks like the unit test cases need to call the API functions defined into commissioner.hpp. For this PR, the new functions are defined in private, I am not sure if we can add corresponding test cases for them, do you have any suggestions?

ZhangLe2016 and others added 2 commits October 17, 2024 06:12
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
@ZhangLe2016
Copy link
Contributor Author

Is it possible to add unit tests in commissioner_impl_test.cpp?

Looks like the unit test cases need to call the API functions defined into commissioner.hpp. For this PR, the new functions are defined in private, I am not sure if we can add corresponding test cases for them, do you have any suggestions?

Added a new unit test case into commissioner_impl_test.cpp

Co-authored-by: Kangping <wgtdkp@google.com>
Copy link
Member

@wgtdkp wgtdkp left a comment

Choose a reason for hiding this comment

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

Looks good to me overall, just minor comments!

src/library/tlv.hpp Outdated Show resolved Hide resolved
src/library/commissioner_impl_test.cpp Outdated Show resolved Hide resolved
ZhangLe2016 and others added 5 commits October 17, 2024 18:10
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
Co-authored-by: Kangping <wgtdkp@google.com>
@ZhangLe2016 ZhangLe2016 requested a review from jwhui October 18, 2024 02:25
Co-authored-by: Kangping <wgtdkp@google.com>
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 76.71958% with 44 lines in your changes missing coverage. Please review.

Project coverage is 72.54%. Comparing base (6a5cddb) to head (76985db).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/library/commissioner_impl.cpp 74.85% 44 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #303      +/-   ##
==========================================
- Coverage   72.75%   72.54%   -0.22%     
==========================================
  Files          72       72              
  Lines        7444     7740     +296     
==========================================
+ Hits         5416     5615     +199     
- Misses       2028     2125      +97     
Files with missing lines Coverage Δ
src/library/commissioner_impl.hpp 96.66% <ø> (+0.23%) ⬆️
src/library/tlv.cpp 62.13% <100.00%> (-5.82%) ⬇️
src/library/commissioner_impl.cpp 74.87% <74.85%> (+0.14%) ⬆️

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@ZhangLe2016
Copy link
Contributor Author

@jwhui Could you please review this PR? Thanks~~

@ZhangLe2016 ZhangLe2016 removed the request for review from lanyuwen November 20, 2024 03:19
@ZhangLe2016
Copy link
Contributor Author

@jwhui, Could you please review this Pull Request for me? and really appreciate your help!

@jwhui jwhui merged commit 67c828a into openthread:main Nov 20, 2024
33 checks passed
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.

3 participants