Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/ember/server
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Dec 5, 2024
2 parents 5139173 + 6063e23 commit 77b9d57
Show file tree
Hide file tree
Showing 179 changed files with 2,307 additions and 524 deletions.
71 changes: 59 additions & 12 deletions .github/workflows/java-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
build \
"
- name: Run Discover Commissionables Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -115,6 +117,8 @@ jobs:
--factoryreset \
'
- name: Run Pairing Onnetwork Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -126,6 +130,8 @@ jobs:
--factoryreset \
'
- name: Run IM Invoke Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -137,6 +143,8 @@ jobs:
--factoryreset \
'
- name: Run IM Extendable Invoke Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -148,6 +156,8 @@ jobs:
--factoryreset \
'
- name: Run IM Read Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -159,6 +169,8 @@ jobs:
--factoryreset \
'
- name: Run IM Write Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -170,6 +182,8 @@ jobs:
--factoryreset \
'
- name: Run IM Subscribe Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -181,6 +195,8 @@ jobs:
--factoryreset \
'
- name: Run Pairing AlreadyDiscovered Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -191,19 +207,22 @@ jobs:
--tool-args "already-discovered --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \
--factoryreset \
'
# Disabled due to failure: https://github.com/project-chip/connectedhomeip/issues/27361
# - name: Run Pairing Address-PaseOnly Test
# run: |
# scripts/run_in_python_env.sh out/venv \
# './scripts/tests/run_java_test.py \
# --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
# --app-args "--discriminator 3840 --interface-id -1" \
# --tool-path out/linux-x64-java-matter-controller \
# --tool-cluster "pairing" \
# --tool-args "address-paseonly --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \
# --factoryreset \
# '
- name: Run Pairing Address-PaseOnly Test
# Disabled due to failure: https://github.com/project-chip/connectedhomeip/issues/27361
if: false
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
--app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
--app-args "--discriminator 3840 --interface-id -1" \
--tool-path out/linux-x64-java-matter-controller \
--tool-cluster "pairing" \
--tool-args "address-paseonly --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \
--factoryreset \
'
- name: Run Pairing SetupQRCode Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -215,6 +234,8 @@ jobs:
--factoryreset \
'
- name: Run Pairing ManualCode Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -226,6 +247,8 @@ jobs:
--factoryreset \
'
- name: Run Pairing ICD Onnetwork Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
Expand All @@ -236,7 +259,23 @@ jobs:
--tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \
--factoryreset \
'
- name: Run Pairing Onnetwork and get diagnostic log Test
# TODO: test below is disabled because it seems flaky (crashes on pool not being empty on app exit)
# See: https://github.com/project-chip/connectedhomeip/issues/36734
if: false
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_java_test.py \
--app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app \
--app-args "--discriminator 3840 --interface-id -1 --crash_log ./crashLog.log --end_user_support_log ./enduser.log --network_diagnostics_log ./network.log" \
--tool-path out/linux-x64-java-matter-controller \
--tool-cluster "bdx" \
--tool-args "onnetwork-long-downloadLog --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000 --logType CrashLogs --fileName ./crashLog.log" \
--factoryreset \
'
- name: Run Pairing Onnetwork Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_kotlin_test.py \
Expand All @@ -248,6 +287,8 @@ jobs:
--factoryreset \
'
- name: Run Kotlin IM Invoke Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_kotlin_test.py \
Expand All @@ -259,6 +300,8 @@ jobs:
--factoryreset \
'
- name: Run Kotlin IM Read Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_kotlin_test.py \
Expand All @@ -270,6 +313,8 @@ jobs:
--factoryreset \
'
- name: Run Kotlin IM Write Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_kotlin_test.py \
Expand All @@ -281,6 +326,8 @@ jobs:
--factoryreset \
'
- name: Run Kotlin IM Subscribe Test
# Generally completes in seconds
timeout-minutes: 2
run: |
scripts/run_in_python_env.sh out/venv \
'./scripts/tests/run_kotlin_test.py \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ jobs:
--target linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test \
--target linux-x64-fabric-admin-rpc-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang \
--target linux-x64-python-bindings \
build \
Expand All @@ -513,6 +514,7 @@ jobs:
echo "NETWORK_MANAGEMENT_APP: out/linux-x64-network-manager-ipv6only-no-ble-no-wifi-tsan-clang-test/matter-network-manager-app" >> /tmp/test_env.yaml
echo "FABRIC_ADMIN_APP: out/linux-x64-fabric-admin-rpc-ipv6only-no-ble-no-wifi-clang/fabric-admin" >> /tmp/test_env.yaml
echo "FABRIC_BRIDGE_APP: out/linux-x64-fabric-bridge-rpc-ipv6only-no-ble-no-wifi-clang/fabric-bridge-app" >> /tmp/test_env.yaml
echo "FABRIC_SYNC_APP: out/linux-x64-fabric-sync-ipv6only-no-ble-no-wifi-clang/fabric-sync" >> /tmp/test_env.yaml
echo "LIGHTING_APP_NO_UNIQUE_ID: out/linux-x64-light-data-model-no-unique-id-ipv6only-no-ble-no-wifi-clang/chip-lighting-app" >> /tmp/test_env.yaml
echo "TRACE_APP: out/trace_data/app-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
Expand Down
5 changes: 5 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@ To preserve `codegen/zap` generated logic, use
`CodegenDataModelProviderInstance` (see changes in
[36558](https://github.com/project-chip/connectedhomeip/pull/36558) and
[36613](https://github.com/project-chip/connectedhomeip/pull/36613) ).

To use default attribute persistence, you need to pass in a
`PersistentStorageDelegate` to `CodegenDataModelProviderInstance`. See example
changes in [36658](https://github.com/project-chip/connectedhomeip/pull/36658)
).
2 changes: 1 addition & 1 deletion examples/air-purifier-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
static chip::AmebaPersistentStorageOperationalKeystore sAmebaPersistentStorageOpKeystore;
Expand Down
2 changes: 1 addition & 1 deletion examples/air-purifier-app/cc32xx/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int AppTask::Init()
PLAT_LOG("Initialize Server");
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
chip::Server::GetInstance().Init(initParams);

// Initialize device attestation config
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static void InitServer(intptr_t context)
initParams.appDelegate = &sAmebaObserver;

initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);

#if CONFIG_ENABLE_AMEBA_CRYPTO
ChipLogProgress(DeviceLayer, "platform crypto enabled!");
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/asr/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ asr_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/lib",
"${chip_root}/src/platform/logging:default",
"${chip_root}/src/setup_payload",
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ psoc6_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/lib",
"${chip_root}/src/platform/logging:default",
"${chip_root}/src/setup_payload",
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ source_set("chip-all-clusters-common") {
deps = [
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/app/tests/suites/credentials:dac_provider",
"${chip_root}/src/lib",
"${chip_root}/third_party/jsoncpp",
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/linux/fuzzing-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// ChipLinuxAppMainLoop blocks, and we don't want that here.
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
VerifyOrDie(Server::GetInstance().Init(initParams) == CHIP_NO_ERROR);

ApplicationInit();
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int AppTask::Init()
// Init ZCL Data Model and start server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
error = Server::GetInstance().Init(initParams);
if (error != CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mw320_executable("shell_mw320") {
]

deps = [
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/src/platform/logging:default",
]
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ static void run_chip_srv(System::Layer * aSystemLayer, void * aAppState)

static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
chip::Server::GetInstance().Init(initParams);
PRINTF("Done to call chip::Server() \r\n");
}
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ source_set("chip-all-clusters-common") {
deps = [
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/examples/platform/tizen:app-main",
"${chip_root}/src/app:attribute-persistence",
"${chip_root}/src/lib/shell:shell_core",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model and CHIP App Server
static chip::CommonCaseDeviceServerInitParams initParams;
initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = CodegenDataModelProviderInstance();
initParams.dataModelProvider = CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);

static AmebaObserver sAmebaObserver;
initParams.appDelegate = &sAmebaObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void InitServer(intptr_t context)
// Init ZCL Data Model
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/linux/fuzzing-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize)
// ChipLinuxAppMainLoop blocks, and we don't want that here.
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
VerifyOrDie(Server::GetInstance().Init(initParams) == CHIP_NO_ERROR);

ApplicationInit();
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-minimal-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int AppTask::Init()
// Init ZCL Data Model and start server
static chip::CommonCaseDeviceServerInitParams initParams;
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
error = Server::GetInstance().Init(initParams);
if (error != CHIP_NO_ERROR)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ CHIP_ERROR AppTask::Init()
initParams.operationalKeystore = &sPSAOperationalKeystore;
#endif
(void) initParams.InitializeStaticResourcesBeforeServerInit();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance();
initParams.dataModelProvider = app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams));
AppFabricTableDelegate::Init();

Expand Down
9 changes: 9 additions & 0 deletions examples/android/CHIPTool/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@
<data android:scheme="mt" android:host="modelinfo" /> <!-- Process Redirect URIs -->
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>

<queries>
Expand Down
Loading

0 comments on commit 77b9d57

Please sign in to comment.