Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* @nrfconnect/ncs-matter
*.rst @peknis @b-gent
*.txt @peknis @b-gent
* @nrfconnect/ncs-matter

*.rst @nrfconnect/ncs-matter-doc
*.txt @nrfconnect/ncs-matter-doc

CMakeLists.txt @nrfconnect/ncs-matter
twister_ignore.txt @nrfconnect/ncs-matter
requirements.txt @nrfconnect/ncs-matter
28 changes: 15 additions & 13 deletions docs/release_notes/release_notes_v100.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ Changelog

This release provides Matter samples and documentation migrated from the |NCS| Matter.

Added:

* The Matter protocol documentation migrated from the |NCS| Matter user guide.
* The Matter samples and applications migrated from the |NCS|.
* The Matter configuration options migrated from the |NCS|.
* The Matter software maturity levels migrated from the |NCS|.
* The NFC Commissioning Manager implementation.
See :ref:`ug_matter_configuring_optional_nfc` for more details.
* Kconfig options to customize the Thread Network Diagnostics cluster attribute list.
The ``ExtAddress`` and ``Rloc16`` attributes are optional in the Matter 1.6 specification, but the default Matter SDK implementation still exposes them in the cluster attribute list.
Use the :option:`CONFIG_DISABLE_THREAD_DIAGNOSTIC_EXTADDR` or :option:`CONFIG_DISABLE_THREAD_DIAGNOSTIC_RLOC16` Kconfig options in your project configuration to omit them from the cluster attribute list.

* Integration of |addon| with the |NCS| v3.4.0.
* Added:

* The Matter protocol documentation migrated from the |NCS| Matter user guide.
* The Matter samples and applications migrated from the |NCS|.
* The Matter configuration options migrated from the |NCS|.
* The Matter software maturity levels migrated from the |NCS|.
* The NFC Commissioning Manager implementation.
See :ref:`ug_matter_configuring_optional_nfc` for more details.
* Kconfig options to customize the Thread Network Diagnostics cluster attribute list.
The ``ExtAddress`` and ``Rloc16`` attributes are optional in the Matter 1.6 specification, but the default Matter SDK implementation still exposes them in the cluster attribute list.
Use the :option:`CONFIG_DISABLE_THREAD_DIAGNOSTIC_EXTADDR` or :option:`CONFIG_DISABLE_THREAD_DIAGNOSTIC_RLOC16` Kconfig options in your project configuration to omit them from the cluster attribute list.
* Integration of |addon| with the |NCS| v3.4.0.

* Removed the :c:function:`Init` function from the :c:struct:`Nrf::Matter::IdentifyCluster` class.
To add the Identify Matter cluster to your application, declare a new :c:struct:`Nrf::Matter::IdentifyCluster` object in your :file:`AppTask.c` file and fill all required constructor arguments.
2 changes: 0 additions & 2 deletions samples/bridge/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ CHIP_ERROR AppTask::Init()
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(AppFactoryResetHandler, 0));
#endif

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
28 changes: 24 additions & 4 deletions samples/bridge/src/core/matter_bridged_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "matter_bridged_device.h"
#include <app-common/zap-generated/callback.h>
#include <app/AttributeValueDecoder.h>
#include <app/clusters/identify-server/IdentifyCluster.h>
#include <app/data-model/Encode.h>
#include <lib/core/TLVReader.h>
#include <lib/core/TLVWriter.h>
Expand All @@ -19,6 +18,23 @@ using namespace ::chip::app;
namespace Nrf
{

void MatterBridgedDevice::OnBridgedIdentifyStart(Identify * identify)
{
ChipLogError(DeviceLayer, "Starting bridged device identify on endpoint %d",
identify->mCluster.Cluster().GetPaths()[0].mEndpointId);
}

void MatterBridgedDevice::OnBridgedIdentifyStop(Identify * identify)
{
ChipLogError(DeviceLayer, "Stopping bridged device identify on endpoint %d",
identify->mCluster.Cluster().GetPaths()[0].mEndpointId);
}

void MatterBridgedDevice::OnBridgedTriggerEffect(Identify * identify)
{
ChipLogError(DeviceLayer, "Triggering effect on endpoint %d", identify->mCluster.Cluster().GetPaths()[0].mEndpointId);
}

CHIP_ERROR MatterBridgedDevice::CopyAttribute(const void *attribute, size_t attributeSize, void *buffer,
uint16_t maxBufferSize)
{
Expand Down Expand Up @@ -88,6 +104,8 @@ CHIP_ERROR MatterBridgedDevice::HandleReadBridgedDeviceBasicInformation(Attribut

CHIP_ERROR MatterBridgedDevice::HandleWriteIdentify(chip::AttributeId attributeId, void *data, size_t dataSize)
{
VerifyOrReturnError(mIdentify != nullptr, CHIP_ERROR_INCORRECT_STATE);

switch (attributeId) {
case Clusters::Identify::Attributes::IdentifyTime::Id:
if (data && dataSize == sizeof(uint16_t)) {
Expand Down Expand Up @@ -120,7 +138,7 @@ CHIP_ERROR MatterBridgedDevice::HandleWriteIdentify(chip::AttributeId attributeI
DataModel::WriteAttributeRequest request(path, subjectDescriptor);

DataModel::ActionReturnStatus status =
mIdentifyCluster.Cluster().WriteAttribute(request, decoder);
mIdentify->mCluster.Cluster().WriteAttribute(request, decoder);
if (!status.IsSuccess()) {
return status.GetUnderlyingError();
}
Expand All @@ -134,6 +152,8 @@ CHIP_ERROR MatterBridgedDevice::HandleWriteIdentify(chip::AttributeId attributeI
CHIP_ERROR MatterBridgedDevice::HandleReadIdentify(chip::AttributeId attributeId, uint8_t *buffer,
uint16_t maxReadLength)
{
VerifyOrReturnError(mIdentify != nullptr, CHIP_ERROR_INCORRECT_STATE);

switch (attributeId) {
case Clusters::Identify::Attributes::ClusterRevision::Id: {
uint16_t clusterRevision = GetIdentifyClusterRevision();
Expand All @@ -144,11 +164,11 @@ CHIP_ERROR MatterBridgedDevice::HandleReadIdentify(chip::AttributeId attributeId
return CopyAttribute(&featureMap, sizeof(featureMap), buffer, maxReadLength);
}
case Clusters::Identify::Attributes::IdentifyType::Id: {
MatterBridgedDevice::IdentifyType type = mIdentifyCluster.Cluster().GetIdentifyType();
MatterBridgedDevice::IdentifyType type = mIdentify->mCluster.Cluster().GetIdentifyType();
return CopyAttribute(&type, sizeof(type), buffer, maxReadLength);
}
case Clusters::Identify::Attributes::IdentifyTime::Id: {
uint16_t identifyTime = mIdentifyCluster.Cluster().GetIdentifyTime();
uint16_t identifyTime = mIdentify->mCluster.Cluster().GetIdentifyTime();
return CopyAttribute(&identifyTime, sizeof(identifyTime), buffer, maxReadLength);
}
default:
Expand Down
60 changes: 12 additions & 48 deletions samples/bridge/src/core/matter_bridged_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/AttributeAccessInterfaceRegistry.h>
#include <app/CommandHandlerInterfaceRegistry.h>
#include <platform/DefaultTimerDelegate.h>
#include <app/clusters/identify-server/IdentifyCluster.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/attribute-storage.h>
#include <platform/ConfigurationManager.h>

#include <memory>

namespace Nrf
{

Expand Down Expand Up @@ -52,34 +53,6 @@ namespace Nrf
0), /* feature map */ \
DECLARE_DYNAMIC_ATTRIBUTE_LIST_END();

/* Codedriven delegate for the Identify cluster */
class IdentifyBridgedDeviceDelegateImpl : public chip::app::Clusters::IdentifyDelegate {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to inform about it in some migration guide?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to a release note entry

public:
void OnIdentifyStart(chip::app::Clusters::IdentifyCluster &cluster) override
{
ChipLogError(DeviceLayer, "Starting bridged device identify on endpoint %d",
cluster.GetPaths()[0].mEndpointId);
}

void OnIdentifyStop(chip::app::Clusters::IdentifyCluster &cluster) override
{
ChipLogError(DeviceLayer, "Stopping bridged device identify on endpoint %d",
cluster.GetPaths()[0].mEndpointId);
mIsTriggerEffectEnabled = false;
}

void OnTriggerEffect(chip::app::Clusters::IdentifyCluster &cluster) override
{
ChipLogError(DeviceLayer, "Triggering effect on endpoint %d", cluster.GetPaths()[0].mEndpointId);
mIsTriggerEffectEnabled = true;
}

bool IsTriggerEffectEnabled() const override { return mIsTriggerEffectEnabled; }

private:
bool mIsTriggerEffectEnabled = false;
};

class MatterBridgedDevice {
public:
enum DeviceType : uint16_t {
Expand Down Expand Up @@ -107,11 +80,7 @@ class MatterBridgedDevice {
}
virtual ~MatterBridgedDevice()
{
if (mIdentifyCluster.IsConstructed()) {
TEMPORARY_RETURN_IGNORED chip::app::CodegenDataModelProvider::Instance().Registry().Unregister(
&mIdentifyCluster.Cluster());
mIdentifyCluster.Destroy();
}
mIdentify.reset();

chip::Platform::MemoryFree(mDataVersion);
}
Expand All @@ -120,16 +89,9 @@ class MatterBridgedDevice {
{
mEndpointId = endpoint;

mIdentifyCluster.Create(
chip::app::Clusters::IdentifyCluster::Config(mEndpointId, mTimerDelegate)
.WithIdentifyType(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator)
.WithDelegate(&mIdentifyDelegate));

CHIP_ERROR err = chip::app::CodegenDataModelProvider::Instance().Registry().Register(
mIdentifyCluster.Registration());
if (err != CHIP_NO_ERROR) {
ChipLogError(DeviceLayer, "Failed to register Identify cluster: %s", ErrorStr(err));
}
mIdentify = std::make_unique<Identify>(
mEndpointId, OnBridgedIdentifyStart, OnBridgedIdentifyStop,
chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, OnBridgedTriggerEffect);
}

chip::EndpointId GetEndpointId() const { return mEndpointId; }
Expand Down Expand Up @@ -175,9 +137,11 @@ class MatterBridgedDevice {
bool mIsReachable = true;
char mUniqueID[kUniqueIDSize] = "";
char mNodeLabel[kNodeLabelSize] = "";
chip::app::LazyRegisteredServerCluster<chip::app::Clusters::IdentifyCluster> mIdentifyCluster;
chip::app::DefaultTimerDelegate mTimerDelegate;
IdentifyBridgedDeviceDelegateImpl mIdentifyDelegate;
std::unique_ptr<Identify> mIdentify;

static void OnBridgedIdentifyStart(Identify * identify);
static void OnBridgedIdentifyStop(Identify * identify);
static void OnBridgedTriggerEffect(Identify * identify);
};

} /* namespace Nrf */
2 changes: 0 additions & 2 deletions samples/closure/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ CHIP_ERROR AppTask::Init()

ReturnErrorOnFailure(Nrf::Matter::StartServer());

ReturnErrorOnFailure(sIdentifyCluster.Init());

if (Nrf::GetPersistentStorage().NonSecureInit(&mRootNode) != Nrf::PSErrorCode::Success) {
return CHIP_ERROR_PERSISTED_STORAGE_FAILED;
}
Expand Down
2 changes: 0 additions & 2 deletions samples/contact_sensor/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ CHIP_ERROR AppTask::Init()
* state. */
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0));

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
2 changes: 0 additions & 2 deletions samples/light_switch/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ CHIP_ERROR AppTask::Init()
* state. */
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0));

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
2 changes: 0 additions & 2 deletions samples/smoke_co_alarm/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ CHIP_ERROR AppTask::Init()
Nrf::Matter::TestEventTrigger::EventTrigger{ 0xFFFF, PowerSourceOffEventCallback }));
#endif

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
2 changes: 0 additions & 2 deletions samples/temperature_sensor/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ CHIP_ERROR AppTask::Init()
}
#endif

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
2 changes: 0 additions & 2 deletions samples/thermostat/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ CHIP_ERROR AppTask::Init()
* state. */
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0));

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
4 changes: 0 additions & 4 deletions samples/weather_station/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,6 @@ CHIP_ERROR AppTask::Init()
}
#endif

ReturnErrorOnFailure(sIdentifyTemperature.Init());
ReturnErrorOnFailure(sIdentifyHumidity.Init());
ReturnErrorOnFailure(sIdentifyPressure.Init());

/* Initialize timers */
k_timer_init(
&sMeasurementsTimer, [](k_timer *) { Nrf::PostTask([] { MeasurementsTimerHandler(); }); }, nullptr);
Expand Down
2 changes: 0 additions & 2 deletions samples/window_covering/src/app_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ CHIP_ERROR AppTask::Init()
* state. */
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0));

ReturnErrorOnFailure(sIdentifyCluster.Init());

return Nrf::Matter::StartServer();
}

Expand Down
22 changes: 16 additions & 6 deletions scripts/ci/sample_build_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ path_triggers:
variants:
- release
platform:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp

light-bulb-sample:
paths:
Expand All @@ -60,8 +60,8 @@ path_triggers:
variants:
- release
platform:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp

light-switch-sample:
paths:
Expand All @@ -70,6 +70,11 @@ path_triggers:
- scenario: light_switch
variants:
- release
platform:
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
- scenario: light_switch
variants:
- lit_icd
platform:
- nrf5340dk/nrf5340/cpuapp
Expand Down Expand Up @@ -105,10 +110,15 @@ path_triggers:
variants:
- release
- debug.ssed
- smp_dfu
platform:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- scenario: window_cover
variants:
- smp_dfu
platform:
- nrf5340dk/nrf5340/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp

thermostat-sample:
paths:
Expand All @@ -118,8 +128,8 @@ path_triggers:
variants:
- release
platform:
- nrf5340dk/nrf5340/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp

temperature-sensor-sample:
paths:
Expand All @@ -129,8 +139,8 @@ path_triggers:
variants:
- release
platform:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp

smoke-co-alarm-sample:
paths:
Expand Down Expand Up @@ -328,8 +338,8 @@ path_triggers:
variants:
- debug
platform:
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20b/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
- scenario: window_cover
variants:
- release
Expand Down
1 change: 1 addition & 0 deletions subsys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target_sources(app PRIVATE
${MATTER_COMMONS_SRC_DIR}/app/matter_init.cpp
${MATTER_COMMONS_SRC_DIR}/app/matter_event_handler.cpp
${MATTER_COMMONS_SRC_DIR}/clusters/cluster_init.cpp
${MATTER_COMMONS_SRC_DIR}/clusters/identify.cpp
)

# Include linker script for cluster initialization iterable section
Expand Down
2 changes: 2 additions & 0 deletions subsys/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ config MATTER_CERTIFICATION

config DISABLE_THREAD_DIAGNOSTIC_RLOC16
bool "Exclude Rloc16 from Thread Network Diagnostics attribute list"
default y
help
When enabled, the Thread Network Diagnostics cluster replaces the default Matter SDK
implementation and omits the Rloc16 attribute from the published attribute list.

config DISABLE_THREAD_DIAGNOSTIC_EXTADDR
bool "Exclude ExtAddress from Thread Network Diagnostics attribute list"
default y
help
When enabled, the Thread Network Diagnostics cluster replaces the default Matter SDK
implementation and omits the ExtAddress attribute from the published attribute list.
Expand Down
Loading
Loading