openthread / ot-br-posix

OpenThread Border Router, a Thread border router for POSIX-based platforms.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
420 stars 235 forks source link

[mdns] refactor mDNS State subscription #2560

Closed Irving-cl closed 3 weeks ago

Irving-cl commented 4 weeks ago

This PR refactors the mDNS State subscription using the Subject-Observer pattern.

The PR makes the state subscription more flexible. Currently the mDNS state is published in Application::HandleMdnsState. Now we have both NCP and RCP case. This function will be difficult to implement. With this new pattern, we can register different observers during NCP/RCP initialization.

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 45.97%. Comparing base (2b41187) to head (1de3e32). Report is 845 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2560 +/- ## ========================================== - Coverage 55.77% 45.97% -9.81% ========================================== Files 87 104 +17 Lines 6890 12392 +5502 Branches 0 904 +904 ========================================== + Hits 3843 5697 +1854 - Misses 3047 6385 +3338 - Partials 0 310 +310 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.