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

[border agent] refactor border agent to use MeshCoP Service state changed callback #2727

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Irving-cl
Copy link
Contributor

This PR refactors the BorderAgent module to use the new MeshCoP service state changed callback.

Following openthread/openthread#11215, this PR uses the new MeshCoP service state changed callback to obtain the border agent state, udp port and MeshCoP Txt values. With this PR, the BorderAgent module doesn't need to assemble Txt values from OT itself nor need to subscribe to various Thread state change.

This PR is also intended to decouple the BorderAgent module with OT instance (the RCP architecture) and make it can also work for the NCP architecture.

A new ThreadHost API BorderAgentSetMeshCoPServiceChangedCallback is added. In the RCP implementation, it simply uses otBorderAgentSetMeshCoPServiceChangedCallback. The NCP implementation will be added later. This API is invoked to connect the BorderAgent module with the MeshCoP service state change.

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 73.01587% with 17 lines in your changes missing coverage. Please review.

Project coverage is 44.26%. Comparing base (2b41187) to head (b397c9f).
Report is 952 commits behind head on main.

Files with missing lines Patch % Lines
src/border_agent/border_agent.cpp 68.75% 13 Missing and 2 partials ⚠️
src/host/ncp_host.cpp 0.00% 1 Missing ⚠️
src/host/rcp_host.cpp 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2727       +/-   ##
===========================================
- Coverage   55.77%   44.26%   -11.51%     
===========================================
  Files          87      108       +21     
  Lines        6890    12896     +6006     
  Branches        0      957      +957     
===========================================
+ Hits         3843     5709     +1866     
- Misses       3047     6881     +3834     
- Partials        0      306      +306     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant