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

[ncp] implement dbus server for NCP mode #2339

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

Irving-cl
Copy link
Contributor

@Irving-cl Irving-cl commented Jun 20, 2024

This PR refactors the DBusAgent so that it can work under NCP mode.

The DBus server will provide different methods under RCP mode and NCP mode. Currently under NCP mode, only GetDeviceRole is provided.

This PR renames DBusThreadObject to DBusThreadObjectRcp and added a new class DBusThreadObjectNcp which will handle the DBus requests under NCP mode. This PR also implements AsyncPropertyHandler to handle GetProperty requests by calling async methods of NcpHost.

A test case is added to test GetDeviceRole under NCP.

This PR is also a breakdown of PR #2283.

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 31.93717% with 260 lines in your changes missing coverage. Please review.

Project coverage is 37.59%. Comparing base (2b41187) to head (b5a77cd).
Report is 701 commits behind head on main.

Files Patch % Lines
src/dbus/server/dbus_thread_object_rcp.cpp 37.02% 165 Missing ⚠️
src/common/types.cpp 0.00% 27 Missing ⚠️
src/dbus/server/dbus_thread_object_ncp.cpp 0.00% 26 Missing ⚠️
src/dbus/server/dbus_object.cpp 25.80% 22 Missing and 1 partial ⚠️
src/agent/application.cpp 35.00% 13 Missing ⚠️
src/dbus/server/dbus_agent.cpp 54.54% 5 Missing ⚠️
src/ncp/ncp_host.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2339       +/-   ##
===========================================
- Coverage   55.77%   37.59%   -18.18%     
===========================================
  Files          87       94        +7     
  Lines        6890    10668     +3778     
  Branches        0      766      +766     
===========================================
+ Hits         3843     4011      +168     
- Misses       3047     6457     +3410     
- Partials        0      200      +200     

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

@Irving-cl Irving-cl marked this pull request as ready for review June 20, 2024 10:14
@Irving-cl Irving-cl force-pushed the support_ncp_dbus branch 3 times, most recently from 4c63dd0 to 03edbdd Compare June 21, 2024 10:50
src/agent/application.cpp Show resolved Hide resolved
src/dbus/server/dbus_agent.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_object.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_object.cpp Show resolved Hide resolved
src/dbus/server/dbus_object.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_thread_object_ncp.hpp Outdated Show resolved Hide resolved
@Irving-cl Irving-cl force-pushed the support_ncp_dbus branch 3 times, most recently from 41f531a to 9d81f99 Compare June 25, 2024 02:51
@Irving-cl Irving-cl requested a review from superwhd June 25, 2024 02:52
@Irving-cl Irving-cl force-pushed the support_ncp_dbus branch 4 times, most recently from 23c07e3 to ffedfef Compare June 25, 2024 09:48
src/dbus/server/dbus_agent.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_agent.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_thread_object_ncp.cpp Outdated Show resolved Hide resolved
src/dbus/server/dbus_thread_object_ncp.cpp Show resolved Hide resolved
Copy link
Contributor

@superwhd superwhd left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Irving-cl Irving-cl requested a review from jwhui June 26, 2024 04:51
Comment on lines 57 to 58
* @{
* @}
Copy link
Member

Choose a reason for hiding this comment

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

Should this be an empty block?

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 copied this from dbus_thread_object_rcp.hpp. But this is not correct. I fixed it in both headers.

@jwhui jwhui merged commit edfb0c4 into openthread:main Jun 27, 2024
32 checks passed
@Irving-cl Irving-cl deleted the support_ncp_dbus branch June 28, 2024 02:41
@Irving-cl Irving-cl mentioned this pull request Jul 23, 2024
17 tasks
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.

4 participants