Skip to content

Commit

Permalink
Merge branch 'master' into granbery/preset_atomic_write_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty authored Aug 7, 2024
2 parents b3bfdba + e14ce48 commit b25d6a5
Show file tree
Hide file tree
Showing 146 changed files with 6,712 additions and 1,022 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:

qemu-esp32:
Expand Down Expand Up @@ -75,12 +75,7 @@ jobs:
name: Tizen

runs-on: ubuntu-latest
# NOTE: job temporarely disabled as it seems flaky. The flake does not result in usable
# logs so the current theory is that we run out of space. This is unusual as
# larger docker images succeed at bootstrap, however it needs more investigation
# to detect an exact/real root cause.
if: false
# if: github.actor != 'restyled-io[bot]'
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-tizen-qemu:54
Expand Down
107 changes: 1 addition & 106 deletions .github/workflows/tests.yaml

Large diffs are not rendered by default.

33 changes: 21 additions & 12 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
pull_request_rules:
- name: Label conflicting pull requests
description: Add a label to a pull request with conflict to spot it easily
conditions:
- conflict
- '-closed'
actions:
label:
toggle:
- conflict
- name: Automatic merge on PullApprove
conditions:
- or:
- "check-success=pullapprove"
- label="fast track"
- "#approved-reviews-by>=1"
- "#review-threads-unresolved=0"
- "-draft"
- "label!=docker" # Don't auto merge docker images
- "#check-failure=0" # Don't auto merge with a failure
- "#check-pending=0" # Don't auto merge with anything pending
- "check-success~=Build" # Don't auto merge unless a build has succeeded, needed because above is true on a fresh PR before builds
- check-success=pullapprove
- label="fast track"
- '#approved-reviews-by>=1'
- '#review-threads-unresolved=0'
- '-draft'
- label!=docker
- '#check-failure=0'
- '#check-pending=0'
- check-success~=Build
- or:
- "check-success=pullapprove"
- "check-skipped=pullapprove"
- "check-neutral=pullapprove"
- check-success=pullapprove
- check-skipped=pullapprove
- check-neutral=pullapprove
actions:
merge:
method: squash
6 changes: 5 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ config("warnings_third_party") {
}

config("symbols_default") {
cflags = [ "-g${symbol_level}" ]
if (strip_symbols) {
cflags = [ "-s" ]
} else {
cflags = [ "-g${symbol_level}" ]
}
}

