Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 26842-add-test-scri…
Browse files Browse the repository at this point in the history
…pts-for-replaceable-monitoring-clusters

# Conflicts:
#	src/app/tests/suites/certification/ci-pics-values
#	src/app/tests/suites/ciTests.json
  • Loading branch information
tobiasgraf committed Jun 5, 2023
2 parents 0acc510 + 13cd63a commit 2ae716c
Show file tree
Hide file tree
Showing 197 changed files with 6,221 additions and 4,126 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers"
- name: Clang-tidy validation
timeout-minutes: 45
timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
Expand Down Expand Up @@ -462,7 +462,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default"
- name: Clang-tidy validation
timeout-minutes: 45
timeout-minutes: 60
run: |
./scripts/run_in_build_env.sh \
"./scripts/run-clang-tidy-on-compile-commands.py \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-lock \
--target linux-x64-lock-no-thread \
build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux debug lock-app \
out/linux-x64-lock/chip-lock-app \
out/linux-x64-lock-no-thread/chip-lock-app \
/tmp/bloat_reports/
- name: Build example contact sensor with UI
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target android-arm64-tv-server build"
- name: Clean out build output
run: rm -rf ./out
- name: Build Android arm64-chip-tool
run: |
./scripts/run_in_build_env.sh \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml \
src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \
src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \
"
- name: Build Apps
timeout-minutes: 60
Expand Down Expand Up @@ -509,6 +509,8 @@ jobs:
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_ACE_1_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_ACE_1_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_CGEN_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_5.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values"'
scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py"'
- name: Uploading core files
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
deps += [
"${chip_root}/src/app/server/java",
"${chip_root}/src/controller/java",
"${chip_root}/src/controller/java:onboarding_payload",
"${chip_root}/src/platform/android:java",
"${chip_root}/src/setup_payload/java",
]
}

Expand Down
2 changes: 0 additions & 2 deletions build/chip/chip_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ endfunction()
# GENERATOR "app-templates"
# OUTPUTS
# "zap-generated/access.h",
# "zap-generated/CHIPClientCallbacks.h",
# "zap-generated/CHIPClusters.h"
# "zap-generated/endpoint_config.h",
# "zap-generated/gen_config.h",
Expand Down Expand Up @@ -164,7 +163,6 @@ function(chip_zapgen TARGET_NAME)
"${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt"
"${CHIP_ROOT}/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClusters.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt"
"${CHIP_ROOT}/src/app/zap-templates/templates/app/gen_config.zapt"
Expand Down
1 change: 0 additions & 1 deletion build/chip/chip_codegen.gni
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ template("_chip_build_time_zapgen") {

# Application templates, actually generating files
"${_template_dir}/access.zapt",
"${_template_dir}/CHIPClientCallbacks.zapt",
"${_template_dir}/CHIPClusters.zapt",
"${_template_dir}/endpoint_config.zapt",
"${_template_dir}/gen_config.zapt",
Expand Down
1 change: 0 additions & 1 deletion build/chip/esp32/esp32_codegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ macro(chip_app_component_zapgen ZAP_NAME)
GENERATOR "app-templates"
OUTPUTS
"zap-generated/access.h"
"zap-generated/CHIPClientCallbacks.h"
"zap-generated/CHIPClusters.h"
"zap-generated/endpoint_config.h"
"zap-generated/gen_config.h"
Expand Down
12 changes: 8 additions & 4 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ menu "CHIP Core"
int "Set threshold in ms"
default 700
help
Time threshold for warning that dispatched took too long. You can
set this default set to 0 to to disable event dispatching time
measurement and suppress the logs "Long dispatch time:...".
Time threshold for warning that dispatched took too long. You can
set this default set to 0 to to disable event dispatching time
measurement and suppress the logs "Long dispatch time:...".

# TODO: add log level selection
config CHIP_LOG_FILTERING
bool "CHIP log level filtering APIs"
default n
help
Option to enable/disable CHIP log level filtering APIs.

endmenu # "General Options"

Expand Down
7 changes: 7 additions & 0 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ config CHIP_FACTORY_DATA_VERSION
this value in the factory data provider implementation to verify that the
factory data saved in the flash memory has the expected version.

config CHIP_FACTORY_DATA_ROTATING_DEVICE_UID_MAX_LEN
int "Maximum length of rotating device ID unique ID in bytes"
default 16
depends on CHIP_FACTORY_DATA
help
Maximum acceptable length of rotating device ID unique ID in bytes.

if CHIP_FACTORY_DATA_BUILD

# Factory data definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Status StaticSupportedModesManager::getModeOptionByMode(unsigned short endpointI
return Status::Success;
}
}
emberAfPrintln(EMBER_AF_PRINT_DEBUG, "Cannot find the mode %u", mode);
ChipLogProgress(Zcl, "Cannot find the mode %u", mode);
return Status::InvalidCommand;
}

