Skip to content

Commit

Permalink
Fix master merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsalghelani-csa committed Oct 9, 2024
2 parents 7931453 + b3aeb67 commit 89f3cf0
Show file tree
Hide file tree
Showing 204 changed files with 3,212 additions and 1,843 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ jobs:
scripts/build_python_device.sh --chip_detail_logging true
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
name: Build on Darwin (clang, simulated)
runs-on: macos-13
if: github.actor != 'restyled-io[bot]'

Expand All @@ -402,27 +402,20 @@ jobs:
CHIP_ROOT_PATH=examples/placeholder/linux
CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS"
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
- name: Setup Build, Run Build and Run Tests
- name: Setup Build, Run Build and Run Tests (asan + target_os=all)
# We can't enable leak checking here in LSAN_OPTIONS, because on
# Darwin that's only supported with a new enough clang, and we're
# not building with the pigweed clang here.
env:
BUILD_TYPE: default
run: |
for BUILD_TYPE in default python_lib; do
case $BUILD_TYPE in
# We want to build various standalone example apps
# (similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked
# up as part of the "unified" build. But then to
# save CI resources we want to exclude the
# "host clang" build, which uses the pigweed
# clang.
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
esac
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh
done
- name: Ensure codegen is done for sanitize
# We want to build various standalone example apps similar to what examples-linux-standalone.yaml
# does), so use target_os="all" to get those picked up as part of the "unified" build. But then
# to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang.
scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"
scripts/tests/gn_tests.sh
- name: Ensure codegen is done for default
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default"
- name: Clang-tidy validation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ jobs:
"
- name: Run Tests
run: |
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factory-reset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"'
- name: Uploading core files
uses: actions/upload-artifact@v4
if: ${{ failure() && !env.ACT }}
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/matter-repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ Some tests provides the option to exclude them. For example, you can use
It is recommended to use the test wrapper to run mobile-device-test.py, for
example, you can run:
```
./scripts/tests/run_python_test.py --app chip-all-clusters-app --factoryreset
```shell
./scripts/tests/run_python_test.py --app chip-all-clusters-app --factory-reset
```

It provides some extra options, for example:
Expand All @@ -254,7 +254,7 @@ It provides some extra options, for example:
optional arguments:
-h, --help show this help message and exit
--app APP Path to local application to use, omit to use external apps.
--factoryreset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests.
--factory-reset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests.
--app-args APP_ARGS The extra parameters passed to the device side app.
--script SCRIPT Path to the test script to use, omit to use the default test script (mobile-device-test.py).
--script-args SCRIPT_ARGS Arguments for the REPL test script
Expand All @@ -263,8 +263,8 @@ optional arguments:
You can pass your own flags for mobile-device-test.py by appending them to the
command line with two dashes, for example:

```
./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factoryreset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout"
```shell
./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factory-reset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout"
```

will pass `-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout` to
Expand Down
10 changes: 6 additions & 4 deletions docs/testing/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Python tests located in src/python_testing
# --passcode 20202021
# --trace-to json:${TRACE_TEST_JSON}.json
# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
# factoryreset: true
# factory-reset: true
# quiet: true
# === END CI TEST ARGUMENTS ===
Expand Down Expand Up @@ -627,7 +627,9 @@ for the CI). These arguments can be passed as sets of key/value pairs using the
`./scripts/tests/run_python_test.py` is a convenient script that starts an
example DUT on the host and includes factory reset support

`./scripts/tests/run_python_test.py --factoryreset --app <your_app> --app-args "whatever" --script <your_script> --script-args "whatever"`
```shell
./scripts/tests/run_python_test.py --factory-reset --app <your_app> --app-args "whatever" --script <your_script> --script-args "whatever"
```

# Running tests in CI