config("std_default") {
Expand Down
9 changes: 6 additions & 3 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ declare_args() {
symbol_level = 2

# Enable position independent code (-fPIC).
enable_pic =
current_os == "linux" || current_os == "mac" || current_os == "android"
enable_pic = current_os == "linux" || current_os == "mac" ||
current_os == "android" || current_os == "tizen"

# Enable position independent executables (-pie).
enable_pie = current_os == "linux"
enable_pie = current_os == "linux" || current_os == "tizen"

# Remove unwind tables from the binary to save space.
exclude_unwind_tables = current_os != "android"
Expand All @@ -48,6 +48,9 @@ declare_args() {
# enable libfuzzer
is_libfuzzer = false

# Remove all symbol table and relocation information from the binary.
strip_symbols = false

# Generate code coverage analysis artifacts when enabled.
use_coverage = false

Expand Down
10 changes: 6 additions & 4 deletions examples/all-clusters-app/infineon/psoc6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ will then join the network.

## Building

- [Modustoolbox Software](https://www.cypress.com/products/modustoolbox)
- Download and install
[Modustoolbox Software v3.2](https://www.infineon.com/modustoolbox)

Refer to `integrations/docker/images/chip-build-infineon/Dockerfile` or
`scripts/examples/gn_psoc6_example.sh` for downloading the Software and
Refer to `integrations/docker/images/stage-2/chip-build-infineon/Dockerfile`
or `scripts/examples/gn_psoc6_example.sh` for downloading the Software and
related tools.

- Install some additional tools (likely already present for Matter
Expand Down Expand Up @@ -62,11 +63,12 @@ will then join the network.
- Put CY8CKIT-062S2-43012 board on KitProg3 CMSIS-DAP Mode by pressing the
`MODE SELECT` button. `KITPROG3 STATUS` LED is ON confirms board is in
proper mode.
proper mode. (Modustoolbox Software needs to be installed)
- On the command line:
$ cd ~/connectedhomeip
$ export CY_TOOLS_PATHS=<Modustoolbox install location>/tools_3.2
$ python3 out/infineon-psoc6-all-clusters/chip-psoc6-clusters-example.flash.py
## Commissioning and cluster control
Expand Down
10 changes: 6 additions & 4 deletions examples/all-clusters-minimal-app/infineon/psoc6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ will then join the network.

## Building

- [Modustoolbox Software](https://www.cypress.com/products/modustoolbox)
- Download and install
[Modustoolbox Software v3.2](https://www.infineon.com/modustoolbox)

Refer to `integrations/docker/images/chip-build-infineon/Dockerfile` or
`scripts/examples/gn_psoc6_example.sh` for downloading the Software and
Refer to `integrations/docker/images/stage-2/chip-build-infineon/Dockerfile`
or `scripts/examples/gn_psoc6_example.sh` for downloading the Software and
related tools.

- Install some additional tools (likely already present for Matter
Expand Down Expand Up @@ -62,11 +63,12 @@ will then join the network.
- Put CY8CKIT-062S2-43012 board on KitProg3 CMSIS-DAP Mode by pressing the
`MODE SELECT` button. `KITPROG3 STATUS` LED is ON confirms board is in
proper mode.
proper mode. (Modustoolbox Software needs to be installed)
- On the command line:
$ cd ~/connectedhomeip
$ export CY_TOOLS_PATHS=<Modustoolbox install location>/tools_3.2
$ python3 out/infineon-psoc6-all-clusters-minimal/chip-psoc6-clusters-minimal-example.flash.py
## Commissioning and cluster control
Expand Down
16 changes: 15 additions & 1 deletion examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,34 @@ config("config") {
include_dirs = [ "include" ]
}

chip_data_model("fabric-bridge-common") {
chip_data_model("fabric-bridge-common-zap") {
zap_file = "fabric-bridge-app.zap"
is_server = true
cflags = [ "-DDYNAMIC_ENDPOINT_COUNT=16" ]
}

# This includes all the clusters that only exist on the dynamic endpoint.
source_set("fabric-bridge-common") {
public_configs = [ ":config" ]

sources = [
"${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp",
"${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h",
]

public_deps = [ ":fabric-bridge-common-zap" ]
}

source_set("fabric-bridge-lib") {
public_configs = [ ":config" ]

sources = [
"include/BridgedDevice.h",
"include/BridgedDeviceBasicInformationImpl.h",
"include/BridgedDeviceManager.h",
"include/CHIPProjectAppConfig.h",
"src/BridgedDevice.cpp",
"src/BridgedDeviceBasicInformationImpl.cpp",
"src/BridgedDeviceManager.cpp",
"src/ZCLCallbacks.cpp",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2024 Project CHIP Authors
*
* 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 <app-common/zap-generated/ids/Clusters.h>
#include <app/AttributeAccessInterface.h>

class BridgedDeviceBasicInformationImpl : public chip::app::AttributeAccessInterface
{
public:
BridgedDeviceBasicInformationImpl() :
chip::app::AttributeAccessInterface(chip::NullOptional /* endpointId */,
chip::app::Clusters::BridgedDeviceBasicInformation::Id)
{}

// AttributeAccessInterface implementation
CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & path, chip::app::AttributeValueEncoder & encoder) override;
CHIP_ERROR Write(const chip::app::ConcreteDataAttributePath & path, chip::app::AttributeValueDecoder & decoder) override;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2024 Project CHIP Authors
*
* 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 "BridgedDeviceBasicInformationImpl.h"

#include "BridgedDeviceManager.h"

#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>

#include <app/AttributeAccessInterfaceRegistry.h>

static constexpr unsigned kBridgedDeviceBasicInformationClusterRevision = 4;
static constexpr unsigned kBridgedDeviceBasicInformationFeatureMap = 0;

using namespace ::chip;
using namespace ::chip::app;
using namespace ::chip::app::Clusters;

CHIP_ERROR BridgedDeviceBasicInformationImpl::Read(const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder)
{
// Registration is done for the bridged device basic information only
VerifyOrDie(path.mClusterId == app::Clusters::BridgedDeviceBasicInformation::Id);

BridgedDevice * dev = BridgeDeviceMgr().GetDevice(path.mEndpointId);
VerifyOrReturnError(dev != nullptr, CHIP_ERROR_NOT_FOUND);

switch (path.mAttributeId)
{
case BasicInformation::Attributes::Reachable::Id:
encoder.Encode(dev->IsReachable());
break;
case BasicInformation::Attributes::NodeLabel::Id:
encoder.Encode(CharSpan::fromCharString(dev->GetName()));
break;
case BasicInformation::Attributes::ClusterRevision::Id:
encoder.Encode(kBridgedDeviceBasicInformationClusterRevision);
break;
case BasicInformation::Attributes::FeatureMap::Id:
encoder.Encode(kBridgedDeviceBasicInformationFeatureMap);
break;
default:
return CHIP_ERROR_INVALID_ARGUMENT;
}
return CHIP_NO_ERROR;
}

CHIP_ERROR BridgedDeviceBasicInformationImpl::Write(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder)
{
VerifyOrDie(path.mClusterId == app::Clusters::BridgedDeviceBasicInformation::Id);

BridgedDevice * dev = BridgeDeviceMgr().GetDevice(path.mEndpointId);
VerifyOrReturnError(dev != nullptr, CHIP_ERROR_NOT_FOUND);

if (!dev->IsReachable())
{
return CHIP_ERROR_NOT_CONNECTED;
}

ChipLogProgress(NotSpecified, "Bridged device basic information attempt to write attribute: ep=%d", path.mAttributeId);

// nothing writable right now ...

return CHIP_ERROR_INVALID_ARGUMENT;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ using namespace chip::app::Clusters;

namespace {

constexpr uint8_t kMaxRetries = 10;
constexpr int kNodeLabelSize = 32;
constexpr uint8_t kMaxRetries = 10;
constexpr int kNodeLabelSize = 32;
constexpr int kUniqueIdSize = 32;
constexpr int kVendorNameSize = 32;
constexpr int kProductNameSize = 32;
constexpr int kHardwareVersionSize = 32;
constexpr int kSoftwareVersionSize = 32;

// Current ZCL implementation of Struct uses a max-size array of 254 bytes
constexpr int kDescriptorAttributeArraySize = 254;
Expand Down Expand Up @@ -76,27 +81,51 @@ constexpr int kDescriptorAttributeArraySize = 254;
// - Bridged Device Basic Information
// - Administrator Commissioning

// clang-format off
// Declare Descriptor cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(descriptorAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::DeviceTypeList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* device list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ServerList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* server list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ClientList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* client list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::PartsList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* parts list */
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::DeviceTypeList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* device list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ServerList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* server list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ClientList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* client list */
DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::PartsList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* parts list */
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();

// Declare Bridged Device Basic Information cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::NodeLabel::Id, CHAR_STRING, kNodeLabelSize, 0), /* NodeLabel */
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::Reachable::Id, BOOLEAN, 1, 0), /* Reachable */
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::FeatureMap::Id, BITMAP32, 4, 0), /* feature map */
// The attributes below are MANDATORY in the Bridged Device Information Cluster
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::Reachable::Id, BOOLEAN, 1, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::UniqueID::Id, CHAR_STRING, kUniqueIdSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::FeatureMap::Id, BITMAP32, 4, 0),

// The attributes below are OPTIONAL in the bridged device, however they are MANDATORY in the BasicInformation cluster
// so they can always be provided if desired
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::VendorName::Id, CHAR_STRING, kVendorNameSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::VendorID::Id, INT16U, 2, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::ProductName::Id, CHAR_STRING, kProductNameSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::ProductID::Id, INT16U, 2, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::NodeLabel::Id, CHAR_STRING, kNodeLabelSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::HardwareVersion::Id, INT16U, 2, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::HardwareVersionString::Id, CHAR_STRING,
kHardwareVersionSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::SoftwareVersion::Id, INT32U, 4, 0),
DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::SoftwareVersionString::Id, CHAR_STRING,
kSoftwareVersionSize, 0),
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();

// Declare Ecosystem Information cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(ecosystemInformationBasicAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(EcosystemInformation::Attributes::RemovedOn::Id, EPOCH_US, kNodeLabelSize, ATTRIBUTE_MASK_NULLABLE),
DECLARE_DYNAMIC_ATTRIBUTE(EcosystemInformation::Attributes::DeviceDirectory::Id, ARRAY, kDescriptorAttributeArraySize, 0),
DECLARE_DYNAMIC_ATTRIBUTE(EcosystemInformation::Attributes::LocationDirectory::Id, ARRAY, kDescriptorAttributeArraySize, 0),
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();

// Declare Administrator Commissioning cluster attributes
DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(AdministratorCommissioningAttrs)
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::WindowStatus::Id, ENUM8, 1, 0), /* NodeLabel */
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminFabricIndex::Id, FABRIC_IDX, 1, 0), /* Reachable */
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminVendorId::Id, VENDOR_ID, 2, 0), /* Reachable */
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::WindowStatus::Id, ENUM8, 1, 0),
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminFabricIndex::Id, FABRIC_IDX, 1, 0),
DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminVendorId::Id, VENDOR_ID, 2, 0),
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();
// clang-format on

constexpr CommandId administratorCommissioningCommands[] = {
app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Id,
Expand All @@ -109,6 +138,7 @@ constexpr CommandId administratorCommissioningCommands[] = {
DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedNodeClusters)
DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr),
DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasicInformation::Id, bridgedDeviceBasicAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr),
DECLARE_DYNAMIC_CLUSTER(EcosystemInformation::Id, ecosystemInformationBasicAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr),
DECLARE_DYNAMIC_CLUSTER(AdministratorCommissioning::Id, AdministratorCommissioningAttrs, ZAP_CLUSTER_MASK(SERVER),
administratorCommissioningCommands, nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END;

Expand Down
Loading

0 comments on commit b25d6a5

Please sign in to comment.