Expand Down
4 changes: 1 addition & 3 deletions examples/all-clusters-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@
#define APP_USE_THREAD_START_BUTTON 1
#define APP_SET_DEVICE_INFO_PROVIDER 1
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 1
#define APP_USE_IDENTIFY_PWM 1 // APP_USE_IDENTIFY_PWM must be defined before including "AppConfigCommon.h"

#include "AppConfigCommon.h"
#define APP_USE_IDENTIFY_PWM 1
4 changes: 1 addition & 3 deletions examples/all-clusters-minimal-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@
#define APP_USE_THREAD_START_BUTTON 0
#define APP_SET_DEVICE_INFO_PROVIDER 0
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 1
#define APP_USE_IDENTIFY_PWM 0 // APP_USE_IDENTIFY_PWM must be defined before including "AppConfigCommon.h"

#include "AppConfigCommon.h"
#define APP_USE_IDENTIFY_PWM 0
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import chip.setuppayload.SetupPayload
import chip.setuppayload.SetupPayloadParser
import chip.setuppayload.SetupPayloadParser.UnrecognizedQrCodeException
import chip.onboardingpayload.OnboardingPayload
import chip.onboardingpayload.OnboardingPayloadParser
import chip.onboardingpayload.UnrecognizedQrCodeException
import com.google.chip.chiptool.provisioning.AddressCommissioningFragment
import com.google.chip.chiptool.provisioning.DeviceProvisioningFragment
import com.google.chip.chiptool.provisioning.EnterNetworkFragment
Expand Down Expand Up @@ -151,10 +151,10 @@ class CHIPToolActivity :
val uri = records[0].toUri()
if (!uri?.scheme.equals("mt", true)) return

