-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Code Driven All Devices Example App #41607
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
base: master
Are you sure you want to change the base?
Conversation
examples/all-devices-app/all-devices-common/devices/base-device/Device.cpp
Outdated
Show resolved
Hide resolved
|
PR #41607: Size comparison from e9cdfa8 to 1f10a27 Full report (29 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32)
|
examples/all-devices-app/all-devices-common/devices/contact-sensor/ContactSensorDevice.h
Outdated
Show resolved
Hide resolved
...s/all-devices-app/all-devices-common/devices/boolean-state-sensor/BooleanStateSensorDevice.h
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/base-device/Device.cpp
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/base-device/Device.cpp
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/contact-sensor/ContactSensorDevice.h
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/base-device/Device.cpp
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/base-device/Device.cpp
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/contact-sensor/ContactSensorDevice.h
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/root-node/RootNodeDevice.h
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/device-factory/DeviceFactory.h
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/root-node/BUILD.gn
Outdated
Show resolved
Hide resolved
...les/all-devices-app/all-devices-common/devices/water-leak-detector/WaterLeakDetectorDevice.h
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/root-node/RootNodeDevice.cpp
Show resolved
Hide resolved
|
PR #41607: Size comparison from f6366d4 to 9afcb3b Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #41607: Size comparison from f6366d4 to 87e732f Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #41607: Size comparison from f6366d4 to 0256f69 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #41607: Size comparison from f6366d4 to c6210d5 Full report (31 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #41607: Size comparison from f6366d4 to 8f52e9f Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
| import("//build_overrides/pigweed.gni") | ||
|
|
||
| import("${chip_root}/build/chip/tools.gni") | ||
| import("${chip_root}/examples/common/pigweed/rpc_config.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import("${chip_root}/examples/common/pigweed/rpc_config.gni") |
| import("//build_overrides/chip.gni") | ||
| import("//build_overrides/pigweed.gni") | ||
|
|
||
| import("${chip_root}/build/chip/tools.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
|
|
||
| import("${chip_root}/build/chip/tools.gni") | ||
| import("${chip_root}/examples/common/pigweed/rpc_config.gni") | ||
| import("${chip_root}/src/app/common_flags.gni") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done as a follow up. But instead of blindly including this src/app/common_flags.gni we should find a better way to handle this stuff, we're likely setting too many build time configs by importing this common .gni file.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new example application, all-devices-app, which demonstrates the use of the CodeDrivenDataModelProvider for creating devices with code-driven clusters. The changes include new GN build files, C++ classes for device interfaces, boolean state sensors, and root node devices, along with a device factory to dynamically create these devices based on command-line arguments. The new application is also integrated into the build system and CI testing infrastructure. The code is well-structured and follows existing patterns within the repository, promoting modularity and reusability for future device implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new example application called all-devices-app for Linux platforms. The app demonstrates the use of CodeDrivenDataModelProvider with runtime-configurable device types. Currently supports contact sensor and water leak detector devices, with the device type selected via command-line argument at startup.
Key Changes:
- New example app with code-driven data model implementation
- Device factory pattern for runtime device type selection
- Reusable device interface hierarchy for code-driven devices
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/build/builders/host.py | Adds ALL_DEVICES_APP enum and build configuration |
| scripts/build/build/targets.py | Registers all-devices-app as a build target |
| examples/all-devices-app/linux/main.cpp | Main application entry point with device initialization |
| examples/all-devices-app/linux/app_options/* | Command-line argument handling for device type selection |
| examples/all-devices-app/all-devices-common/devices/device-factory/* | Factory pattern for creating different device types |
| examples/all-devices-app/all-devices-common/devices/interface/* | Base device interfaces and single-endpoint device implementation |
| examples/all-devices-app/all-devices-common/devices/boolean-state-sensor/* | Boolean state sensor device implementation |
| examples/all-devices-app/all-devices-common/devices/root-node/* | Root node device with network commissioning |
| examples/providers/AllDevicesExampleDeviceInfoProviderImpl.* | Device info provider for supported locales |
| examples/platform/linux/BUILD.gn | Extracts commissionable data provider into separate source set |
| .github/workflows/tests.yaml | Adds CI build and test configuration |
| src/python_testing/TC_DeviceBasicComposition.py | Adds test run configuration for all-devices-app |
examples/all-devices-app/all-devices-common/devices/interface/SingleEndpointDevice.h
Outdated
Show resolved
Hide resolved
examples/all-devices-app/all-devices-common/devices/interface/DeviceInterface.h
Outdated
Show resolved
Hide resolved
...s/all-devices-app/all-devices-common/devices/boolean-state-sensor/BooleanStateSensorDevice.h
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…ate-sensor/BooleanStateSensorDevice.h Co-authored-by: Copilot <[email protected]>
…DeviceInterface.h Co-authored-by: Copilot <[email protected]>
…SingleEndpointDevice.h Co-authored-by: Copilot <[email protected]>
Summary
This PR creates a new example app, called the
all-devices-app. This is an initial example app using theCodeDrivenDataModelProviderand only code driven clusters that have already been converted upstream. This example app is built for linux, and is configurable as a contact sensor or water leak detector at runtime. Thedevices/sub-directory contains the device types that can be created (which for now are water leak and contact sensor, but also basic root node device types).Testing