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

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

Conversation

Irving-cl
Copy link
Contributor

@Irving-cl Irving-cl commented Feb 19, 2025

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.

This PR also updates the DBus method 'Get/SetEphemeralKey' implementation to use OT API because with the new design the bit indicating IsEphemeralKeyEnabled is managed by OT core.

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 73.91304% with 18 lines in your changes missing coverage. Please review.

Project coverage is 43.46%. Comparing base (2b41187) to head (d9c61db).
Report is 963 commits behind head on main.

Files with missing lines Patch % Lines
src/border_agent/border_agent.cpp 78.72% 8 Missing and 2 partials ⚠️
src/dbus/server/dbus_thread_object_rcp.cpp 0.00% 5 Missing ⚠️
src/host/rcp_host.cpp 81.81% 1 Missing and 1 partial ⚠️
src/host/ncp_host.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2727       +/-   ##
===========================================
- Coverage   55.77%   43.46%   -12.32%     
===========================================
  Files          87      110       +23     
  Lines        6890    13370     +6480     
  Branches        0      951      +951     
===========================================
+ Hits         3843     5811     +1968     
- Misses       3047     7254     +4207     
- Partials        0      305      +305     

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

@Irving-cl
Copy link
Contributor Author

Pending on the this PR in openthread: openthread/openthread#11276

@Irving-cl Irving-cl marked this pull request as draft February 25, 2025 08:50
@Irving-cl Irving-cl force-pushed the thread_host_ba_api branch 3 times, most recently from 17e8bd6 to 507e833 Compare February 27, 2025 23:09
@Irving-cl
Copy link
Contributor Author

Pending on openthread/openthread#11310

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