lateinit var setupPayload: SetupPayload
lateinit var setupPayload: OnboardingPayload
try {
setupPayload =
SetupPayloadParser().parseQrCode(uri.toString().toUpperCase())
OnboardingPayloadParser().parseQrCode(uri.toString().toUpperCase())
} catch (ex: UnrecognizedQrCodeException) {
Log.e(TAG, "Unrecognized QR Code", ex)
Toast.makeText(this, "Unrecognized QR Code", Toast.LENGTH_SHORT).show()
Expand Down Expand Up @@ -208,10 +208,10 @@ class CHIPToolActivity :
val payload = JSONObject(payloadString)

// parse payload from JSON
val setupPayload = SetupPayload()
val setupPayload = OnboardingPayload()
// set defaults
setupPayload.discoveryCapabilities = setOf()
setupPayload.optionalQRCodeInfo = mapOf()
setupPayload.optionalQRCodeInfo = HashMap()

// read from payload
setupPayload.version = payload.getInt("version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.checkSelfPermission
import androidx.fragment.app.Fragment
import chip.setuppayload.SetupPayload
import chip.setuppayload.SetupPayloadParser
import chip.setuppayload.SetupPayloadParser.SetupPayloadException
import chip.setuppayload.SetupPayloadParser.InvalidEntryCodeFormatException
import chip.setuppayload.SetupPayloadParser.UnrecognizedQrCodeException
import chip.onboardingpayload.OnboardingPayload
import chip.onboardingpayload.OnboardingPayloadException
import chip.onboardingpayload.OnboardingPayloadParser
import chip.onboardingpayload.UnrecognizedQrCodeException
import com.google.chip.chiptool.R
import com.google.chip.chiptool.SelectActionFragment
import com.google.chip.chiptool.databinding.BarcodeFragmentBinding
Expand Down Expand Up @@ -182,14 +181,12 @@ class BarcodeFragment : Fragment() {
}

private fun handleInputQrCode(qrCode: String) {
lateinit var payload: SetupPayload
var isShortDiscriminator = false
lateinit var payload: OnboardingPayload
try {
payload = SetupPayloadParser().parseQrCode(qrCode)
} catch (ex: SetupPayloadException) {
payload = OnboardingPayloadParser().parseQrCode(qrCode)
} catch (ex: OnboardingPayloadException) {
try {
payload = SetupPayloadParser().parseManualEntryCode(qrCode)
isShortDiscriminator = true
payload = OnboardingPayloadParser().parseManualPairingCode(qrCode)
} catch (ex: Exception) {
Log.e(TAG, "Unrecognized Manual Pairing Code", ex)
Toast.makeText(requireContext(), "Unrecognized Manual Pairing Code", Toast.LENGTH_SHORT).show()
Expand All @@ -199,14 +196,14 @@ class BarcodeFragment : Fragment() {
Toast.makeText(requireContext(), "Unrecognized QR Code", Toast.LENGTH_SHORT).show()
}
FragmentUtil.getHost(this@BarcodeFragment, Callback::class.java)
?.onCHIPDeviceInfoReceived(CHIPDeviceInfo.fromSetupPayload(payload, isShortDiscriminator))
?.onCHIPDeviceInfoReceived(CHIPDeviceInfo.fromSetupPayload(payload))
}

private fun handleScannedQrCode(barcode: Barcode) {
Handler(Looper.getMainLooper()).post {
lateinit var payload: SetupPayload
lateinit var payload: OnboardingPayload
try {
payload = SetupPayloadParser().parseQrCode(barcode.displayValue)
payload = barcode.displayValue?.let { OnboardingPayloadParser().parseQrCode(it) } ?: return@post
} catch (ex: UnrecognizedQrCodeException) {
Log.e(TAG, "Unrecognized QR Code", ex)
Toast.makeText(requireContext(), "Unrecognized QR Code", Toast.LENGTH_SHORT).show()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package com.google.chip.chiptool.setuppayloadscanner

import android.os.Parcelable
import chip.setuppayload.DiscoveryCapability
import chip.setuppayload.SetupPayload
import chip.onboardingpayload.DiscoveryCapability
import chip.onboardingpayload.OnboardingPayload
import kotlinx.parcelize.Parcelize

/** Class to hold the CHIP device information. */
Expand All @@ -36,16 +36,15 @@ data class CHIPDeviceInfo(
val discoveryCapabilities: Set<DiscoveryCapability> = setOf(),
val isShortDiscriminator: Boolean = false,
val ipAddress: String? = null,

) : Parcelable {

companion object {
fun fromSetupPayload(setupPayload: SetupPayload, isShortDiscriminator: Boolean = false): CHIPDeviceInfo {
fun fromSetupPayload(setupPayload: OnboardingPayload): CHIPDeviceInfo {
return CHIPDeviceInfo(
setupPayload.version,
setupPayload.vendorId,
setupPayload.productId,
setupPayload.discriminator,
setupPayload.getLongDiscriminatorValue(),
setupPayload.setupPinCode,
setupPayload.commissioningFlow,
setupPayload.optionalQRCodeInfo.mapValues { (_, info) ->
Expand All @@ -57,7 +56,7 @@ data class CHIPDeviceInfo(
)
},
setupPayload.discoveryCapabilities,
isShortDiscriminator
setupPayload.hasShortDiscriminator
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.google.chip.chiptool.setuppayloadscanner

import android.os.Parcelable
import chip.setuppayload.OptionalQRCodeInfo.OptionalQRCodeInfoType
import chip.onboardingpayload.OptionalQRCodeInfo.OptionalQRCodeInfoType
import kotlinx.parcelize.Parcelize

@Parcelize
data class QrCodeInfo(
val tag: Int,
val type: OptionalQRCodeInfoType,
val data: String,
val data: String?,
val intDataValue: Int
) : Parcelable
4 changes: 2 additions & 2 deletions examples/bridge-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CHIP ESP32 Bridge App Example
# Matter ESP32 Bridge App Example

Please
[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md)
[setup ESP-IDF and Matter Environment](../../../docs/guides/esp32/setup_idf_chip.md)
and refer
[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md)
guides to get started.
Expand Down
6 changes: 3 additions & 3 deletions examples/bridge-app/linux/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# CHIP Linux Bridge Example
# Matter Linux Bridge Example

An example demonstrating a simple lighting bridge and the use of dynamic
endpoints. The document will describe the theory of operation and how to build
and run CHIP Linux Bridge Example on Raspberry Pi. This doc is tested on
and run Matter Linux Bridge Example on Raspberry Pi. This doc is tested on
**Ubuntu for Raspberry Pi Server 20.04 LTS (aarch64)** and **Ubuntu for
Raspberry Pi Desktop 20.10 (aarch64)**

<hr>

- [CHIP Linux Bridge Example](#chip-linux-bridge-example)
- [Matter Linux Bridge Example](#matter-linux-bridge-example)
- [Theory of Operation](#theory-of-operation)
- [Building](#building)
- [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4)
Expand Down
6 changes: 1 addition & 5 deletions examples/bridge-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@
#define APP_USE_THREAD_START_BUTTON 1
#define APP_SET_DEVICE_INFO_PROVIDER 1
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 0
#define APP_USE_IDENTIFY_PWM 1 // APP_USE_IDENTIFY_PWM must be defined before including "AppConfigCommon.h"

#include "AppConfigCommon.h"

#define LIGHTING_PWM_SPEC_RGB_BLUE PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0))
#define APP_USE_IDENTIFY_PWM 1
2 changes: 1 addition & 1 deletion examples/bridge-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);

namespace {
const struct pwm_dt_spec sPwmRgbSpecBlueLed = LIGHTING_PWM_SPEC_RGB_BLUE;
const struct pwm_dt_spec sPwmRgbSpecBlueLed = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));
} // namespace

AppTask AppTask::sAppTask;
Expand Down
5 changes: 5 additions & 0 deletions examples/chip-tool/commands/common/RemoteDataModelLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <lib/support/SafeInt.h>
#include <lib/support/jsontlv/TlvJson.h>

constexpr const char * kDataVersionKey = "dataVersion";
constexpr const char * kClusterIdKey = "clusterId";
constexpr const char * kEndpointIdKey = "endpointId";
constexpr const char * kAttributeIdKey = "attributeId";
Expand Down Expand Up @@ -69,6 +70,10 @@ CHIP_ERROR LogAttributeAsJSON(const chip::app::ConcreteDataAttributePath & path,
value[kClusterIdKey] = path.mClusterId;
value[kEndpointIdKey] = path.mEndpointId;
value[kAttributeIdKey] = path.mAttributeId;
if (path.mDataVersion.HasValue())
{
value[kDataVersionKey] = path.mDataVersion.Value();
}

chip::TLV::TLVReader reader;
reader.Init(*data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
_ERROR = 'error'
_CLUSTER_ERROR = 'clusterError'
_VALUE = 'value'
_DATA_VERSION = 'dataVersion'

# FabricIndex is a special case where the field is added as a struct field by the SDK
# if needed but is not part of the XML definition of the struct.
Expand Down Expand Up @@ -88,7 +89,7 @@ def __translate_names(self, payloads):
elif key == _EVENT_ID:
key = _EVENT
value = specs.get_event_name(payload[_CLUSTER_ID], value)
elif key == _VALUE or key == _ERROR or key == _CLUSTER_ERROR:
elif key == _VALUE or key == _ERROR or key == _CLUSTER_ERROR or key == _DATA_VERSION:
pass
else:
# Raise an error since the other fields probably needs to be translated too.
Expand Down
6 changes: 1 addition & 5 deletions examples/contact-sensor-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@
#define APP_USE_THREAD_START_BUTTON 0
#define APP_SET_DEVICE_INFO_PROVIDER 1
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 0
#define APP_USE_IDENTIFY_PWM 1 // APP_USE_IDENTIFY_PWM must be defined before including "AppConfigCommon.h"

#include "AppConfigCommon.h"

#define CONTACT_STATE_LED 6
#define APP_USE_IDENTIFY_PWM 1
Loading

0 comments on commit 2ae716c

Please sign in to comment.