[all-devices-app] Remove dependency on global LinuxDeviceOptions and add --KVS, --discriminator, --vendor-id and --product-id support#71735
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the application options into a centralized AppConfig structure and introduces new command-line arguments for the KVS path and setup discriminator. The review feedback highlights the need for robust input validation on the discriminator value to prevent unexpected behavior, suggests returning a const reference from GetConfig to prevent accidental modifications, and points out that the refactoring removed default device configuration logic which could cause issues when no arguments are provided.
|
PR #71735: Size comparison from e2dc005 to 723d1e8 Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #71735 +/- ##
==========================================
- Coverage 54.81% 54.81% -0.01%
==========================================
Files 1603 1603
Lines 109834 109834
Branches 13452 13452
==========================================
- Hits 60203 60202 -1
- Misses 49631 49632 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
794cfd4 to
c2c7728
Compare
|
PR #71735: Size comparison from c383110 to 39d9976 Full report (3 builds for realtek, stm32)
|
df13d97 to
9c02903
Compare
63ab458 to
1399267
Compare
cc100df to
4a10b0b
Compare
45fadcb to
f3d0dd9
Compare
|
PR #71735: Size comparison from f76eca9 to f3d0dd9 Full report (6 builds for cc32xx, nrfconnect, realtek, stm32)
|
…ovider and add safe fallbacks
e5cdf71 to
9eba06f
Compare
for more information, see https://pre-commit.ci
|
PR #71735: Size comparison from f76eca9 to a1b4f94 Full report (34 builds for bl602, bl616, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
This PR refactors
all-devices-appto remove its reliance on the globalLinuxDeviceOptionssingleton and centralizes its specific providers in theall-devices-commondirectory.Key Changes
Configuration and Options
ParseArgumentsfunction.--KVSoption, allowing specification of a custom Key-Value Store file path.--discriminatorby parsing it locally with validation (ensuring 12-bit value).--vendor-idand--product-idoptions to override default values dynamically.--portoption to override the default Matter port (5540), allowing multiple instances to run without port conflicts.AppOptionsto use a localAppConfigstruct instead of global state.GetConfig()return a const reference and restoring the default device fallback ("contact-sensor" on endpoint 1).deviceConfigstodeviceTypeEntriesfor consistency withDeviceTypeParser.Providers
DeviceInstanceInfoProviderImplinall-devices-common(moved and renamed fromAppDeviceInstanceInfoProvider) to handle VID/PID overrides via dependency injection.DeviceInfoProviderImplinall-devices-commonto provide supported locales, fixed labels, etc., removing the dependency onexamples/providers/AllClustersExampleDeviceInfoProviderImplandAllDevicesExampleDeviceInfoProviderImpl.AllDevicesExampleDeviceInfoProviderImplfromexamples/providers/as it is no longer needed.Build System
BUILD.gninexamples/all-devices-app/all-devices-common/to manage the new providers.examples/all-devices-app/posix/BUILD.gnandexamples/providers/BUILD.gnto reflect the provider changes.Testing
./all-devices-app --KVS out/test_kvs/kvs3.ini --discriminator 1234 --vendor-id 0x6006 --product-id 0xFE00 --port 5555sscommand.chip-toolwithpairing onnetwork-long.--bypass-attestation-verifier truewas used withchip-tool.Basic Informationcluster correctly reported the overridden values.