Skip to content

Commit

Permalink
Merging from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Bultman committed Aug 5, 2024
2 parents ba8e1d6 + c53d771 commit ac018f2
Show file tree
Hide file tree
Showing 107 changed files with 2,771 additions and 2,143 deletions.
9 changes: 9 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ test driver:
- src/test_driver/*
- src/test_driver/**/*

# Cert tests touched: add current milestone delta-tracking label.
# TODO: Change after Aug 15, 2024
matter-1.4-te2-script-change:
- changed-files:
- any-glob-to-any-file:
- src/python_testing/*
- src/python_testing/**/*
- src/app/tests/suites/certification/*

############################################################
# Source Code
############################################################
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_FAN_3_5.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_3_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_3_3.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDManagementCluster.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_IDM_1_4.py'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6273,7 +6273,7 @@ cluster RelativeHumidityMeasurement = 1029 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4710,7 +4710,7 @@ cluster RelativeHumidityMeasurement = 1029 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down Expand Up @@ -6904,7 +6904,7 @@ endpoint 1 {
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute clusterRevision default = 5;
}

server cluster WakeOnLan {
Expand Down Expand Up @@ -7257,7 +7257,7 @@ endpoint 2 {
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute clusterRevision default = 5;
}
}
endpoint 65534 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8014,7 +8014,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -11936,7 +11936,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ cluster FixedLabel = 64 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ cluster FixedLabel = 64 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ provisional cluster ScenesManagement = 98 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,7 @@ cluster FixedLabel = 64 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down Expand Up @@ -1919,7 +1919,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 2;
ram attribute clusterRevision default = 5;
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2993,7 +2993,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "2",
"defaultValue": "5",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -3022,4 +3022,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ cluster RelativeHumidityMeasurement = 1029 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/sample_app_util/test_files/sample_zap_file.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5654,7 +5654,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -5683,4 +5683,4 @@
"parentEndpointIdentifier": null
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ cluster BooleanState = 69 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down Expand Up @@ -2356,7 +2356,7 @@ endpoint 1 {
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute clusterRevision default = 5;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4721,7 +4721,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -4750,4 +4750,4 @@
"parentEndpointIdentifier": null
}
]
}
}
4 changes: 2 additions & 2 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ cluster ColorControl = 768 {

/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */
cluster OccupancySensing = 1030 {
revision 4;
revision 5;

enum OccupancySensorTypeEnum : enum8 {
kPIR = 0;
Expand Down Expand Up @@ -3180,7 +3180,7 @@ endpoint 1 {
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute clusterRevision default = 5;
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -5903,7 +5903,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
1 change: 1 addition & 0 deletions examples/network-manager-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ executable("matter-network-manager-app") {
sources = [
"include/CHIPProjectAppConfig.h",
"main.cpp",
"tbrm.cpp",
]

deps = [
Expand Down
131 changes: 131 additions & 0 deletions examples/network-manager-app/linux/tbrm.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*
* Copyright (c) 2024 Project CHIP Authors
* 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 <app/clusters/thread-border-router-management-server/thread-border-router-management-server.h>
#include <app/server/Server.h>
#include <lib/core/CHIPEncoding.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/Span.h>
#include <lib/support/ThreadOperationalDataset.h>
#include <platform/CHIPDeviceLayer.h>

#include <optional>

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

namespace {
class FakeBorderRouterDelegate final : public ThreadBorderRouterManagement::Delegate
{
CHIP_ERROR Init(AttributeChangeCallback * attributeChangeCallback) override
{
mAttributeChangeCallback = attributeChangeCallback;
return CHIP_NO_ERROR;
}

bool GetPanChangeSupported() override { return true; }

void GetBorderRouterName(MutableCharSpan & borderRouterName) override
{
CopyCharSpanToMutableCharSpan("netman-br"_span, borderRouterName);
}

CHIP_ERROR GetBorderAgentId(MutableByteSpan & borderAgentId) override
{
static constexpr uint8_t kBorderAgentId[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
VerifyOrReturnError(borderAgentId.size() == 16, CHIP_ERROR_INVALID_ARGUMENT);
return CopySpanToMutableSpan(ByteSpan(kBorderAgentId), borderAgentId);
}

uint16_t GetThreadVersion() override { return /* Thread 1.3.1 */ 5; }

bool GetInterfaceEnabled() override { return !mActiveDataset.IsEmpty(); }

CHIP_ERROR GetDataset(Thread::OperationalDataset & dataset, DatasetType type) override
{
Thread::OperationalDataset * source;
switch (type)
{
case DatasetType::kActive:
source = &mActiveDataset;
break;
case DatasetType::kPending:
source = &mPendingDataset;
break;
default:
return CHIP_ERROR_INVALID_ARGUMENT;
}
VerifyOrReturnError(!source->IsEmpty(), CHIP_ERROR_NOT_FOUND);
return dataset.Init(source->AsByteSpan());
}

void SetActiveDataset(const Thread::OperationalDataset & activeDataset, uint32_t sequenceNum,
ActivateDatasetCallback * callback) override
{
if (mActivateDatasetCallback != nullptr)
{
callback->OnActivateDatasetComplete(sequenceNum, CHIP_ERROR_INCORRECT_STATE);
return;
}

CHIP_ERROR err = mActiveDataset.Init(activeDataset.AsByteSpan());
if (err != CHIP_NO_ERROR)
{
callback->OnActivateDatasetComplete(sequenceNum, err);
return;
}

mActivateDatasetCallback = callback;
mActivateDatasetSequence = sequenceNum;
DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(3000), CompleteDatasetActivation, this);
}

CHIP_ERROR CommitActiveDataset() override { return CHIP_NO_ERROR; }
CHIP_ERROR RevertActiveDataset() override { return CHIP_ERROR_NOT_IMPLEMENTED; }
CHIP_ERROR SetPendingDataset(const Thread::OperationalDataset & pendingDataset) override { return CHIP_ERROR_NOT_IMPLEMENTED; }

private:
static void CompleteDatasetActivation(System::Layer *, void * context)
{
auto * self = static_cast<FakeBorderRouterDelegate *>(context);
auto * callback = self->mActivateDatasetCallback;
auto sequenceNum = self->mActivateDatasetSequence;
self->mActivateDatasetCallback = nullptr;
callback->OnActivateDatasetComplete(sequenceNum, CHIP_NO_ERROR);
}

AttributeChangeCallback * mAttributeChangeCallback;
Thread::OperationalDataset mActiveDataset;
Thread::OperationalDataset mPendingDataset;

ActivateDatasetCallback * mActivateDatasetCallback = nullptr;
uint32_t mActivateDatasetSequence;
};

FakeBorderRouterDelegate gBorderRouterDelegate{};
} // namespace

std::optional<ThreadBorderRouterManagement::ServerInstance> gThreadBorderRouterManagementServer;
void emberAfThreadBorderRouterManagementClusterInitCallback(EndpointId endpoint)
{
VerifyOrDie(!gThreadBorderRouterManagementServer);
gThreadBorderRouterManagementServer.emplace(endpoint, &gBorderRouterDelegate, Server::GetInstance().GetFailSafeContext())
.Init();
}
Loading

0 comments on commit ac018f2

Please sign in to comment.