Skip to content

[openthread] Dependency inversion in platform & clusters #39441

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

Open
andy31415 opened this issue Jun 6, 2025 · 0 comments · May be fixed by #39461
Open

[openthread] Dependency inversion in platform & clusters #39441

andy31415 opened this issue Jun 6, 2025 · 0 comments · May be fixed by #39461
Assignees

Comments

@andy31415
Copy link
Contributor

#14713 introduced a generic thread driver. However for generic convenience, this also makes the platform create/initialize the corresponding cluster, where src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp

#ifndef _NO_NETWORK_COMMISSIONING_DRIVER_
NetworkCommissioning::GenericThreadDriver sGenericThreadDriver;
Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sGenericThreadDriver);
#endif

The issue with this is that generic platform code starts instantiating and depending on cluster code (which is likely application-specific as it would depend on ember code and overall dependency-wise platform is supposed to be one of the lowest layers in the SDK).

This causes build issues if we try to make network commissioning as a stand-alone buildable unit with dependency management (discovered in #39289).

We need some way for platform to not depend on clusters. ESP32 had the same thing for wifi and ethernet and moved the init calls into an app-specific location in #39346. A similar approach could be taken by openthread instances, however this also means several platforms may need updating.

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 a pull request may close this issue.

2 participants