Expand Down Expand Up @@ -678,7 +680,7 @@ for that run, e.g.:
# app: ${TYPE_OF_APP}
# app-args: <app_arguments>
# script-args: <script_arguments>
# factoryreset: <true|false>
# factory-reset: <true|false>
# quiet: <true|false>
# === END CI TEST ARGUMENTS ===
```
Expand All @@ -692,7 +694,7 @@ for that run, e.g.:

- Example: `${TYPE_OF_APP}`

- `factoryreset`: Determines whether a factory reset should be performed
- `factory-reset`: Determines whether a factory reset should be performed
before the test.

- Example: `true`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class DeviceProvisioningFragment : Fragment() {
override fun onICDRegistrationInfoRequired() {
Log.d(TAG, "onICDRegistrationInfoRequired")
deviceController.updateCommissioningICDRegistrationInfo(
ICDRegistrationInfo.newBuilder().build()
ICDRegistrationInfo.newBuilder().setICDStayActiveDurationMsec(30000L).build()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ void chip::NXP::App::ButtonApp::HandleShortPress()

void chip::NXP::App::ButtonApp::HandleLongPress()
{
chip::DeviceLayer::PlatformMgrImpl().CleanReset();
// Execute "clean" reset
chip::DeviceLayer::PlatformMgr().ScheduleWork(
[](intptr_t arg) {
chip::DeviceLayer::PlatformMgr().StopEventLoopTask();
chip::DeviceLayer::PlatformMgr().Shutdown();
chip::DeviceLayer::PlatformMgrImpl().Reset();
},
(intptr_t) nullptr);
}

void chip::NXP::App::ButtonApp::HandleDoubleClick()
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ CHIP_ERROR BaseApplication::Init()
ChipLogProgress(AppServer, "APP: Wait WiFi Init");
while (!wfx_hw_ready())
{
vTaskDelay(pdMS_TO_TICKS(10));
osDelay(pdMS_TO_TICKS(10));
}
ChipLogProgress(AppServer, "APP: Done WiFi Init");
/* We will init server when we get IP */
Expand Down
67 changes: 67 additions & 0 deletions examples/platform/silabs/Si70xxSensor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2019 Google LLC.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "sl_board_control.h"
#include "sl_i2cspm_instances.h"
#include "sl_si70xx.h"
#include <Si70xxSensor.h>
#include <lib/support/CodeUtils.h>

namespace {

constexpr uint16_t kSensorTemperatureOffset = 475;
bool initialized = false;

} // namespace

namespace Si70xxSensor {

sl_status_t Init()
{
sl_status_t status = SL_STATUS_OK;

status = sl_board_enable_sensor(SL_BOARD_SENSOR_RHT);
VerifyOrReturnError(status == SL_STATUS_OK, status);

status = sl_si70xx_init(sl_i2cspm_sensor, SI7021_ADDR);
VerifyOrReturnError(status == SL_STATUS_OK, status);

initialized = true;
return status;
}

sl_status_t GetSensorData(uint16_t & relativeHumidity, int16_t & temperature)
{
VerifyOrReturnError(initialized, SL_STATUS_NOT_INITIALIZED);

sl_status_t status = SL_STATUS_OK;
int32_t tempTemperature = 0;
uint32_t tempHumidity = 0;

status = sl_si70xx_measure_rh_and_temp(sl_i2cspm_sensor, SI7021_ADDR, &tempHumidity, &tempTemperature);
VerifyOrReturnError(status == SL_STATUS_OK, status);

// Sensor precision is milliX. We need to reduce to change the precision to centiX to fit with the cluster attributes presicion.
temperature = static_cast<int16_t>(tempTemperature / 10) - kSensorTemperatureOffset;
relativeHumidity = static_cast<uint16_t>(tempHumidity / 10);

return status;
}

}; // namespace Si70xxSensor
48 changes: 48 additions & 0 deletions examples/platform/silabs/Si70xxSensor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2019 Google LLC.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "sl_status.h"
#include <stdint.h>

namespace Si70xxSensor {

/**
* @brief Initialises the Si70xx Sensor.
*
* @return sl_status_t SL_STATUS_OK if there were no errors occured during initialisation.
* Error if an underlying platform error occured
*/
sl_status_t Init();

/**
* @brief Reads Humidity and temperature values from the Si70xx sensor.
* The init function must be called before calling the GetSensorData.
*
* @param[out] relativeHumidity Relative humidity percentage in centi-pourcentage (1000 == 10.00%)
* @param[out] temperature Ambiant temperature in centi-celsium (1000 == 10.00C)
*
* @return sl_status_t SL_STATUS_OK if there were no errors occured during initialisation.
* SL_STATUS_NOT_INITIALIZED if the sensor was not initialised
* Error if an underlying platform error occured
*/
sl_status_t GetSensorData(uint16_t & relativeHumidity, int16_t & temperature);

}; // namespace Si70xxSensor
7 changes: 7 additions & 0 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ source_set("siwx917-common") {
public_deps += [ ":test-event-trigger" ]
}

if (sl_enable_si70xx_sensor) {
sources += [
"${silabs_common_plat_dir}/Si70xxSensor.cpp",
"${silabs_common_plat_dir}/Si70xxSensor.h",
]
}

if (app_data_model != "") {
public_deps += [ app_data_model ]
}
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/SoftwareFaultReports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*/

#include "SoftwareFaultReports.h"
#include "FreeRTOS.h"
#include "silabs_utils.h"
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
#include <app/util/attribute-storage.h>
#include <cmsis_os2.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down Expand Up @@ -75,7 +75,7 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString)
// Allow some time for the Fault event to be sent as the next action after exiting this function
// is typically an assert or reboot.
// Depending on the task at fault, it is possible the event can't be transmitted.
vTaskDelay(pdMS_TO_TICKS(1000));
osDelay(pdMS_TO_TICKS(1000));
#endif // MATTER_DM_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER
}

Expand Down
62 changes: 0 additions & 62 deletions examples/platform/silabs/TemperatureSensor.cpp

This file was deleted.

Loading

0 comments on commit 89f3cf0

Please sign in to comment.