From 16623096b400c48626358fa44980ef8104e2947f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 3 Dec 2021 11:32:57 -0500 Subject: [PATCH 01/11] Implement QName compression in minmdns (#12445) * Revamp constants: qname length constant is NOT used * First pass on an indirection to use a dedicated writer. No test updates yet nor functionality * Updates to use the record writer, more tests pass now * Compressed writer with unit tests * Fix memory leak in UDP responders when a multicast join fails * Add a harder unit test * Make the complex reuse also validate that we can write things other than qnames * Compression applied on all answers (no queries yet) * Prepare to make query writing do compression as well, add more unit tests to qname writing * Record compression for writing serialized qnames as well. Tested that query compression on replies is done * Fix unit tests for resource records for writing QName compression * Code review comments, fix android compile * Fix test advertiser to consider the entire valid packet range when validating (for qname compression support) * Only remember non-fully compressed qnames * Address some code review comments * Add a fit validation for response building * update the code to have RecordWriter be more transparent/easier to use in put statements --- .vscode/settings.json | 3 +- src/lib/dnssd/minimal_mdns/Parser.cpp | 15 +- src/lib/dnssd/minimal_mdns/Parser.h | 3 +- src/lib/dnssd/minimal_mdns/Query.h | 17 +- src/lib/dnssd/minimal_mdns/QueryBuilder.h | 3 +- src/lib/dnssd/minimal_mdns/ResponseBuilder.h | 31 ++- src/lib/dnssd/minimal_mdns/core/BUILD.gn | 2 + src/lib/dnssd/minimal_mdns/core/BytesRange.h | 5 + src/lib/dnssd/minimal_mdns/core/Constants.h | 2 - src/lib/dnssd/minimal_mdns/core/QName.cpp | 34 +++ src/lib/dnssd/minimal_mdns/core/QName.h | 26 +-- .../dnssd/minimal_mdns/core/RecordWriter.cpp | 145 +++++++++++++ .../dnssd/minimal_mdns/core/RecordWriter.h | 138 ++++++++++++ .../dnssd/minimal_mdns/core/tests/BUILD.gn | 1 + .../minimal_mdns/core/tests/TestQName.cpp | 80 ++++--- .../core/tests/TestRecordWriter.cpp | 197 ++++++++++++++++++ src/lib/dnssd/minimal_mdns/records/IP.cpp | 6 +- src/lib/dnssd/minimal_mdns/records/IP.h | 2 +- src/lib/dnssd/minimal_mdns/records/Ptr.h | 6 +- .../minimal_mdns/records/ResourceRecord.cpp | 12 +- .../minimal_mdns/records/ResourceRecord.h | 5 +- src/lib/dnssd/minimal_mdns/records/Srv.h | 9 +- src/lib/dnssd/minimal_mdns/records/Txt.h | 9 +- .../records/tests/TestResourceRecord.cpp | 52 +++-- .../records/tests/TestResourceRecordIP.cpp | 13 +- .../records/tests/TestResourceRecordPtr.cpp | 4 +- .../records/tests/TestResourceRecordSrv.cpp | 3 +- .../records/tests/TestResourceRecordTxt.cpp | 3 +- .../responders/tests/TestPtrResponder.cpp | 3 +- .../minimal_mdns/tests/CheckOnlyServer.h | 8 +- .../minimal_mdns/tests/TestResponseSender.cpp | 25 ++- src/lib/support/BufferWriter.h | 5 +- 32 files changed, 717 insertions(+), 150 deletions(-) create mode 100644 src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp create mode 100644 src/lib/dnssd/minimal_mdns/core/RecordWriter.h create mode 100644 src/lib/dnssd/minimal_mdns/core/tests/TestRecordWriter.cpp diff --git a/.vscode/settings.json b/.vscode/settings.json index c4290296d8315f..6ff631080c2465 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -156,5 +156,6 @@ "clang-format.fallbackStyle": "WebKit", "files.trimFinalNewlines": true, "C_Cpp.default.cppStandard": "gnu++14", - "C_Cpp.default.cStandard": "gnu11" + "C_Cpp.default.cStandard": "gnu11", + "cmake.configureOnOpen": false } diff --git a/src/lib/dnssd/minimal_mdns/Parser.cpp b/src/lib/dnssd/minimal_mdns/Parser.cpp index b3ae34b98e2b6e..8bc3e9e1af3bb4 100644 --- a/src/lib/dnssd/minimal_mdns/Parser.cpp +++ b/src/lib/dnssd/minimal_mdns/Parser.cpp @@ -66,23 +66,24 @@ bool QueryData::Parse(const BytesRange & validData, const uint8_t ** start) return true; } -bool QueryData::Append(HeaderRef & hdr, chip::Encoding::BigEndian::BufferWriter & out) const +bool QueryData::Append(HeaderRef & hdr, RecordWriter & out) const { if ((hdr.GetAdditionalCount() != 0) || (hdr.GetAnswerCount() != 0) || (hdr.GetAuthorityCount() != 0)) { return false; } - GetName().Put(out); - out.Put16(static_cast(mType)); - out.Put16(static_cast(mClass) | (mAnswerViaUnicast ? kQClassUnicastAnswerFlag : 0)); + out.WriteQName(GetName()) + .Put16(static_cast(mType)) + .Put16(static_cast(mClass) | (mAnswerViaUnicast ? kQClassUnicastAnswerFlag : 0)); - if (out.Fit()) + if (!out.Fit()) { - hdr.SetQueryCount(static_cast(hdr.GetQueryCount() + 1)); + return false; } - return out.Fit(); + hdr.SetQueryCount(static_cast(hdr.GetQueryCount() + 1)); + return true; } bool ResourceData::Parse(const BytesRange & validData, const uint8_t ** start) diff --git a/src/lib/dnssd/minimal_mdns/Parser.h b/src/lib/dnssd/minimal_mdns/Parser.h index 2c82b99d5a4555..1b2b208c7dcc89 100644 --- a/src/lib/dnssd/minimal_mdns/Parser.h +++ b/src/lib/dnssd/minimal_mdns/Parser.h @@ -20,6 +20,7 @@ #include #include #include +#include namespace mdns { namespace Minimal { @@ -56,7 +57,7 @@ class QueryData bool Parse(const BytesRange & validData, const uint8_t ** start); /// Write out this query data back into an output buffer. - bool Append(HeaderRef & hdr, chip::Encoding::BigEndian::BufferWriter & out) const; + bool Append(HeaderRef & hdr, RecordWriter & out) const; private: QType mType = QType::ANY; diff --git a/src/lib/dnssd/minimal_mdns/Query.h b/src/lib/dnssd/minimal_mdns/Query.h index a6687311567999..cfdd1b1120fe1e 100644 --- a/src/lib/dnssd/minimal_mdns/Query.h +++ b/src/lib/dnssd/minimal_mdns/Query.h @@ -21,6 +21,7 @@ #include #include +#include namespace mdns { namespace Minimal { @@ -56,7 +57,7 @@ class Query /// /// @param hdr will be updated with a query count /// @param out where to write the query data - bool Append(HeaderRef & hdr, chip::Encoding::BigEndian::BufferWriter & out) const + bool Append(HeaderRef & hdr, RecordWriter & out) const { // Questions can only be appended before any other data is added if ((hdr.GetAdditionalCount() != 0) || (hdr.GetAnswerCount() != 0) || (hdr.GetAuthorityCount() != 0)) @@ -64,17 +65,17 @@ class Query return false; } - mQName.Output(out); + out.WriteQName(mQName) + .Put16(static_cast(mType)) + .Put16(static_cast(static_cast(mClass) | (mAnswerViaUnicast ? kQClassUnicastAnswerFlag : 0))); - out.Put16(static_cast(mType)); - out.Put16(static_cast(static_cast(mClass) | (mAnswerViaUnicast ? kQClassUnicastAnswerFlag : 0))); - - if (out.Fit()) + if (!out.Fit()) { - hdr.SetQueryCount(static_cast(hdr.GetQueryCount() + 1)); + return false; } - return out.Fit(); + hdr.SetQueryCount(static_cast(hdr.GetQueryCount() + 1)); + return true; } private: diff --git a/src/lib/dnssd/minimal_mdns/QueryBuilder.h b/src/lib/dnssd/minimal_mdns/QueryBuilder.h index 11b6c9097792ca..c6c964a0483cd3 100644 --- a/src/lib/dnssd/minimal_mdns/QueryBuilder.h +++ b/src/lib/dnssd/minimal_mdns/QueryBuilder.h @@ -68,8 +68,9 @@ class QueryBuilder } chip::Encoding::BigEndian::BufferWriter out(mPacket->Start() + mPacket->DataLength(), mPacket->AvailableDataLength()); + RecordWriter writer(&out); - if (!query.Append(mHeader, out)) + if (!query.Append(mHeader, writer)) { mQueryBuildOk = false; } diff --git a/src/lib/dnssd/minimal_mdns/ResponseBuilder.h b/src/lib/dnssd/minimal_mdns/ResponseBuilder.h index 73735d57b0191a..b2ce31ed60110f 100644 --- a/src/lib/dnssd/minimal_mdns/ResponseBuilder.h +++ b/src/lib/dnssd/minimal_mdns/ResponseBuilder.h @@ -29,8 +29,12 @@ namespace Minimal { class ResponseBuilder { public: - ResponseBuilder() : mHeader(nullptr) {} - ResponseBuilder(chip::System::PacketBufferHandle && packet) : mHeader(nullptr) { Reset(std::move(packet)); } + ResponseBuilder() : mHeader(nullptr), mEndianOutput(nullptr, 0), mWriter(&mEndianOutput) {} + ResponseBuilder(chip::System::PacketBufferHandle && packet) : + mHeader(nullptr), mEndianOutput(nullptr, 0), mWriter(&mEndianOutput) + { + Reset(std::move(packet)); + } ResponseBuilder & Reset(chip::System::PacketBufferHandle && packet) { @@ -49,6 +53,13 @@ class ResponseBuilder } mHeader.SetFlags(mHeader.GetFlags().SetResponse()); + + mEndianOutput = + chip::Encoding::BigEndian::BufferWriter(mPacket->Start(), mPacket->DataLength() + mPacket->AvailableDataLength()); + mEndianOutput.Skip(mPacket->DataLength()); + + mWriter.Reset(); + return *this; } @@ -77,16 +88,16 @@ class ResponseBuilder return *this; } - chip::Encoding::BigEndian::BufferWriter out(mPacket->Start() + mPacket->DataLength(), mPacket->AvailableDataLength()); - - if (!record.Append(mHeader, type, out)) + if (!record.Append(mHeader, type, mWriter)) { mBuildOk = false; } else { - mPacket->SetDataLength(static_cast(mPacket->DataLength() + out.Needed())); + VerifyOrDie(mEndianOutput.Fit()); // should be guaranteed because record Append succeeded + mPacket->SetDataLength(static_cast(mEndianOutput.Needed())); } + return *this; } @@ -97,15 +108,13 @@ class ResponseBuilder return *this; } - chip::Encoding::BigEndian::BufferWriter out(mPacket->Start() + mPacket->DataLength(), mPacket->AvailableDataLength()); - - if (!query.Append(mHeader, out)) + if (!query.Append(mHeader, mWriter)) { mBuildOk = false; } else { - mPacket->SetDataLength(static_cast(mPacket->DataLength() + out.Needed())); + mPacket->SetDataLength(static_cast(mEndianOutput.Needed())); } return *this; } @@ -116,6 +125,8 @@ class ResponseBuilder private: chip::System::PacketBufferHandle mPacket; HeaderRef mHeader; + chip::Encoding::BigEndian::BufferWriter mEndianOutput; + RecordWriter mWriter; bool mBuildOk = false; }; diff --git a/src/lib/dnssd/minimal_mdns/core/BUILD.gn b/src/lib/dnssd/minimal_mdns/core/BUILD.gn index 8ba686a63657a1..0fc83eaddfdd15 100644 --- a/src/lib/dnssd/minimal_mdns/core/BUILD.gn +++ b/src/lib/dnssd/minimal_mdns/core/BUILD.gn @@ -21,6 +21,8 @@ static_library("core") { "DnsHeader.h", "QName.cpp", "QName.h", + "RecordWriter.cpp", + "RecordWriter.h", ] public_deps = [ diff --git a/src/lib/dnssd/minimal_mdns/core/BytesRange.h b/src/lib/dnssd/minimal_mdns/core/BytesRange.h index 73e4170fd1347b..9b50664cdbdee0 100644 --- a/src/lib/dnssd/minimal_mdns/core/BytesRange.h +++ b/src/lib/dnssd/minimal_mdns/core/BytesRange.h @@ -44,6 +44,11 @@ class BytesRange size_t Size() const { return static_cast(mEnd - mStart); } + inline static BytesRange BufferWithSize(const void * buff, size_t len) + { + return BytesRange(static_cast(buff), static_cast(buff) + len); + } + private: const uint8_t * mStart = nullptr; const uint8_t * mEnd = nullptr; diff --git a/src/lib/dnssd/minimal_mdns/core/Constants.h b/src/lib/dnssd/minimal_mdns/core/Constants.h index e081edf5e62b79..30f2d4b0ddd0b9 100644 --- a/src/lib/dnssd/minimal_mdns/core/Constants.h +++ b/src/lib/dnssd/minimal_mdns/core/Constants.h @@ -66,7 +66,5 @@ enum class ResourceType kAdditional, }; -constexpr size_t kMaxQNamePartLength = 255; - } // namespace Minimal } // namespace mdns diff --git a/src/lib/dnssd/minimal_mdns/core/QName.cpp b/src/lib/dnssd/minimal_mdns/core/QName.cpp index f970b1f0a590f6..8fca9f47d8993a 100644 --- a/src/lib/dnssd/minimal_mdns/core/QName.cpp +++ b/src/lib/dnssd/minimal_mdns/core/QName.cpp @@ -152,6 +152,40 @@ bool SerializedQNameIterator::operator==(const FullQName & other) const return ((idx == other.nameCount) && !self.Next()); } +bool SerializedQNameIterator::operator==(const SerializedQNameIterator & other) const +{ + SerializedQNameIterator a = *this; // allow iteration + SerializedQNameIterator b = other; + + while (true) + { + bool hasA = a.Next(); + bool hasB = b.Next(); + + if (hasA ^ hasB) + { + return false; /// one is longer than the other + } + + if (!a.IsValid() || !b.IsValid()) + { + return false; // invalid data + } + + if (!hasA || !hasB) + { + break; + } + + if (strcasecmp(a.Value(), b.Value()) != 0) + { + return false; + } + } + + return a.IsValid() && b.IsValid(); +} + bool FullQName::operator==(const FullQName & other) const { if (nameCount != other.nameCount) diff --git a/src/lib/dnssd/minimal_mdns/core/QName.h b/src/lib/dnssd/minimal_mdns/core/QName.h index fc829f8ad2971d..e2dc6f54716f85 100644 --- a/src/lib/dnssd/minimal_mdns/core/QName.h +++ b/src/lib/dnssd/minimal_mdns/core/QName.h @@ -53,17 +53,6 @@ struct FullQName FullQName(const QNamePart (&data)[N]) : names(data), nameCount(N) {} - void Output(chip::Encoding::BigEndian::BufferWriter & out) const - { - for (uint16_t i = 0; i < nameCount; i++) - { - - out.Put8(static_cast(strlen(names[i]))); - out.Put(names[i]); - } - out.Put8(0); // end of qnames - } - bool operator==(const FullQName & other) const; bool operator!=(const FullQName & other) const { return !(*this == other); } }; @@ -108,17 +97,10 @@ class SerializedQNameIterator bool operator==(const FullQName & other) const; bool operator!=(const FullQName & other) const { return !(*this == other); } - void Put(chip::Encoding::BigEndian::BufferWriter & out) const - { - SerializedQNameIterator copy = *this; - while (copy.Next()) - { - - out.Put8(static_cast(strlen(copy.Value()))); - out.Put(copy.Value()); - } - out.Put8(0); // end of qnames - } + bool operator==(const SerializedQNameIterator & other) const; + bool operator!=(const SerializedQNameIterator & other) const { return !(*this == other); } + + size_t OffsetInCurrentValidData() const { return static_cast(mCurrentPosition - mValidData.Start()); } private: static constexpr size_t kMaxValueSize = 63; diff --git a/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp new file mode 100644 index 00000000000000..1cd8b68cc71dd4 --- /dev/null +++ b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp @@ -0,0 +1,145 @@ +/* + * + * Copyright (c) 2020 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 "RecordWriter.h" + +namespace mdns { +namespace Minimal { + +SerializedQNameIterator RecordWriter::PreviousName(size_t index) const +{ + if (index >= kMaxCachedReferences) + { + return SerializedQNameIterator(); + } + + uint16_t offset = mPreviousQNames[index]; + if (offset == kInvalidOffset) + { + return SerializedQNameIterator(); + } + + return SerializedQNameIterator(BytesRange(mOutput->Buffer(), mOutput->Buffer() + mOutput->WritePos()), + mOutput->Buffer() + offset); +} + +RecordWriter & RecordWriter::WriteQName(const FullQName & qname) +{ + size_t qNameWriteStart = mOutput->WritePos(); + bool isFullyCompressed = true; + + for (uint16_t i = 0; i < qname.nameCount; i++) + { + + // find out if the record part remaining already is located somewhere + FullQName remaining; + remaining.names = qname.names + i; + remaining.nameCount = qname.nameCount - i; + + // Try to find a valid offset + chip::Optional offset = FindPreviousName(remaining); + + if (offset.HasValue()) + { + // Pointer to offset: set the highest 2 bits + mOutput->Put16(offset.Value() | 0xC000); + + if (mOutput->Fit() && !isFullyCompressed) + { + RememberWrittenQnameOffset(qNameWriteStart); + } + return *this; + } + + mOutput->Put8(static_cast(strlen(qname.names[i]))); + mOutput->Put(qname.names[i]); + isFullyCompressed = false; + } + mOutput->Put8(0); // end of qnames + + if (mOutput->Fit()) + { + RememberWrittenQnameOffset(qNameWriteStart); + } + return *this; +} + +RecordWriter & RecordWriter::WriteQName(const SerializedQNameIterator & qname) +{ + size_t qNameWriteStart = mOutput->WritePos(); + bool isFullyCompressed = true; + + SerializedQNameIterator copy = qname; + while (true) + { + chip::Optional offset = FindPreviousName(copy); + + if (offset.HasValue()) + { + // Pointer to offset: set the highest 2 bits + // We guarantee that offsets saved are <= kMaxReuseOffset + mOutput->Put16(offset.Value() | 0xC000); + + if (mOutput->Fit() && !isFullyCompressed) + { + RememberWrittenQnameOffset(qNameWriteStart); + } + return *this; + } + + if (!copy.Next()) + { + break; + } + + if (!copy.IsValid()) + { + break; + } + + mOutput->Put8(static_cast(strlen(copy.Value()))); + mOutput->Put(copy.Value()); + isFullyCompressed = false; + } + mOutput->Put8(0); // end of qnames + + if (mOutput->Fit()) + { + RememberWrittenQnameOffset(qNameWriteStart); + } + return *this; +} + +void RecordWriter::RememberWrittenQnameOffset(size_t offset) +{ + if (offset > kMaxReuseOffset) + { + // cannot represent this offset properly + return; + } + + for (size_t i = 0; i < kMaxCachedReferences; i++) + { + if (mPreviousQNames[i] == kInvalidOffset) + { + mPreviousQNames[i] = offset; + return; + } + } +} + +} // namespace Minimal +} // namespace mdns diff --git a/src/lib/dnssd/minimal_mdns/core/RecordWriter.h b/src/lib/dnssd/minimal_mdns/core/RecordWriter.h new file mode 100644 index 00000000000000..0356f7e4b2643e --- /dev/null +++ b/src/lib/dnssd/minimal_mdns/core/RecordWriter.h @@ -0,0 +1,138 @@ +/* + * + * Copyright (c) 2020 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 +#include +#include +#include + +namespace mdns { +namespace Minimal { + +/** + * Handles writing into mdns packets. + * + * Generally the same as a binary data writer, but can handle qname writing with + * compression. + */ +class RecordWriter +{ +public: + RecordWriter(chip::Encoding::BigEndian::BufferWriter * output) : mOutput(output) { Reset(); } + + void Reset() + { + for (size_t i = 0; i < kMaxCachedReferences; i++) + { + mPreviousQNames[i] = kInvalidOffset; + } + } + + chip::Encoding::BigEndian::BufferWriter & Writer() { return *mOutput; } + + /// Writes the given qname into the underlying buffer, applying + /// compression if possible + RecordWriter & WriteQName(const FullQName & qname); + + /// Writes the given qname into the underlying buffer, applying + /// compression if possible + RecordWriter & WriteQName(const SerializedQNameIterator & qname); + + inline RecordWriter & Put8(uint8_t value) + { + mOutput->Put8(value); + return *this; + } + + inline RecordWriter & Put16(uint16_t value) + { + mOutput->Put16(value); + return *this; + } + + inline RecordWriter & Put32(uint32_t value) + { + mOutput->Put32(value); + return *this; + } + + inline RecordWriter & PutString(const char * value) + { + mOutput->Put(value); + return *this; + } + + inline RecordWriter & Put(const BytesRange & range) + { + mOutput->Put(range.Start(), range.Size()); + return *this; + } + + inline bool Fit() const { return mOutput->Fit(); } + +private: + // How many paths to remember as 'previously written' + // and make use of them + static constexpr size_t kMaxCachedReferences = 8; + static constexpr uint16_t kInvalidOffset = 0xFFFF; + static constexpr uint16_t kMaxReuseOffset = 0x3FFF; + + // Where the data is being outputted + chip::Encoding::BigEndian::BufferWriter * mOutput; + uint16_t mPreviousQNames[kMaxCachedReferences]; + + /// Find the offset at which this qname was previously seen (if any) + /// works with QName and SerializedQNameIterator + template + chip::Optional FindPreviousName(const T & name) const + { + for (size_t i = 0; i < kMaxCachedReferences; i++) + { + SerializedQNameIterator previous = PreviousName(i); + + // Any of the sub-segments may match + while (previous.IsValid()) + { + if (previous == name) + { + return chip::Optional::Value(previous.OffsetInCurrentValidData()); + } + + if (!previous.Next()) + { + break; + } + } + } + + return chip::Optional::Missing(); + } + + /// Gets the iterator corresponding to the previous name + /// with the given index. + /// + /// Will return an iterator that is not valid if + /// lookbehind index is not valid + SerializedQNameIterator PreviousName(size_t index) const; + + /// Keep track that a qname was written at the given offset + void RememberWrittenQnameOffset(size_t offset); +}; + +} // namespace Minimal +} // namespace mdns diff --git a/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn b/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn index 9484a04c8aa817..a3f6141c16d029 100644 --- a/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn +++ b/src/lib/dnssd/minimal_mdns/core/tests/BUILD.gn @@ -24,6 +24,7 @@ chip_test_suite("tests") { test_sources = [ "TestFlatAllocatedQName.cpp", "TestQName.cpp", + "TestRecordWriter.cpp", ] cflags = [ "-Wconversion" ] diff --git a/src/lib/dnssd/minimal_mdns/core/tests/TestQName.cpp b/src/lib/dnssd/minimal_mdns/core/tests/TestQName.cpp index 055176cc69efd8..d8f741badb9c32 100644 --- a/src/lib/dnssd/minimal_mdns/core/tests/TestQName.cpp +++ b/src/lib/dnssd/minimal_mdns/core/tests/TestQName.cpp @@ -25,11 +25,26 @@ namespace { using namespace mdns::Minimal; +/// Convenience method to have a serialized QName: +/// +/// static const uint8_t kData[] = "datahere\00"; +/// AsSerializedQName(kData); +/// +/// NOTE: this MUST be using the string "" format to add an extra NULL +/// terminator that this method discards. +template +static SerializedQNameIterator AsSerializedQName(const uint8_t (&v)[N]) +{ + // NOTE: the -1 is because we format these items as STRINGS and that + // appends an extra NULL terminator + return SerializedQNameIterator(BytesRange(v, v + N - 1), v); +} + void IteratorTest(nlTestSuite * inSuite, void * inContext) { { static const uint8_t kOneItem[] = "\04test\00"; - SerializedQNameIterator it(BytesRange(kOneItem, kOneItem + sizeof(kOneItem)), kOneItem); + SerializedQNameIterator it = AsSerializedQName(kOneItem); NL_TEST_ASSERT(inSuite, it.Next()); NL_TEST_ASSERT(inSuite, strcmp(it.Value(), "test") == 0); @@ -39,7 +54,7 @@ void IteratorTest(nlTestSuite * inSuite, void * inContext) { static const uint8_t kManyItems[] = "\04this\02is\01a\04test\00"; - SerializedQNameIterator it(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems); + SerializedQNameIterator it = AsSerializedQName(kManyItems); NL_TEST_ASSERT(inSuite, it.Next()); NL_TEST_ASSERT(inSuite, strcmp(it.Value(), "this") == 0); @@ -82,7 +97,7 @@ void ErrorTest(nlTestSuite * inSuite, void * inContext) { // Truncated before the end static const uint8_t kData[] = "\04test"; - SerializedQNameIterator it(BytesRange(kData, kData + 5), kData); + SerializedQNameIterator it = AsSerializedQName(kData); NL_TEST_ASSERT(inSuite, !it.Next()); NL_TEST_ASSERT(inSuite, !it.IsValid()); @@ -91,7 +106,7 @@ void ErrorTest(nlTestSuite * inSuite, void * inContext) { // Truncated before the end static const uint8_t kData[] = "\02"; - SerializedQNameIterator it(BytesRange(kData, kData + 1), kData); + SerializedQNameIterator it = AsSerializedQName(kData); NL_TEST_ASSERT(inSuite, !it.Next()); NL_TEST_ASSERT(inSuite, !it.IsValid()); @@ -100,7 +115,7 @@ void ErrorTest(nlTestSuite * inSuite, void * inContext) { // Truncated before the end static const uint8_t kData[] = "\xc0"; - SerializedQNameIterator it(BytesRange(kData, kData + 1), kData); + SerializedQNameIterator it = AsSerializedQName(kData); NL_TEST_ASSERT(inSuite, !it.Next()); NL_TEST_ASSERT(inSuite, !it.IsValid()); @@ -108,6 +123,7 @@ void ErrorTest(nlTestSuite * inSuite, void * inContext) { // Truncated before the end (but seemingly valid in case of error) + // does NOT use AsSerializedQName (because out of range) static const uint8_t kData[] = "\00\xc0\x00"; SerializedQNameIterator it(BytesRange(kData, kData + 2), kData + 1); @@ -117,7 +133,7 @@ void ErrorTest(nlTestSuite * inSuite, void * inContext) { // Infinite recursion static const uint8_t kData[] = "\03test\xc0\x00"; - SerializedQNameIterator it(BytesRange(kData, kData + 7), kData); + SerializedQNameIterator it = AsSerializedQName(kData); NL_TEST_ASSERT(inSuite, it.Next()); NL_TEST_ASSERT(inSuite, !it.Next()); @@ -131,44 +147,32 @@ void Comparison(nlTestSuite * inSuite, void * inContext) { const QNamePart kTestName[] = { "this" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) != - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) != FullQName(kTestName)); } { const QNamePart kTestName[] = { "this", "is" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) != - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) != FullQName(kTestName)); } { const QNamePart kTestName[] = { "is", "a", "test" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) != - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) != FullQName(kTestName)); } { const QNamePart kTestName[] = { "this", "is", "a", "test" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) == - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) == FullQName(kTestName)); } { const QNamePart kTestName[] = { "this", "is", "a", "test", "suffix" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) != - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) != FullQName(kTestName)); } { const QNamePart kTestName[] = { "prefix", "this", "is", "a", "test" }; - NL_TEST_ASSERT(inSuite, - SerializedQNameIterator(BytesRange(kManyItems, kManyItems + sizeof(kManyItems)), kManyItems) != - FullQName(kTestName)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kManyItems) != FullQName(kTestName)); } } @@ -237,6 +241,33 @@ void CaseInsensitiveFullQNameCompare(nlTestSuite * inSuite, void * inContext) } } +void SerializedCompare(nlTestSuite * inSuite, void * inContext) +{ + static const uint8_t kThisIsATest1[] = "\04this\02is\01a\04test\00"; + static const uint8_t kThisIsATest2[] = "\04ThIs\02is\01A\04tESt\00"; + static const uint8_t kThisIsDifferent[] = "\04this\02is\09different\00"; + static const uint8_t kThisIs[] = "\04this\02is"; + + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest1) == AsSerializedQName(kThisIsATest1)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest2) == AsSerializedQName(kThisIsATest2)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest1) == AsSerializedQName(kThisIsATest2)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest1) != AsSerializedQName(kThisIsDifferent)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsDifferent) != AsSerializedQName(kThisIsATest1)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsDifferent) != AsSerializedQName(kThisIs)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIs) != AsSerializedQName(kThisIsDifferent)); + + // These items have back references and are "this.is.a.test" + static const uint8_t kPtrItems[] = "\03abc\02is\01a\04test\00\04this\xc0\04"; + SerializedQNameIterator thisIsATestPtr(BytesRange(kPtrItems, kPtrItems + sizeof(kPtrItems)), kPtrItems + 15); + + NL_TEST_ASSERT(inSuite, thisIsATestPtr == AsSerializedQName(kThisIsATest1)); + NL_TEST_ASSERT(inSuite, thisIsATestPtr == AsSerializedQName(kThisIsATest2)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest1) == thisIsATestPtr); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIsATest2) == thisIsATestPtr); + NL_TEST_ASSERT(inSuite, thisIsATestPtr != AsSerializedQName(kThisIs)); + NL_TEST_ASSERT(inSuite, AsSerializedQName(kThisIs) != thisIsATestPtr); +} + } // namespace // clang-format off @@ -247,6 +278,7 @@ static const nlTest sTests[] = NL_TEST_DEF("Comparison", Comparison), NL_TEST_DEF("CaseInsensitiveSerializedCompare", CaseInsensitiveSerializedCompare), NL_TEST_DEF("CaseInsensitiveFullQNameCompare", CaseInsensitiveFullQNameCompare), + NL_TEST_DEF("SerializedCompare", SerializedCompare), NL_TEST_SENTINEL() }; diff --git a/src/lib/dnssd/minimal_mdns/core/tests/TestRecordWriter.cpp b/src/lib/dnssd/minimal_mdns/core/tests/TestRecordWriter.cpp new file mode 100644 index 00000000000000..6323417a1c7992 --- /dev/null +++ b/src/lib/dnssd/minimal_mdns/core/tests/TestRecordWriter.cpp @@ -0,0 +1,197 @@ +/* + * + * Copyright (c) 2021 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 +#include + +#include + +namespace { + +using namespace mdns::Minimal; +using namespace chip::Encoding::BigEndian; + +void BasicWriteTest(nlTestSuite * inSuite, void * inContext) +{ + const QNamePart kName1[] = { "some", "name" }; + const QNamePart kName2[] = { "abc", "xyz", "here" }; + + uint8_t dataBuffer[128]; + + BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + + writer.WriteQName(FullQName(kName1)); + writer.WriteQName(FullQName(kName2)); + + // clang-format off + const uint8_t expectedOutput[] = { + // + 4, 's', 'o', 'm', 'e', // QNAME part: some + 4, 'n', 'a', 'm', 'e', // QNAME part: name + 0, // QNAME ends + 3, 'a', 'b', 'c', // QNAME part: abc + 3, 'x', 'y', 'z', // QNAME part: xyz + 4, 'h', 'e', 'r', 'e', // QNAME part: here + 0, // QNAME ends + }; + // clang-format on + + NL_TEST_ASSERT(inSuite, output.Needed() == sizeof(expectedOutput)); + NL_TEST_ASSERT(inSuite, memcmp(dataBuffer, expectedOutput, sizeof(expectedOutput)) == 0); +} + +void SimpleDedup(nlTestSuite * inSuite, void * inContext) +{ + const QNamePart kName1[] = { "some", "name" }; + const QNamePart kName2[] = { "other", "name" }; + + uint8_t dataBuffer[128]; + + BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + + writer.WriteQName(FullQName(kName1)); + writer.WriteQName(FullQName(kName2)); + + // clang-format off + const uint8_t expectedOutput[] = { + // + 4, 's', 'o', 'm', 'e', // QNAME part: some + 4, 'n', 'a', 'm', 'e', // QNAME part: name + 0, // QNAME ends + 5, 'o', 't', 'h', 'e', 'r', // QNAME part: other + 0xC0, 5 // POINTER: "name" is at offset 5 + }; + // clang-format on + + NL_TEST_ASSERT(inSuite, output.Needed() == sizeof(expectedOutput)); + NL_TEST_ASSERT(inSuite, memcmp(dataBuffer, expectedOutput, sizeof(expectedOutput)) == 0); +} + +void ComplexDedup(nlTestSuite * inSuite, void * inContext) +{ + const QNamePart kName1[] = { "some", "name" }; + const QNamePart kName2[] = { "other", "name" }; + const QNamePart kName3[] = { "prefix", "of", "other", "name" }; + const QNamePart kName4[] = { "some", "name", "suffix" }; + const QNamePart kName5[] = { "more", "suffix" }; + + uint8_t dataBuffer[128]; + + BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + + writer.WriteQName(FullQName(kName1)); + writer.WriteQName(FullQName(kName2)); + writer.WriteQName(FullQName(kName3)); + writer.Writer().Put("xyz"); // inject something that is NOT a qname + writer.WriteQName(FullQName(kName4)); + writer.WriteQName(FullQName(kName5)); + + // clang-format off + const uint8_t expectedOutput[] = { + // + 4, 's', 'o', 'm', 'e', // QNAME part: some + 4, 'n', 'a', 'm', 'e', // QNAME part: name + 0, // QNAME ends + 5, 'o', 't', 'h', 'e', 'r', // QNAME part: other + 0xC0, 5, // POINTER: "name" is at offset 5 + 6, 'p', 'r', 'e', 'f', 'i', 'x', + 2, 'o', 'f', + 0xC0, 11, // POINTER: "other.name" is at offset 11 + 'x', 'y', 'z', + 4, 's', 'o', 'm', 'e', // QNAME part: some + 4, 'n', 'a', 'm', 'e', // QNAME part: name + 6, 's', 'u', 'f', 'f', 'i', 'x', // suffix which prevents reuse + 0, + 4, 'm', 'o', 'r', 'e', + 0xC0, 44 + }; + // clang-format on + + NL_TEST_ASSERT(inSuite, output.Needed() == sizeof(expectedOutput)); + NL_TEST_ASSERT(inSuite, memcmp(dataBuffer, expectedOutput, sizeof(expectedOutput)) == 0); +} + +void TonsOfReferences(nlTestSuite * inSuite, void * inContext) +{ + const QNamePart kName1[] = { "some", "name" }; + const QNamePart kName2[] = { "different", "name" }; + + uint8_t dataBuffer[512]; + + BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + + // First name is 11 bytes (2*4 bytes + null terminator) + // all other entires are 2 bytes (back - references) + // + // TOTAL: 211 bytes written + for (int i = 0; i < 101; i++) + { + writer.WriteQName(FullQName(kName1)); + } + + // Extra size: 10 for "different" and 2 for "name" link + // TOTAL: 211 + 12 = 223 + writer.WriteQName(FullQName(kName2)); + + // Another 200 bytes for references + // TOTAL: 423 + for (int i = 0; i < 100; i++) + { + writer.WriteQName(FullQName(kName2)); + } + + NL_TEST_ASSERT(inSuite, output.Fit()); + NL_TEST_ASSERT(inSuite, output.Needed() == 423); +} + +} // namespace + +// clang-format off +static const nlTest sTests[] = +{ + NL_TEST_DEF("BasicWriteTest", BasicWriteTest), + NL_TEST_DEF("SimpleDedup", SimpleDedup), + NL_TEST_DEF("ComplexDedup", ComplexDedup), + NL_TEST_DEF("TonsOfReferences", TonsOfReferences), + + NL_TEST_SENTINEL() +}; +// clang-format on + +int TestRecordWriter(void) +{ + // clang-format off + nlTestSuite theSuite = + { + "RecordWriter", + &sTests[0], + nullptr, + nullptr + }; + // clang-format on + + nlTestRunner(&theSuite, nullptr); + + return (nlTestRunnerStats(&theSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestRecordWriter) diff --git a/src/lib/dnssd/minimal_mdns/records/IP.cpp b/src/lib/dnssd/minimal_mdns/records/IP.cpp index 1312f185e4cd1b..43c996a501cfcf 100644 --- a/src/lib/dnssd/minimal_mdns/records/IP.cpp +++ b/src/lib/dnssd/minimal_mdns/records/IP.cpp @@ -20,16 +20,16 @@ namespace mdns { namespace Minimal { -bool IPResourceRecord::WriteData(chip::Encoding::BigEndian::BufferWriter & out) const +bool IPResourceRecord::WriteData(RecordWriter & out) const { // IP address is already stored in network byte order, hence raw bytes put if (mIPAddress.IsIPv6()) { - out.Put(mIPAddress.Addr, 16); + out.Put(BytesRange::BufferWithSize(mIPAddress.Addr, 16)); } else { - out.Put(mIPAddress.Addr + 3, 4); + out.Put(BytesRange::BufferWithSize(mIPAddress.Addr + 3, 4)); } return out.Fit(); diff --git a/src/lib/dnssd/minimal_mdns/records/IP.h b/src/lib/dnssd/minimal_mdns/records/IP.h index 36f4e02a8eb98c..fc5efb87a51069 100644 --- a/src/lib/dnssd/minimal_mdns/records/IP.h +++ b/src/lib/dnssd/minimal_mdns/records/IP.h @@ -32,7 +32,7 @@ class IPResourceRecord : public ResourceRecord {} protected: - bool WriteData(chip::Encoding::BigEndian::BufferWriter & out) const override; + bool WriteData(RecordWriter & out) const override; private: const chip::Inet::IPAddress mIPAddress; diff --git a/src/lib/dnssd/minimal_mdns/records/Ptr.h b/src/lib/dnssd/minimal_mdns/records/Ptr.h index 3186b0e00f31d5..a6622d946c94f7 100644 --- a/src/lib/dnssd/minimal_mdns/records/Ptr.h +++ b/src/lib/dnssd/minimal_mdns/records/Ptr.h @@ -30,11 +30,7 @@ class PtrResourceRecord : public ResourceRecord const FullQName & GetPtr() const { return mPtrName; } protected: - bool WriteData(chip::Encoding::BigEndian::BufferWriter & out) const override - { - mPtrName.Output(out); - return out.Fit(); - } + bool WriteData(RecordWriter & out) const override { return out.WriteQName(mPtrName).Fit(); } private: const FullQName mPtrName; diff --git a/src/lib/dnssd/minimal_mdns/records/ResourceRecord.cpp b/src/lib/dnssd/minimal_mdns/records/ResourceRecord.cpp index 1b6dac4897b83e..ce0b7e8e58e2e0 100644 --- a/src/lib/dnssd/minimal_mdns/records/ResourceRecord.cpp +++ b/src/lib/dnssd/minimal_mdns/records/ResourceRecord.cpp @@ -20,7 +20,7 @@ namespace mdns { namespace Minimal { -bool ResourceRecord::Append(HeaderRef & hdr, ResourceType asType, chip::Encoding::BigEndian::BufferWriter & out) const +bool ResourceRecord::Append(HeaderRef & hdr, ResourceType asType, RecordWriter & out) const { // order is important based on resource type. First come answers, then authorityAnswers // and then additional: @@ -33,22 +33,22 @@ bool ResourceRecord::Append(HeaderRef & hdr, ResourceType asType, chip::Encoding return false; } - mQName.Output(out); + out.WriteQName(mQName); - out // + out.Writer() // .Put16(static_cast(GetType())) // .Put16(static_cast(GetClass())) // .Put32(static_cast(GetTtl())) // ; - chip::Encoding::BigEndian::BufferWriter sizeOutput(out); // copy to re-output size - out.Put16(0); // dummy, will be replaced later + chip::Encoding::BigEndian::BufferWriter sizeOutput(out.Writer()); // copy to re-output size + out.Put16(0); // dummy, will be replaced later if (!WriteData(out)) { return false; } - sizeOutput.Put16(static_cast(out.Needed() - sizeOutput.Needed() - 2)); + sizeOutput.Put16(static_cast(out.Writer().Needed() - sizeOutput.Needed() - 2)); // This MUST be final and separated out: record count is only updated on success. if (out.Fit()) diff --git a/src/lib/dnssd/minimal_mdns/records/ResourceRecord.h b/src/lib/dnssd/minimal_mdns/records/ResourceRecord.h index 51aa2b127cf582..67bae7ece63327 100644 --- a/src/lib/dnssd/minimal_mdns/records/ResourceRecord.h +++ b/src/lib/dnssd/minimal_mdns/records/ResourceRecord.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -57,11 +58,11 @@ class ResourceRecord /// Append the given record to the underlying output. /// Updates header item count on success, does NOT update header on failure. - bool Append(HeaderRef & hdr, ResourceType asType, chip::Encoding::BigEndian::BufferWriter & out) const; + bool Append(HeaderRef & hdr, ResourceType asType, RecordWriter & out) const; protected: /// Output the data portion of the resource record. - virtual bool WriteData(chip::Encoding::BigEndian::BufferWriter & out) const = 0; + virtual bool WriteData(RecordWriter & out) const = 0; ResourceRecord(QType type, FullQName name) : mType(type), mQName(name) {} diff --git a/src/lib/dnssd/minimal_mdns/records/Srv.h b/src/lib/dnssd/minimal_mdns/records/Srv.h index ede53db30637fa..7587805313c141 100644 --- a/src/lib/dnssd/minimal_mdns/records/Srv.h +++ b/src/lib/dnssd/minimal_mdns/records/Srv.h @@ -40,14 +40,9 @@ class SrvResourceRecord : public ResourceRecord void SetWeight(uint16_t value) { mWeight = value; } protected: - bool WriteData(chip::Encoding::BigEndian::BufferWriter & out) const override + bool WriteData(RecordWriter & out) const override { - out.Put16(mPriority); - out.Put16(mWeight); - out.Put16(mPort); - mServerName.Output(out); - - return out.Fit(); + return out.Put16(mPriority).Put16(mWeight).Put16(mPort).WriteQName(mServerName).Fit(); } private: diff --git a/src/lib/dnssd/minimal_mdns/records/Txt.h b/src/lib/dnssd/minimal_mdns/records/Txt.h index 54dcb806fa3f15..881e703f7cc164 100644 --- a/src/lib/dnssd/minimal_mdns/records/Txt.h +++ b/src/lib/dnssd/minimal_mdns/records/Txt.h @@ -52,18 +52,17 @@ class TxtResourceRecord : public ResourceRecord const char * const * GetEntries() const { return mEntries; } protected: - bool WriteData(chip::Encoding::BigEndian::BufferWriter & out) const override + bool WriteData(RecordWriter & out) const override { for (size_t i = 0; i < mEntryCount; i++) { size_t len = strlen(mEntries[i]); - if (len > kMaxQNamePartLength) + if (len > kMaxTxtRecordLength) { return false; } - out.Put8(static_cast(len)); - out.Put(mEntries[i]); + out.Put8(static_cast(len)).PutString(mEntries[i]); } return out.Fit(); } @@ -71,6 +70,8 @@ class TxtResourceRecord : public ResourceRecord private: const char * const * mEntries; const size_t mEntryCount; + + static constexpr size_t kMaxTxtRecordLength = 63; }; } // namespace Minimal diff --git a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecord.cpp b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecord.cpp index 522c2ac3c7145a..4269d73854ea4c 100644 --- a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecord.cpp +++ b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecord.cpp @@ -35,11 +35,7 @@ class FakeResourceRecord : public ResourceRecord FakeResourceRecord(const char * data) : ResourceRecord(QType::ANY, kNames), mData(data) {} protected: - bool WriteData(BufferWriter & out) const override - { - out.Put(mData); - return out.Fit(); - } + bool WriteData(RecordWriter & out) const override { return out.PutString(mData).Fit(); } private: const char * mData; @@ -54,6 +50,8 @@ void CanWriteSimpleRecord(nlTestSuite * inSuite, void * inContext) header.Clear(); BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + FakeResourceRecord record("somedata"); record.SetTtl(0x11223344); @@ -70,7 +68,7 @@ void CanWriteSimpleRecord(nlTestSuite * inSuite, void * inContext) 's', 'o', 'm', 'e', 'd', 'a', 't', 'a', }; - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); @@ -87,6 +85,8 @@ void CanWriteMultipleRecords(nlTestSuite * inSuite, void * inContext) header.Clear(); BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + FakeResourceRecord record1("somedata"); FakeResourceRecord record2("moredata"); FakeResourceRecord record3("xyz"); @@ -104,17 +104,13 @@ void CanWriteMultipleRecords(nlTestSuite * inSuite, void * inContext) 0x11, 0x22, 0x33, 0x44, // TTL 0, 8, // data size 's', 'o', 'm', 'e', 'd', 'a', 't', 'a', // - 3, 'f', 'o', 'o', // QNAME part: foo - 3, 'b', 'a', 'r', // QNAME part: bar - 0, // QNAME ends + 0xC0, 0x00, // PTR: foo.bar 0, 255, // QType ANY (totally fake) 0, 1, // QClass IN 0, 0, 0, 0, // TTL 0, 8, // data size 'm', 'o', 'r', 'e', 'd', 'a', 't', 'a', // - 3, 'f', 'o', 'o', // QNAME part: foo - 3, 'b', 'a', 'r', // QNAME part: bar - 0, // QNAME ends + 0xC0, 0x00, // PTR: foo.bar 0, 255, // QType ANY (totally fake) 0, 1, // QClass IN 0, 0, 0, 0xFF, // TTL @@ -122,17 +118,17 @@ void CanWriteMultipleRecords(nlTestSuite * inSuite, void * inContext) 'x', 'y', 'z', }; - NL_TEST_ASSERT(inSuite, record1.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, record1.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); - NL_TEST_ASSERT(inSuite, record2.Append(header, ResourceType::kAuthority, output)); + NL_TEST_ASSERT(inSuite, record2.Append(header, ResourceType::kAuthority, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); - NL_TEST_ASSERT(inSuite, record3.Append(header, ResourceType::kAdditional, output)); + NL_TEST_ASSERT(inSuite, record3.Append(header, ResourceType::kAdditional, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 1); @@ -149,16 +145,18 @@ void RecordOrderIsEnforced(nlTestSuite * inSuite, void * inContext) HeaderRef header(headerBuffer); BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + FakeResourceRecord record("somedata"); header.Clear(); header.SetAuthorityCount(1); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output) == false); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer) == false); header.Clear(); header.SetAdditionalCount(1); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output) == false); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAuthority, output) == false); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer) == false); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAuthority, writer) == false); } void ErrorsOutOnSmallBuffers(nlTestSuite * inSuite, void * inContext) @@ -191,8 +189,9 @@ void ErrorsOutOnSmallBuffers(nlTestSuite * inSuite, void * inContext) { memset(dataBuffer, 0, sizeof(dataBuffer)); BufferWriter output(dataBuffer, i); + RecordWriter writer(&output); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output) == false); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer) == false); // header untouched NL_TEST_ASSERT(inSuite, memcmp(headerBuffer, clearHeader, HeaderRef::kSizeBytes) == 0); @@ -200,8 +199,9 @@ void ErrorsOutOnSmallBuffers(nlTestSuite * inSuite, void * inContext) memset(dataBuffer, 0, sizeof(dataBuffer)); BufferWriter output(dataBuffer, sizeof(expectedOutput)); + RecordWriter writer(&output); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, output.Needed() == sizeof(expectedOutput)); NL_TEST_ASSERT(inSuite, memcmp(dataBuffer, expectedOutput, sizeof(expectedOutput)) == 0); NL_TEST_ASSERT(inSuite, memcmp(headerBuffer, clearHeader, HeaderRef::kSizeBytes) != 0); @@ -221,7 +221,9 @@ void RecordCount(nlTestSuite * inSuite, void * inContext) for (int i = 0; i < kAppendCount; i++) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output)); + RecordWriter writer(&output); + + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == i + 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); @@ -230,7 +232,9 @@ void RecordCount(nlTestSuite * inSuite, void * inContext) for (int i = 0; i < kAppendCount; i++) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAuthority, output)); + RecordWriter writer(&output); + + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAuthority, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == kAppendCount); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == i + 1); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); @@ -239,7 +243,9 @@ void RecordCount(nlTestSuite * inSuite, void * inContext) for (int i = 0; i < kAppendCount; i++) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, output)); + RecordWriter writer(&output); + + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == kAppendCount); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == kAppendCount); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == i + 1); diff --git a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordIP.cpp b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordIP.cpp index c1262adda27daa..ce66500b47e742 100644 --- a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordIP.cpp +++ b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordIP.cpp @@ -43,6 +43,8 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + IPResourceRecord ipResourceRecord(kNames, ipAddress); ipResourceRecord.SetTtl(123); @@ -61,7 +63,7 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) 10, 20, 30, 40 // IP Address }; - NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); @@ -71,6 +73,7 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); IPResourceRecord ipResourceRecord(kNames, ipAddress); @@ -90,7 +93,7 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) 10, 20, 30, 40 // IP Address }; - NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAuthority, output)); + NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAuthority, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); @@ -100,6 +103,7 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) { BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); IPResourceRecord ipResourceRecord(kNames, ipAddress); @@ -119,7 +123,7 @@ void WriteIPv4(nlTestSuite * inSuite, void * inContext) 10, 20, 30, 40 // IP Address }; - NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAdditional, output)); + NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAdditional, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 1); @@ -141,6 +145,7 @@ void WriteIPv6(nlTestSuite * inSuite, void * inContext) HeaderRef header(headerBuffer); BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); IPResourceRecord ipResourceRecord(kNames, ipAddress); ipResourceRecord.SetTtl(0x12345678); @@ -162,7 +167,7 @@ void WriteIPv6(nlTestSuite * inSuite, void * inContext) 0xfe, 0x19, 0x35, 0x9b }; - NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, ipResourceRecord.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); diff --git a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordPtr.cpp b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordPtr.cpp index aa388cd2cbfa2f..02f9d651752e0c 100644 --- a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordPtr.cpp +++ b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordPtr.cpp @@ -37,6 +37,8 @@ void TestPtrResourceRecord(nlTestSuite * inSuite, void * inContext) HeaderRef header(headerBuffer); BigEndian::BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); + PtrResourceRecord record(kName, kPtr); record.SetTtl(123); @@ -57,7 +59,7 @@ void TestPtrResourceRecord(nlTestSuite * inSuite, void * inContext) 0 // QNAME ends }; - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, output)); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAnswer, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 1); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 0); diff --git a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordSrv.cpp b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordSrv.cpp index d294741c3d342a..11fc163566074c 100644 --- a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordSrv.cpp +++ b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordSrv.cpp @@ -38,13 +38,14 @@ void TestSrv(nlTestSuite * inSuite, void * inContext) HeaderRef header(headerBuffer); BigEndian::BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); SrvResourceRecord record(kName, kServerName, kPort); record.SetTtl(128); header.Clear(); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, output)); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 1); diff --git a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordTxt.cpp b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordTxt.cpp index c7537a863d3a1d..4ed533aaacdec7 100644 --- a/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordTxt.cpp +++ b/src/lib/dnssd/minimal_mdns/records/tests/TestResourceRecordTxt.cpp @@ -37,6 +37,7 @@ void TestTxt(nlTestSuite * inSuite, void * inContext) HeaderRef header(headerBuffer); BigEndian::BufferWriter output(dataBuffer, sizeof(dataBuffer)); + RecordWriter writer(&output); TxtResourceRecord record(kName, kData); record.SetTtl(128); @@ -44,7 +45,7 @@ void TestTxt(nlTestSuite * inSuite, void * inContext) header.Clear(); - NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, output)); + NL_TEST_ASSERT(inSuite, record.Append(header, ResourceType::kAdditional, writer)); NL_TEST_ASSERT(inSuite, header.GetAnswerCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAuthorityCount() == 0); NL_TEST_ASSERT(inSuite, header.GetAdditionalCount() == 1); diff --git a/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp b/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp index f0cdd7fd79d37a..d9bf42a7383b8c 100644 --- a/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp @@ -53,11 +53,12 @@ class PtrResponseAccumulator : public ResponderDelegate uint8_t buffer[128]; BigEndian::BufferWriter out(buffer, sizeof(buffer)); + RecordWriter writer(&out); HeaderRef hdr(headerBuffer); hdr.Clear(); - NL_TEST_ASSERT(mSuite, record.Append(hdr, ResourceType::kAnswer, out)); + NL_TEST_ASSERT(mSuite, record.Append(hdr, ResourceType::kAnswer, writer)); ResourceData data; SerializedQNameIterator target; diff --git a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h index 250f304807bf80..6af8a16227fa4f 100644 --- a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h +++ b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h @@ -108,11 +108,11 @@ class CheckOnlyServer : private chip::PoolImplStart(), data->Start() + data->TotalLength()), this); + mPacketData = BytesRange(data->Start(), data->Start() + data->TotalLength()); + ParsePacket(mPacketData, this); if (mHeaderFound) { TestGotAllExpectedPackets(); @@ -317,6 +318,7 @@ class CheckOnlyServer : private chip::PoolImpl #include +#include #include #include #include @@ -46,6 +47,7 @@ struct CommonTestElements uint8_t * requestNameStart = requestStorage + ConstHeaderRef::kSizeBytes; Encoding::BigEndian::BufferWriter requestBufferWriter = Encoding::BigEndian::BufferWriter(requestNameStart, sizeof(requestStorage) - HeaderRef::kSizeBytes); + RecordWriter recordWriter; uint8_t dnsSdServiceStorage[64]; uint8_t serviceNameStorage[64]; @@ -71,6 +73,7 @@ struct CommonTestElements Inet::IPPacketInfo packetInfo; CommonTestElements(nlTestSuite * inSuite, const char * tag) : + recordWriter(&requestBufferWriter), dnsSd(FlatAllocatedQName::Build(dnsSdServiceStorage, "_services", "_dns-sd", "_udp", "local")), service(FlatAllocatedQName::Build(serviceNameStorage, tag, "service")), instance(FlatAllocatedQName::Build(instanceNameStorage, tag, "instance")), @@ -90,7 +93,7 @@ void SrvAnyResponseToInstance(nlTestSuite * inSuite, void * inContext) common.queryResponder.AddResponder(&common.srvResponder); // Build a query for our srv record - common.instance.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.instance); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -110,7 +113,7 @@ void SrvTxtAnyResponseToInstance(nlTestSuite * inSuite, void * inContext) common.queryResponder.AddResponder(&common.txtResponder); // Build a query for the instance name - common.instance.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.instance); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -133,7 +136,7 @@ void PtrSrvTxtAnyResponseToServiceName(nlTestSuite * inSuite, void * inContext) common.queryResponder.AddResponder(&common.txtResponder); // Build a query for the service name - common.service.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.service); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -158,7 +161,7 @@ void PtrSrvTxtAnyResponseToInstance(nlTestSuite * inSuite, void * inContext) common.queryResponder.AddResponder(&common.txtResponder); // Build a query for the instance name - common.instance.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.instance); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -182,7 +185,7 @@ void PtrSrvTxtSrvResponseToInstance(nlTestSuite * inSuite, void * inContext) common.queryResponder.AddResponder(&common.txtResponder); // Build a query for the instance - common.instance.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.instance); QueryData queryData = QueryData(QType::SRV, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -205,7 +208,7 @@ void PtrSrvTxtAnyResponseToServiceListing(nlTestSuite * inSuite, void * inContex common.queryResponder.AddResponder(&common.txtResponder); // Build a query for the dns-sd services listing. - common.dnsSd.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.dnsSd); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); @@ -226,15 +229,15 @@ void NoQueryResponder(nlTestSuite * inSuite, void * inContext) QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); - common.dnsSd.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.dnsSd); responseSender.Respond(1, queryData, &common.packetInfo); NL_TEST_ASSERT(inSuite, !common.server.GetSendCalled()); - common.service.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.service); responseSender.Respond(1, queryData, &common.packetInfo); NL_TEST_ASSERT(inSuite, !common.server.GetSendCalled()); - common.instance.Output(common.requestBufferWriter); + common.recordWriter.WriteQName(common.instance); responseSender.Respond(1, queryData, &common.packetInfo); NL_TEST_ASSERT(inSuite, !common.server.GetSendCalled()); } @@ -289,7 +292,7 @@ void PtrSrvTxtMultipleRespondersToInstance(nlTestSuite * inSuite, void * inConte common2.queryResponder.AddResponder(&common2.txtResponder); // Build a query for the second instance. - common2.instance.Output(common2.requestBufferWriter); + common2.recordWriter.WriteQName(common2.instance); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common2.requestNameStart, common2.requestBytesRange); // Should get back answers from second instance only. @@ -321,7 +324,7 @@ void PtrSrvTxtMultipleRespondersToServiceListing(nlTestSuite * inSuite, void * i common2.queryResponder.AddResponder(&common2.txtResponder); // Build a query for the instance - common1.dnsSd.Output(common1.requestBufferWriter); + common1.recordWriter.WriteQName(common1.dnsSd); QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common1.requestNameStart, common1.requestBytesRange); // Should get service listing from both. diff --git a/src/lib/support/BufferWriter.h b/src/lib/support/BufferWriter.h index b608d54ceda69c..a8afee2a7305b9 100644 --- a/src/lib/support/BufferWriter.h +++ b/src/lib/support/BufferWriter.h @@ -59,7 +59,10 @@ class BufferWriter } /// Number of bytes required to satisfy all calls to Put() so far - size_t Needed() const { return mNeeded; } + inline size_t Needed() const { return mNeeded; } + + /// Alias to Needed() for code clarity: current writing position for the buffer. + inline size_t WritePos() const { return Needed(); } /// Number of bytes still available for writing size_t Available() const { return mSize < mNeeded ? 0 : mSize - mNeeded; } From 51db97b85bf57d3d9bd508e6282a7a474e496950 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 3 Dec 2021 08:36:41 -0800 Subject: [PATCH 02/11] Add strict IM encoding ordering check (#12549) --- src/app/EventManagement.cpp | 12 ++--- src/app/MessageDef/ReportDataMessage.h | 10 ++-- src/app/MessageDef/StructParser.cpp | 30 +++++++++++ src/app/MessageDef/StructParser.h | 2 + src/app/ReadClient.cpp | 50 +++++++++---------- src/app/WriteClient.cpp | 11 ++-- src/app/tests/TestMessageDef.cpp | 33 ++++++------ src/app/tests/TestReadInteraction.cpp | 36 ++++++------- src/app/tests/TestWriteInteraction.cpp | 8 ++- .../tests/integration/chip_im_responder.cpp | 4 +- .../util/ember-compatibility-functions.cpp | 6 ++- src/app/util/mock/attribute-storage.cpp | 4 +- src/controller/tests/data_model/TestRead.cpp | 3 +- 13 files changed, 127 insertions(+), 82 deletions(-) diff --git a/src/app/EventManagement.cpp b/src/app/EventManagement.cpp index ee72348620c060..481234b0d9f003 100644 --- a/src/app/EventManagement.cpp +++ b/src/app/EventManagement.cpp @@ -449,12 +449,6 @@ CHIP_ERROR EventManagement::CopyAndAdjustDeltaTime(const TLVReader & aReader, si CopyAndAdjustDeltaTimeContext * ctx = static_cast(apContext); TLVReader reader(aReader); - if (aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kPath))) - { - err = - ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kEventNumber)), ctx->mpContext->mCurrentEventNumber); - } - if (aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp)) || aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp))) { @@ -490,6 +484,11 @@ CHIP_ERROR EventManagement::CopyAndAdjustDeltaTime(const TLVReader & aReader, si err = ctx->mpWriter->CopyElement(reader); } + if (aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kPath))) + { + err = + ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kEventNumber)), ctx->mpContext->mCurrentEventNumber); + } return err; } @@ -762,7 +761,6 @@ CHIP_ERROR EventManagement::FetchEventsSince(TLVWriter & aWriter, ClusterInfo * } exit: - ChipLogProgress(EventLogging, "Debug log, err: %s\n", chip::ErrorStr(err)); aEventNumber = context.mCurrentEventNumber; aEventCount += context.mEventCount; return err; diff --git a/src/app/MessageDef/ReportDataMessage.h b/src/app/MessageDef/ReportDataMessage.h index 3b8d098925469d..fa4aeb2977b019 100644 --- a/src/app/MessageDef/ReportDataMessage.h +++ b/src/app/MessageDef/ReportDataMessage.h @@ -40,11 +40,11 @@ namespace app { namespace ReportDataMessage { enum { - kCsTag_SuppressResponse = 0, - kCsTag_SubscriptionId = 1, - kCsTag_AttributeReportIBs = 2, - kCsTag_EventReports = 3, - kCsTag_MoreChunkedMessages = 4, + kCsTag_SubscriptionId = 0, + kCsTag_AttributeReportIBs = 1, + kCsTag_EventReports = 2, + kCsTag_MoreChunkedMessages = 3, + kCsTag_SuppressResponse = 4, }; class Parser : public StructParser diff --git a/src/app/MessageDef/StructParser.cpp b/src/app/MessageDef/StructParser.cpp index 3e78b631c59727..c1886939ce5993 100644 --- a/src/app/MessageDef/StructParser.cpp +++ b/src/app/MessageDef/StructParser.cpp @@ -23,7 +23,37 @@ CHIP_ERROR StructParser::Init(const TLV::TLVReader & aReader) mReader.Init(aReader); VerifyOrReturnError(TLV::kTLVType_Structure == mReader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType)); + ReturnErrorOnFailure(CheckSchemaOrdering()); return CHIP_NO_ERROR; } + +CHIP_ERROR StructParser::CheckSchemaOrdering() const +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVReader reader; + reader.Init(mReader); + uint32_t preTagNum = 0; + bool first = true; + while (CHIP_NO_ERROR == (err = reader.Next())) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + uint32_t tagNum = TLV::TagNumFromTag(reader.GetTag()); + if (first || (preTagNum < tagNum)) + { + preTagNum = tagNum; + } + else + { + return CHIP_ERROR_INVALID_TLV_TAG; + } + first = false; + } + if (CHIP_END_OF_TLV == err) + { + err = CHIP_NO_ERROR; + } + ReturnErrorOnFailure(err); + return reader.ExitContainer(mOuterContainerType); +} } // namespace app } // namespace chip diff --git a/src/app/MessageDef/StructParser.h b/src/app/MessageDef/StructParser.h index 6206ec1bd29543..acf4d94c8d20a8 100644 --- a/src/app/MessageDef/StructParser.h +++ b/src/app/MessageDef/StructParser.h @@ -33,6 +33,8 @@ class StructParser : public Parser * @return #CHIP_NO_ERROR on success */ CHIP_ERROR Init(const TLV::TLVReader & aReader); + + CHIP_ERROR CheckSchemaOrdering() const; }; } // namespace app } // namespace chip diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 52dd3749ed6a11..297a418d29fc57 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -140,6 +140,15 @@ CHIP_ERROR ReadClient::SendReadRequest(ReadPrepareParams & aReadPrepareParams) err = request.Init(&writer); SuccessOrExit(err); + if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) + { + AttributePathIBs::Builder attributePathListBuilder = request.CreateAttributeRequests(); + SuccessOrExit(err = attributePathListBuilder.GetError()); + err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, + aReadPrepareParams.mAttributePathParamsListSize); + SuccessOrExit(err); + } + if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { EventPathIBs::Builder & eventPathListBuilder = request.CreateEventRequests(); @@ -160,15 +169,6 @@ CHIP_ERROR ReadClient::SendReadRequest(ReadPrepareParams & aReadPrepareParams) } } - if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) - { - AttributePathIBs::Builder attributePathListBuilder = request.CreateAttributeRequests(); - SuccessOrExit(err = attributePathListBuilder.GetError()); - err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, - aReadPrepareParams.mAttributePathParamsListSize); - SuccessOrExit(err); - } - request.IsFabricFiltered(false).EndOfReadRequestMessage(); SuccessOrExit(err = request.GetError()); @@ -632,12 +632,27 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara VerifyOrExit(mpCallback != nullptr, err = CHIP_ERROR_INCORRECT_STATE); msgBuf = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes); VerifyOrExit(!msgBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + VerifyOrExit(aReadPrepareParams.mMinIntervalFloorSeconds < aReadPrepareParams.mMaxIntervalCeilingSeconds, + err = CHIP_ERROR_INVALID_ARGUMENT); writer.Init(std::move(msgBuf)); err = request.Init(&writer); SuccessOrExit(err); + request.KeepSubscriptions(aReadPrepareParams.mKeepSubscriptions) + .MinIntervalFloorSeconds(aReadPrepareParams.mMinIntervalFloorSeconds) + .MaxIntervalCeilingSeconds(aReadPrepareParams.mMaxIntervalCeilingSeconds); + + if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) + { + AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); + SuccessOrExit(err = attributePathListBuilder.GetError()); + err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, + aReadPrepareParams.mAttributePathParamsListSize); + SuccessOrExit(err); + } + if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { EventPathIBs::Builder & eventPathListBuilder = request.CreateEventRequests(); @@ -659,22 +674,7 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara } } - if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) - { - AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); - SuccessOrExit(err = attributePathListBuilder.GetError()); - err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, - aReadPrepareParams.mAttributePathParamsListSize); - SuccessOrExit(err); - } - - VerifyOrExit(aReadPrepareParams.mMinIntervalFloorSeconds < aReadPrepareParams.mMaxIntervalCeilingSeconds, - err = CHIP_ERROR_INVALID_ARGUMENT); - request.MinIntervalFloorSeconds(aReadPrepareParams.mMinIntervalFloorSeconds) - .MaxIntervalCeilingSeconds(aReadPrepareParams.mMaxIntervalCeilingSeconds) - .KeepSubscriptions(aReadPrepareParams.mKeepSubscriptions) - .IsFabricFiltered(false) - .EndOfSubscribeRequestMessage(); + request.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); SuccessOrExit(err = request.GetError()); err = writer.Finalize(&msgBuf); diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 52842c52b2aac7..50d6f71d29c9cd 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -43,11 +43,10 @@ CHIP_ERROR WriteClient::Init(Messaging::ExchangeManager * apExchangeMgr, Callbac mMessageWriter.Init(std::move(packet)); ReturnErrorOnFailure(mWriteRequestBuilder.Init(&mMessageWriter)); - mWriteRequestBuilder.TimedRequest(false).IsFabricFiltered(false); + mWriteRequestBuilder.TimedRequest(false); ReturnErrorOnFailure(mWriteRequestBuilder.GetError()); attributeDataIBsBuilder = mWriteRequestBuilder.CreateWriteRequests(); ReturnErrorOnFailure(attributeDataIBsBuilder.GetError()); - ClearExistingExchangeContext(); mpExchangeMgr = apExchangeMgr; mpCallback = apCallback; @@ -139,6 +138,9 @@ CHIP_ERROR WriteClient::PrepareAttribute(const AttributePathParams & attributePa VerifyOrReturnError(attributePathParams.IsValidAttributePath(), CHIP_ERROR_INVALID_PATH_LIST); AttributeDataIB::Builder attributeDataIB = mWriteRequestBuilder.GetWriteRequests().CreateAttributeDataIBBuilder(); ReturnErrorOnFailure(attributeDataIB.GetError()); + // TODO: Add attribute version support + attributeDataIB.DataVersion(0); + ReturnErrorOnFailure(attributeDataIB.GetError()); ReturnErrorOnFailure(attributeDataIB.CreatePath().Encode(attributePathParams)); return CHIP_NO_ERROR; } @@ -148,9 +150,6 @@ CHIP_ERROR WriteClient::FinishAttribute() CHIP_ERROR err = CHIP_NO_ERROR; AttributeDataIB::Builder AttributeDataIB = mWriteRequestBuilder.GetWriteRequests().GetAttributeDataIBBuilder(); - - // TODO: Add attribute version support - AttributeDataIB.DataVersion(0); AttributeDataIB.EndOfAttributeDataIB(); SuccessOrExit(err = AttributeDataIB.GetError()); MoveToState(State::AddAttribute); @@ -173,7 +172,7 @@ CHIP_ERROR WriteClient::FinalizeMessage(System::PacketBufferHandle & aPacket) err = AttributeDataIBsBuilder.GetError(); SuccessOrExit(err); - mWriteRequestBuilder.EndOfWriteRequestMessage(); + mWriteRequestBuilder.IsFabricFiltered(false).EndOfWriteRequestMessage(); err = mWriteRequestBuilder.GetError(); SuccessOrExit(err); diff --git a/src/app/tests/TestMessageDef.cpp b/src/app/tests/TestMessageDef.cpp index db547413706b3f..b984621e2f7e1b 100644 --- a/src/app/tests/TestMessageDef.cpp +++ b/src/app/tests/TestMessageDef.cpp @@ -323,7 +323,7 @@ void BuildEventDataIB(nlTestSuite * apSuite, EventDataIB::Builder & aEventDataIB NL_TEST_ASSERT(apSuite, eventPathBuilder.GetError() == CHIP_NO_ERROR); BuildEventPath(apSuite, eventPathBuilder); - aEventDataIBBuilder.Priority(2).EventNumber(3).EpochTimestamp(4).SystemTimestamp(5).DeltaEpochTimestamp(6).DeltaSystemTimestamp( + aEventDataIBBuilder.EventNumber(2).Priority(3).EpochTimestamp(4).SystemTimestamp(5).DeltaEpochTimestamp(6).DeltaSystemTimestamp( 7); err = aEventDataIBBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -365,10 +365,10 @@ void ParseEventDataIB(nlTestSuite * apSuite, EventDataIB::Parser & aEventDataIBP err = aEventDataIBParser.GetPath(&eventPath); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } - err = aEventDataIBParser.GetPriority(&priorityLevel); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && priorityLevel == 2); err = aEventDataIBParser.GetEventNumber(&number); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && number == 3); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && number == 2); + err = aEventDataIBParser.GetPriority(&priorityLevel); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && priorityLevel == 3); err = aEventDataIBParser.GetEpochTimestamp(&EpochTimestamp); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR && EpochTimestamp == 4); err = aEventDataIBParser.GetSystemTimestamp(&systemTimestamp); @@ -535,6 +535,7 @@ void BuildAttributeDataIB(nlTestSuite * apSuite, AttributeDataIB::Builder & aAtt { CHIP_ERROR err = CHIP_NO_ERROR; + aAttributeDataIBBuilder.DataVersion(2); AttributePathIB::Builder attributePathBuilder = aAttributeDataIBBuilder.CreatePath(); NL_TEST_ASSERT(apSuite, aAttributeDataIBBuilder.GetError() == CHIP_NO_ERROR); BuildAttributePathIB(apSuite, attributePathBuilder); @@ -553,7 +554,7 @@ void BuildAttributeDataIB(nlTestSuite * apSuite, AttributeDataIB::Builder & aAtt err = pWriter->EndContainer(dummyType); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } - aAttributeDataIBBuilder.DataVersion(2); + err = aAttributeDataIBBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); aAttributeDataIBBuilder.EndOfAttributeDataIB(); @@ -963,7 +964,7 @@ void BuildReportDataMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWrite err = reportDataMessageBuilder.Init(&aWriter); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - reportDataMessageBuilder.SuppressResponse(true).SubscriptionId(2); + reportDataMessageBuilder.SubscriptionId(2); NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); AttributeReportIBs::Builder AttributeReportIBs = reportDataMessageBuilder.CreateAttributeReportIBs(); @@ -974,7 +975,7 @@ void BuildReportDataMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & aWrite NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); BuildEventReports(apSuite, EventReportIBs); - reportDataMessageBuilder.MoreChunkedMessages(true); + reportDataMessageBuilder.MoreChunkedMessages(true).SuppressResponse(true); NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); reportDataMessageBuilder.EndOfReportDataMessage(); @@ -1170,26 +1171,26 @@ void BuildSubscribeRequestMessage(nlTestSuite * apSuite, chip::TLV::TLVWriter & err = subscribeRequestBuilder.Init(&aWriter); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - AttributePathIBs::Builder attributePathIBs = subscribeRequestBuilder.CreateAttributeRequests(); + subscribeRequestBuilder.KeepSubscriptions(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildAttributePathList(apSuite, attributePathIBs); - EventPathIBs::Builder eventPathList = subscribeRequestBuilder.CreateEventRequests(); + subscribeRequestBuilder.MinIntervalFloorSeconds(2); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildEventPaths(apSuite, eventPathList); - EventFilterIBs::Builder eventFilters = subscribeRequestBuilder.CreateEventFilters(); + subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - BuildEventFilters(apSuite, eventFilters); - subscribeRequestBuilder.MinIntervalFloorSeconds(2); + AttributePathIBs::Builder attributePathIBs = subscribeRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildAttributePathList(apSuite, attributePathIBs); - subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); + EventPathIBs::Builder eventPathList = subscribeRequestBuilder.CreateEventRequests(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildEventPaths(apSuite, eventPathList); - subscribeRequestBuilder.KeepSubscriptions(true); + EventFilterIBs::Builder eventFilters = subscribeRequestBuilder.CreateEventFilters(); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + BuildEventFilters(apSuite, eventFilters); subscribeRequestBuilder.IsProxy(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 3617cf01abbcff..5f20fabdb8f8d6 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -248,11 +248,13 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre } attributeData = aAttributeReport.CreateAttributeData(); + attributeData.DataVersion(0); + ReturnErrorOnFailure(attributeData.GetError()); attributePath = attributeData.CreatePath(); attributePath.Endpoint(aPath.mEndpointId).Cluster(aPath.mClusterId).Attribute(aPath.mAttributeId).EndOfAttributePathIB(); ReturnErrorOnFailure(attributePath.GetError()); ReturnErrorOnFailure(AttributeValueEncoder(attributeData.GetWriter(), 0).Encode(kTestFieldValue1)); - attributeData.DataVersion(0).EndOfAttributeDataIB(); + attributeData.EndOfAttributeDataIB(); ReturnErrorOnFailure(attributeData.GetError()); return CHIP_NO_ERROR; } @@ -298,9 +300,6 @@ void TestReadInteraction::GenerateReportData(nlTestSuite * apSuite, void * apCon err = reportDataMessageBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - reportDataMessageBuilder.SuppressResponse(aSuppressResponse); - NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); - AttributeReportIBs::Builder attributeReportIBsBuilder = reportDataMessageBuilder.CreateAttributeReportIBs(); NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); @@ -310,6 +309,10 @@ void TestReadInteraction::GenerateReportData(nlTestSuite * apSuite, void * apCon AttributeDataIB::Builder attributeDataIBBuilder = attributeReportIBBuilder.CreateAttributeData(); NL_TEST_ASSERT(apSuite, attributeReportIBBuilder.GetError() == CHIP_NO_ERROR); + attributeDataIBBuilder.DataVersion(2); + err = attributeDataIBBuilder.GetError(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + AttributePathIB::Builder attributePathBuilder = attributeDataIBBuilder.CreatePath(); NL_TEST_ASSERT(apSuite, attributeDataIBBuilder.GetError() == CHIP_NO_ERROR); @@ -325,10 +328,6 @@ void TestReadInteraction::GenerateReportData(nlTestSuite * apSuite, void * apCon err = attributePathBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - attributeDataIBBuilder.DataVersion(2); - err = attributeDataIBBuilder.GetError(); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - // Construct attribute data { chip::TLV::TLVWriter * pWriter = attributeDataIBBuilder.GetWriter(); @@ -356,6 +355,9 @@ void TestReadInteraction::GenerateReportData(nlTestSuite * apSuite, void * apCon reportDataMessageBuilder.MoreChunkedMessages(false); NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); + reportDataMessageBuilder.SuppressResponse(aSuppressResponse); + NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); + reportDataMessageBuilder.EndOfReportDataMessage(); NL_TEST_ASSERT(apSuite, reportDataMessageBuilder.GetError() == CHIP_NO_ERROR); @@ -930,6 +932,15 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi err = subscribeRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + subscribeRequestBuilder.KeepSubscriptions(true); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.MinIntervalFloorSeconds(2); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + + subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); + NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); + AttributePathIBs::Builder attributePathListBuilder = subscribeRequestBuilder.CreateAttributeRequests(); NL_TEST_ASSERT(apSuite, attributePathListBuilder.GetError() == CHIP_NO_ERROR); @@ -944,15 +955,6 @@ void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, voi err = attributePathListBuilder.GetError(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - subscribeRequestBuilder.MinIntervalFloorSeconds(2); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - - subscribeRequestBuilder.MaxIntervalCeilingSeconds(3); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - - subscribeRequestBuilder.KeepSubscriptions(true); - NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); - subscribeRequestBuilder.IsProxy(true); NL_TEST_ASSERT(apSuite, subscribeRequestBuilder.GetError() == CHIP_NO_ERROR); diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 05960015d2fba1..c850a4b40a38d0 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -126,11 +126,15 @@ void TestWriteInteraction::GenerateWriteRequest(nlTestSuite * apSuite, void * ap WriteRequestMessage::Builder writeRequestBuilder; err = writeRequestBuilder.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + writeRequestBuilder.TimedRequest(aIsTimedWrite); + NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); AttributeDataIBs::Builder attributeDataIBsBuilder = writeRequestBuilder.CreateWriteRequests(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); AttributeDataIB::Builder attributeDataIBBuilder = attributeDataIBsBuilder.CreateAttributeDataIBBuilder(); NL_TEST_ASSERT(apSuite, attributeDataIBsBuilder.GetError() == CHIP_NO_ERROR); + attributeDataIBBuilder.DataVersion(0); + NL_TEST_ASSERT(apSuite, attributeDataIBBuilder.GetError() == CHIP_NO_ERROR); AttributePathIB::Builder attributePathBuilder = attributeDataIBBuilder.CreatePath(); NL_TEST_ASSERT(apSuite, attributePathBuilder.GetError() == CHIP_NO_ERROR); attributePathBuilder.Node(1).Endpoint(2).Cluster(3).Attribute(4).ListIndex(5).EndOfAttributePathIB(); @@ -152,12 +156,12 @@ void TestWriteInteraction::GenerateWriteRequest(nlTestSuite * apSuite, void * ap NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } - attributeDataIBBuilder.DataVersion(0).EndOfAttributeDataIB(); + attributeDataIBBuilder.EndOfAttributeDataIB(); NL_TEST_ASSERT(apSuite, attributeDataIBBuilder.GetError() == CHIP_NO_ERROR); attributeDataIBsBuilder.EndOfAttributeDataIBs(); NL_TEST_ASSERT(apSuite, attributeDataIBsBuilder.GetError() == CHIP_NO_ERROR); - writeRequestBuilder.TimedRequest(aIsTimedWrite).IsFabricFiltered(false).EndOfWriteRequestMessage(); + writeRequestBuilder.IsFabricFiltered(false).EndOfWriteRequestMessage(); NL_TEST_ASSERT(apSuite, writeRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&aPayload); diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index eddf1916a5fd69..3d51ca2c93391a 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -114,12 +114,14 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre AttributeReportIB::Builder & aAttributeReport) { AttributeDataIB::Builder attributeData = aAttributeReport.CreateAttributeData(); + attributeData.DataVersion(0); + ReturnErrorOnFailure(attributeData.GetError()); AttributePathIB::Builder attributePath = attributeData.CreatePath(); VerifyOrReturnError(aPath.mClusterId == kTestClusterId && aPath.mEndpointId == kTestEndpointId, CHIP_ERROR_INVALID_ARGUMENT); attributePath.Endpoint(aPath.mEndpointId).Cluster(aPath.mClusterId).Attribute(aPath.mAttributeId).EndOfAttributePathIB(); ReturnErrorOnFailure(attributePath.GetError()); ReturnErrorOnFailure(AttributeValueEncoder(attributeData.GetWriter(), 0).Encode(kTestFieldValue1)); - attributeData.DataVersion(0).EndOfAttributeDataIB(); + attributeData.EndOfAttributeDataIB(); ReturnErrorOnFailure(attributeData.GetError()); return CHIP_NO_ERROR; } diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 76bb3629aa818f..96542cdd006cfc 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -215,7 +215,7 @@ namespace { CHIP_ERROR SendSuccessStatus(AttributeDataIB::Builder & aAttributeDataIBBuilder) { - aAttributeDataIBBuilder.DataVersion(kTemporaryDataVersion).EndOfAttributeDataIB(); + aAttributeDataIBBuilder.EndOfAttributeDataIB(); return aAttributeDataIBBuilder.GetError(); } @@ -252,7 +252,11 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre AttributeDataIB::Builder attributeDataIBBuilder = aAttributeReport.CreateAttributeData(); ReturnErrorOnFailure(attributeDataIBBuilder.GetError()); + attributeDataIBBuilder.DataVersion(kTemporaryDataVersion); + ReturnErrorOnFailure(attributeDataIBBuilder.GetError()); + AttributePathIB::Builder attributePathIBBuilder = attributeDataIBBuilder.CreatePath(); + ReturnErrorOnFailure(attributeDataIBBuilder.GetError()); attributePathIBBuilder.Endpoint(aPath.mEndpointId) .Cluster(aPath.mClusterId) .Attribute(aPath.mAttributeId) diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 57c3bad233b2c5..471ab2bdadecb8 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -239,6 +239,8 @@ CHIP_ERROR ReadSingleMockClusterData(FabricIndex aAccessingFabricIndex, const Co } attributeData = aAttributeReport.CreateAttributeData(); + attributeData.DataVersion(0); + ReturnErrorOnFailure(attributeData.GetError()); attributePath = attributeData.CreatePath(); attributePath.Endpoint(aPath.mEndpointId).Cluster(aPath.mClusterId).Attribute(aPath.mAttributeId).EndOfAttributePathIB(); ReturnErrorOnFailure(attributePath.GetError()); @@ -271,7 +273,7 @@ CHIP_ERROR ReadSingleMockClusterData(FabricIndex aAccessingFabricIndex, const Co return CHIP_ERROR_KEY_NOT_FOUND; } - attributeData.DataVersion(0).EndOfAttributeDataIB(); + attributeData.EndOfAttributeDataIB(); return attributeData.GetError(); } diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index de7ff36ff47580..631e16025f0454 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -77,13 +77,14 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre i++; } + attributeData.DataVersion(0); AttributePathIB::Builder attributePath = attributeData.CreatePath(); attributePath.Endpoint(aPath.mEndpointId).Cluster(aPath.mClusterId).Attribute(aPath.mAttributeId).EndOfAttributePathIB(); ReturnErrorOnFailure(attributePath.GetError()); ReturnErrorOnFailure(DataModel::Encode(*(attributeData.GetWriter()), chip::TLV::ContextTag(chip::to_underlying(AttributeDataIB::Tag::kData)), value)); - attributeData.DataVersion(0).EndOfAttributeDataIB(); + attributeData.EndOfAttributeDataIB(); return CHIP_NO_ERROR; } else From 791577ea735dd9b329f60560b9bc2be9eb01f171 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 3 Dec 2021 08:43:35 -0800 Subject: [PATCH 03/11] Implement event support for General Diagnostics cluster (#12502) --- .../general_diagnostics_server.cpp | 8 ++- src/include/platform/DiagnosticDataProvider.h | 7 +- src/platform/Linux/PlatformManagerImpl.cpp | 72 +++++++++++++++---- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp b/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp index 688c3ba1ef6722..d8495dc6df6593 100644 --- a/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp +++ b/src/app/clusters/general_diagnostics_server/general_diagnostics_server.cpp @@ -28,6 +28,7 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::GeneralDiagnostics; using namespace chip::app::Clusters::GeneralDiagnostics::Attributes; using namespace chip::DeviceLayer; using chip::DeviceLayer::ConnectivityMgr; @@ -215,7 +216,8 @@ class GeneralDiagnosticsDelegate : public DeviceLayer::ConnectivityManagerDelega } // Get called when the Node detects a hardware fault has been raised. - void OnHardwareFaultsDetected() override + void OnHardwareFaultsDetected(GeneralFaults & previous, + GeneralFaults & current) override { ChipLogProgress(Zcl, "GeneralDiagnosticsDelegate: OnHardwareFaultsDetected"); @@ -236,7 +238,7 @@ class GeneralDiagnosticsDelegate : public DeviceLayer::ConnectivityManagerDelega } // Get called when the Node detects a radio fault has been raised. - void OnRadioFaultsDetected() override + void OnRadioFaultsDetected(GeneralFaults & previous, GeneralFaults & current) override { ChipLogProgress(Zcl, "GeneralDiagnosticsDelegate: OnHardwareFaultsDetected"); @@ -257,7 +259,7 @@ class GeneralDiagnosticsDelegate : public DeviceLayer::ConnectivityManagerDelega } // Get called when the Node detects a network fault has been raised. - void OnNetworkFaultsDetected() override + void OnNetworkFaultsDetected(GeneralFaults & previous, GeneralFaults & current) override { ChipLogProgress(Zcl, "GeneralDiagnosticsDelegate: OnHardwareFaultsDetected"); diff --git a/src/include/platform/DiagnosticDataProvider.h b/src/include/platform/DiagnosticDataProvider.h index f28e33477fdf52..e02a96201db182 100644 --- a/src/include/platform/DiagnosticDataProvider.h +++ b/src/include/platform/DiagnosticDataProvider.h @@ -67,19 +67,20 @@ class GeneralDiagnosticsDelegate * @brief * Called when the Node detects a hardware fault has been raised. */ - virtual void OnHardwareFaultsDetected() {} + virtual void OnHardwareFaultsDetected(GeneralFaults & previous, GeneralFaults & current) + {} /** * @brief * Called when the Node detects a radio fault has been raised. */ - virtual void OnRadioFaultsDetected() {} + virtual void OnRadioFaultsDetected(GeneralFaults & previous, GeneralFaults & current) {} /** * @brief * Called when the Node detects a network fault has been raised. */ - virtual void OnNetworkFaultsDetected() {} + virtual void OnNetworkFaultsDetected(GeneralFaults & previous, GeneralFaults & current) {} }; /** diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index e1623903140b9f..76ac2fa9679f55 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -275,22 +275,64 @@ void PlatformManagerImpl::HandleGeneralFault(uint32_t EventId) { GeneralDiagnosticsDelegate * delegate = GetDiagnosticDataProvider().GetGeneralDiagnosticsDelegate(); - if (delegate != nullptr) + if (delegate == nullptr) + { + ChipLogError(DeviceLayer, "No delegate registered to handle General Diagnostics event"); + return; + } + + if (EventId == GeneralDiagnostics::Events::HardwareFaultChange::kEventId) + { + GeneralFaults previous; + GeneralFaults current; + +#if CHIP_CONFIG_TEST + // On Linux Simulation, set following hardware faults statically. + ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_RADIO)); + ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_POWER_SOURCE)); + + ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_RADIO)); + ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_SENSOR)); + ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_POWER_SOURCE)); + ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_USER_INTERFACE_FAULT)); +#endif + delegate->OnHardwareFaultsDetected(previous, current); + } + else if (EventId == GeneralDiagnostics::Events::RadioFaultChange::kEventId) + { + GeneralFaults previous; + GeneralFaults current; + +#if CHIP_CONFIG_TEST + // On Linux Simulation, set following radio faults statically. + ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_TYPE_WI_FI_FAULT)); + ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_TYPE_THREAD_FAULT)); + + ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_WI_FI_FAULT)); + ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_CELLULAR_FAULT)); + ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_THREAD_FAULT)); + ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_NFC_FAULT)); +#endif + delegate->OnRadioFaultsDetected(previous, current); + } + else if (EventId == GeneralDiagnostics::Events::NetworkFaultChange::kEventId) + { + GeneralFaults previous; + GeneralFaults current; + +#if CHIP_CONFIG_TEST + // On Linux Simulation, set following radio faults statically. + ReturnOnFailure(previous.add(EMBER_ZCL_NETWORK_FAULT_TYPE_HARDWARE_FAILURE)); + ReturnOnFailure(previous.add(EMBER_ZCL_NETWORK_FAULT_TYPE_NETWORK_JAMMED)); + + ReturnOnFailure(current.add(EMBER_ZCL_NETWORK_FAULT_TYPE_HARDWARE_FAILURE)); + ReturnOnFailure(current.add(EMBER_ZCL_NETWORK_FAULT_TYPE_NETWORK_JAMMED)); + ReturnOnFailure(current.add(EMBER_ZCL_NETWORK_FAULT_TYPE_CONNECTION_FAILED)); +#endif + delegate->OnNetworkFaultsDetected(previous, current); + } + else { - switch (EventId) - { - case GeneralDiagnostics::Events::HardwareFaultChange::kEventId: - delegate->OnHardwareFaultsDetected(); - break; - case GeneralDiagnostics::Events::RadioFaultChange::kEventId: - delegate->OnRadioFaultsDetected(); - break; - case GeneralDiagnostics::Events::NetworkFaultChange::kEventId: - delegate->OnNetworkFaultsDetected(); - break; - default: - break; - } } } From aa7196929f9d8fe4cdcaea8590dde5a7369ef313 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 3 Dec 2021 11:45:30 -0500 Subject: [PATCH 04/11] Separate PASE and commissioning. (#12060) * Separate PASE and commissioning. Current "PairDevice" commands will continue to work as previously, but separating out the commissioning part from the PASE connection so vendors can have an easier time implemeting their own commissioning flows. * Update src/controller/CHIPDeviceController.cpp Co-authored-by: Martin Turon * Fix android. * Restyled by autopep8 * Add comments on appropriate use of functions. Co-authored-by: Martin Turon Co-authored-by: Restyled.io --- src/controller/CHIPDeviceController.cpp | 121 ++++++++++++------ src/controller/CHIPDeviceController.h | 43 ++++++- .../java/CHIPDeviceController-JNI.cpp | 26 ++-- .../ChipDeviceController-ScriptBinding.cpp | 21 +++ src/controller/python/chip-device-ctrl.py | 54 ++++++++ src/controller/python/chip/ChipDeviceCtrl.py | 31 +++++ .../secure_channel/RendezvousParameters.h | 47 ++++--- 7 files changed, 273 insertions(+), 70 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 1157992b489109..6d4857e02ba217 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -761,6 +761,20 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, const char * se CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParameters & params) { + CommissioningParameters commissioningParams; + return PairDevice(remoteDeviceId, params, commissioningParams); +} + +CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParameters & rendezvousParams, + CommissioningParameters & commissioningParams) +{ + ReturnErrorOnFailure(EstablishPASEConnection(remoteDeviceId, rendezvousParams)); + return Commission(remoteDeviceId, commissioningParams); +} + +CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, RendezvousParameters & params) +{ + CHIP_ERROR err = CHIP_NO_ERROR; CommissioneeDeviceProxy * device = nullptr; Transport::PeerAddress peerAddress = Transport::PeerAddress::UDP(Inet::IPAddress::Any); @@ -804,30 +818,6 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam mDeviceBeingCommissioned = device; - // If the CSRNonce is passed in, using that else using a random one.. - if (params.HasCSRNonce()) - { - ReturnErrorOnFailure(device->SetCSRNonce(params.GetCSRNonce().Value())); - } - else - { - uint8_t mCSRNonce[kOpCSRNonceLength]; - Crypto::DRBG_get_bytes(mCSRNonce, sizeof(mCSRNonce)); - ReturnErrorOnFailure(device->SetCSRNonce(ByteSpan(mCSRNonce))); - } - - // If the AttestationNonce is passed in, using that else using a random one.. - if (params.HasAttestationNonce()) - { - ReturnErrorOnFailure(device->SetAttestationNonce(params.GetAttestationNonce().Value())); - } - else - { - uint8_t mAttestationNonce[kAttestationNonceLength]; - Crypto::DRBG_get_bytes(mAttestationNonce, sizeof(mAttestationNonce)); - ReturnErrorOnFailure(device->SetAttestationNonce(ByteSpan(mAttestationNonce))); - } - mIsIPRendezvous = (params.GetPeerAddress().GetTransportType() != Transport::Type::kBle); device->Init(GetControllerDeviceInitParams(), remoteDeviceId, peerAddress, fabric->GetFabricIndex()); @@ -835,8 +825,6 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam err = device->GetPairing().MessageDispatch().Init(mSystemState->SessionMgr()); SuccessOrExit(err); - mSystemState->SystemLayer()->StartTimer(chip::System::Clock::Milliseconds32(kSessionEstablishmentTimeout), - OnSessionEstablishmentTimeoutCallback, this); if (params.GetPeerAddress().GetTransportType() != Transport::Type::kBle) { device->SetAddress(params.GetPeerAddress().GetIPAddress()); @@ -874,9 +862,10 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam err = device->GetPairing().Pair(params.GetPeerAddress(), params.GetSetupPINCode(), keyID, exchangeCtxt, this); SuccessOrExit(err); - // Immediately persist the updted mNextKeyID value + // Immediately persist the updated mNextKeyID value // TODO maybe remove FreeRendezvousSession() since mNextKeyID is always persisted immediately PersistNextKeyId(); + mCommissioningStage = kSecurePairing; exit: if (err != CHIP_NO_ERROR) @@ -897,6 +886,58 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam return err; } +CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningParameters & params) +{ + // TODO(cecille): Can we get rid of mDeviceBeingCommissioned and use the remote id instead? Would require storing the + // commissioning stage in the device. + CommissioneeDeviceProxy * device = mDeviceBeingCommissioned; + if (device->GetDeviceId() != remoteDeviceId || (!device->IsSecureConnected() && !device->IsSessionSetupInProgress())) + { + ChipLogError(Controller, "Invalid device for commissioning" ChipLogFormatX64, ChipLogValueX64(remoteDeviceId)); + return CHIP_ERROR_INCORRECT_STATE; + } + if (mCommissioningStage != CommissioningStage::kSecurePairing) + { + ChipLogError(Controller, "Commissioning already in progress - not restarting"); + return CHIP_ERROR_INCORRECT_STATE; + } + // If the CSRNonce is passed in, using that else using a random one.. + if (params.HasCSRNonce()) + { + ReturnErrorOnFailure(device->SetCSRNonce(params.GetCSRNonce().Value())); + } + else + { + uint8_t mCSRNonce[kOpCSRNonceLength]; + Crypto::DRBG_get_bytes(mCSRNonce, sizeof(mCSRNonce)); + ReturnErrorOnFailure(device->SetCSRNonce(ByteSpan(mCSRNonce))); + } + + // If the AttestationNonce is passed in, using that else using a random one.. + if (params.HasAttestationNonce()) + { + ReturnErrorOnFailure(device->SetAttestationNonce(params.GetAttestationNonce().Value())); + } + else + { + uint8_t mAttestationNonce[kAttestationNonceLength]; + Crypto::DRBG_get_bytes(mAttestationNonce, sizeof(mAttestationNonce)); + ReturnErrorOnFailure(device->SetAttestationNonce(ByteSpan(mAttestationNonce))); + } + + mSystemState->SystemLayer()->StartTimer(chip::System::Clock::Milliseconds32(kSessionEstablishmentTimeout), + OnSessionEstablishmentTimeoutCallback, this); + if (device->IsSecureConnected()) + { + AdvanceCommissioningStage(CHIP_NO_ERROR); + } + else + { + mRunCommissioningAfterConnection = true; + } + return CHIP_NO_ERROR; +} + CHIP_ERROR DeviceCommissioner::StopPairing(NodeId remoteDeviceId) { VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); @@ -981,21 +1022,29 @@ void DeviceCommissioner::OnSessionEstablished() // TODO: Add code to receive OpCSR from the device, and process the signing request // For IP rendezvous, this is sent as part of the state machine. - bool usingLegacyFlowWithImmediateStart = !mIsIPRendezvous; - - if (usingLegacyFlowWithImmediateStart) + if (mRunCommissioningAfterConnection) { - err = SendCertificateChainRequestCommand(mDeviceBeingCommissioned, CertificateType::kPAI); - if (err != CHIP_NO_ERROR) + mRunCommissioningAfterConnection = false; + bool usingLegacyFlowWithImmediateStart = !mIsIPRendezvous; + if (usingLegacyFlowWithImmediateStart) { - ChipLogError(Ble, "Failed in sending 'Certificate Chain request' command to the device: err %s", ErrorStr(err)); - OnSessionEstablishmentError(err); - return; + err = SendCertificateChainRequestCommand(mDeviceBeingCommissioned, CertificateType::kPAI); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Ble, "Failed in sending 'Certificate Chain request' command to the device: err %s", ErrorStr(err)); + OnSessionEstablishmentError(err); + return; + } + } + else + { + AdvanceCommissioningStage(CHIP_NO_ERROR); } } else { - AdvanceCommissioningStage(CHIP_NO_ERROR); + ChipLogProgress(Controller, "OnPairingComplete"); + mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); } } diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 32606dc11a4dcd..998bfd9b5ffa75 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -490,9 +491,46 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, * in the Init() call. * * @param[in] remoteDeviceId The remote device Id. - * @param[in] params The Rendezvous connection parameters + * @param[in] rendezvousParams The Rendezvous connection parameters + * @param[in] commssioningParams The commissioning parameters (uses defualt if not supplied) */ - CHIP_ERROR PairDevice(NodeId remoteDeviceId, RendezvousParameters & params); + CHIP_ERROR PairDevice(NodeId remoteDeviceId, RendezvousParameters & rendezvousParams); + CHIP_ERROR PairDevice(NodeId remoteDeviceId, RendezvousParameters & rendezvousParams, + CommissioningParameters & commissioningParams); + + /** + * @brief + * Start establishing a PASE connection with a node for the purposes of commissioning. + * Commissioners that wish to use the auto-commissioning functions should use the + * supplied "PairDevice" functions above to automatically establish a connection then + * perform commissioning. This function is intended to be use by commissioners that + * are not using the supplied auto-commissioner. + * + * This function is non-blocking. PASE is established once the DevicePairingDelegate + * receives the OnPairingComplete call. + * + * PASE connections can only be established with nodes that have their commissioning + * window open. The PASE connection will fail if this window is not open and the + * OnPairingComplete will be called with an error. + * + * @param[in] remoteDeviceId The remote device Id. + * @param[in] rendezvousParams The Rendezvous connection parameters + */ + CHIP_ERROR EstablishPASEConnection(NodeId remoteDeviceId, RendezvousParameters & params); + + /** + * @brief + * Start the auto-commissioning process on a node after establishing a PASE connection. + * This function is intended to be used in conjunction with the EstablishPASEConnection + * function. It can be called either before or after the DevicePairingDelegate receives + * the OnPairingComplete call. Commissioners that want to perform simple auto-commissioning + * should use the supplied "PairDevice" functions above, which will establish the PASE + * connection and commission automatically. + * + * @param[in] remoteDeviceId The remote device Id. + * @param[in] params The commissioning parameters + */ + CHIP_ERROR Commission(NodeId remoteDeviceId, CommissioningParameters & params); CHIP_ERROR GetDeviceBeingCommissioned(NodeId deviceId, CommissioneeDeviceProxy ** device); @@ -628,6 +666,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, bool mPairedDevicesUpdated; CommissioningStage mCommissioningStage = CommissioningStage::kSecurePairing; + bool mRunCommissioningAfterConnection = false; BitMapObjectPool mCommissioneeDevicePool; diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 2c5a8d7af593c4..5364aceebd9698 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -185,18 +185,19 @@ JNI_METHOD(void, pairDevice) ChipLogProgress(Controller, "pairDevice() called with device ID, connection object, and pincode"); - RendezvousParameters params = RendezvousParameters() - .SetSetupPINCode(pinCode) + RendezvousParameters rendezvousParams = RendezvousParameters() + .SetSetupPINCode(pinCode) #if CONFIG_NETWORK_LAYER_BLE - .SetConnectionObject(reinterpret_cast(connObj)) + .SetConnectionObject(reinterpret_cast(connObj)) #endif - .SetPeerAddress(Transport::PeerAddress::BLE()); + .SetPeerAddress(Transport::PeerAddress::BLE()); + CommissioningParameters commissioningParams = CommissioningParameters(); if (csrNonce != nullptr) { JniByteArray jniCsrNonce(env, csrNonce); - params.SetCSRNonce(jniCsrNonce.byteSpan()); + commissioningParams.SetCSRNonce(jniCsrNonce.byteSpan()); } - err = wrapper->Controller()->PairDevice(deviceId, params); + err = wrapper->Controller()->PairDevice(deviceId, rendezvousParams, commissioningParams); if (err != CHIP_NO_ERROR) { @@ -221,16 +222,17 @@ JNI_METHOD(void, pairDeviceWithAddress) ChipLogError(Controller, "Failed to parse IP address."), JniReferences::GetInstance().ThrowError(env, sChipDeviceControllerExceptionCls, CHIP_ERROR_INVALID_ARGUMENT)); - RendezvousParameters params = RendezvousParameters() - .SetDiscriminator(discriminator) - .SetSetupPINCode(pinCode) - .SetPeerAddress(Transport::PeerAddress::UDP(addr, port)); + RendezvousParameters rendezvousParams = RendezvousParameters() + .SetDiscriminator(discriminator) + .SetSetupPINCode(pinCode) + .SetPeerAddress(Transport::PeerAddress::UDP(addr, port)); + CommissioningParameters commissioningParams = CommissioningParameters(); if (csrNonce != nullptr) { JniByteArray jniCsrNonce(env, csrNonce); - params.SetCSRNonce(jniCsrNonce.byteSpan()); + commissioningParams.SetCSRNonce(jniCsrNonce.byteSpan()); } - err = wrapper->Controller()->PairDevice(deviceId, params); + err = wrapper->Controller()->PairDevice(deviceId, rendezvousParams, commissioningParams); if (err != CHIP_NO_ERROR) { diff --git a/src/controller/python/ChipDeviceController-ScriptBinding.cpp b/src/controller/python/ChipDeviceController-ScriptBinding.cpp index 789e5855d92289..c16ea817b4c092 100644 --- a/src/controller/python/ChipDeviceController-ScriptBinding.cpp +++ b/src/controller/python/ChipDeviceController-ScriptBinding.cpp @@ -112,6 +112,10 @@ ChipError::StorageType pychip_DeviceController_ConnectBLE(chip::Controller::Devi ChipError::StorageType pychip_DeviceController_ConnectIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_CloseSession(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid); +ChipError::StorageType pychip_DeviceController_EstablishPASESessionIP(chip::Controller::DeviceCommissioner * devCtrl, + const char * peerAddrStr, uint32_t setupPINCode, + chip::NodeId nodeid); +ChipError::StorageType pychip_DeviceController_Commission(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_DiscoverCommissionableNodesLongDiscriminator(chip::Controller::DeviceCommissioner * devCtrl, @@ -346,6 +350,23 @@ ChipError::StorageType pychip_DeviceController_CloseSession(chip::Controller::De { return pychip_GetConnectedDeviceByNodeId(devCtrl, nodeid, CloseSessionCallback); } +ChipError::StorageType pychip_DeviceController_EstablishPASESessionIP(chip::Controller::DeviceCommissioner * devCtrl, + const char * peerAddrStr, uint32_t setupPINCode, + chip::NodeId nodeid) +{ + chip::Inet::IPAddress peerAddr; + chip::Transport::PeerAddress addr; + RendezvousParameters params = chip::RendezvousParameters().SetSetupPINCode(setupPINCode); + VerifyOrReturnError(chip::Inet::IPAddress::FromString(peerAddrStr, peerAddr), CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + addr.SetTransportType(chip::Transport::Type::kUdp).SetIPAddress(peerAddr); + params.SetPeerAddress(addr).SetDiscriminator(0); + return devCtrl->EstablishPASEConnection(nodeid, params).AsInteger(); +} +ChipError::StorageType pychip_DeviceController_Commission(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid) +{ + CommissioningParameters params; + return devCtrl->Commission(nodeid, params).AsInteger(); +} ChipError::StorageType pychip_DeviceController_DiscoverAllCommissionableNodes(chip::Controller::DeviceCommissioner * devCtrl) { diff --git a/src/controller/python/chip-device-ctrl.py b/src/controller/python/chip-device-ctrl.py index 03b31548d1c2e0..54bfef54b96b42 100755 --- a/src/controller/python/chip-device-ctrl.py +++ b/src/controller/python/chip-device-ctrl.py @@ -200,6 +200,8 @@ def __init__(self, rendezvousAddr=None, controllerNodeId=0, bluetoothAdapter=Non "close-ble", "close-session", "resolve", + "paseonly", + "commission", "zcl", "zclread", "zclsubscribe", @@ -491,6 +493,58 @@ def ConnectFromSetupPayload(self, setupPayload, nodeid): print(f"Unable to connect: {ex}") return -1 + def do_paseonly(self, line): + """ + paseonly -ip [] + + TODO: Add more methods to connect to device (like cert for auth, and IP + for connection) + """ + + try: + args = shlex.split(line) + if len(args) <= 1: + print("Usage:") + self.do_help("paseonly") + return + + nodeid = random.randint(1, 1000000) # Just a random number + if len(args) == 4: + nodeid = int(args[3]) + print("Device is assigned with nodeid = {}".format(nodeid)) + + if args[0] == "-ip" and len(args) >= 3: + self.devCtrl.EstablishPASESessionIP(args[1].encode( + "utf-8"), int(args[2]), nodeid) + else: + print("Usage:") + self.do_help("paseonly") + return + print( + "Device temporary node id (**this does not match spec**): {}".format(nodeid)) + except Exception as ex: + print(str(ex)) + return + + def do_commission(self, line): + """ + commission nodeid + + Runs commissioning on a device that has been connected with paseonly + """ + try: + args = shlex.split(line) + if len(args) != 1: + print("Usage:") + self.do_help("commission") + return + + nodeid = int(args[0]) + self.devCtrl.Commission(nodeid) + except Exception as ex: + print(str(ex)) + return + def do_connect(self, line): """ connect -ip [] diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index a993c2e2d4760e..b0fed9d9a99f04 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -199,6 +199,26 @@ def CloseSession(self, nodeid): self.devCtrl, nodeid) ) + def EstablishPASESessionIP(self, ipaddr, setupPinCode, nodeid): + self.state = DCState.RENDEZVOUS_ONGOING + return self._ChipStack.CallAsync( + lambda: self._dmLib.pychip_DeviceController_EstablishPASESessionIP( + self.devCtrl, ipaddr, setupPinCode, nodeid) + ) + + def Commission(self, nodeid): + self._ChipStack.CallAsync( + lambda: self._dmLib.pychip_DeviceController_Commission( + self.devCtrl, nodeid) + ) + # Wait up to 5 additional seconds for the commissioning complete event + if not self._ChipStack.commissioningCompleteEvent.isSet(): + self._ChipStack.commissioningCompleteEvent.wait(5.0) + if not self._ChipStack.commissioningCompleteEvent.isSet(): + # Error 50 is a timeout + return False + return self._ChipStack.commissioningEventRes == 0 + def ConnectIP(self, ipaddr, setupPinCode, nodeid): # IP connection will run through full commissioning, so we need to wait # for the commissioning complete event, not just any callback. @@ -653,6 +673,11 @@ def _InitLib(self): self._dmLib.pychip_DeviceController_ConnectIP.argtypes = [ c_void_p, c_char_p, c_uint32, c_uint64] + + self._dmLib.pychip_DeviceController_Commission.argtypes = [ + c_void_p, c_uint64] + self._dmLib.pychip_DeviceController_Commission.restype = c_uint32 + self._dmLib.pychip_DeviceController_DiscoverAllCommissionableNodes.argtypes = [ c_void_p] self._dmLib.pychip_DeviceController_DiscoverAllCommissionableNodes.restype = c_uint32 @@ -677,6 +702,12 @@ def _InitLib(self): c_void_p] self._dmLib.pychip_DeviceController_DiscoverCommissionableNodesCommissioningEnabled.restype = c_uint32 + self._dmLib.pychip_DeviceController_EstablishPASESessionIP.argtypes = [ + c_void_p, c_char_p, c_uint32, c_uint64] + self._dmLib.pychip_DeviceController_EstablishPASESessionIP.restype = c_uint32 + + self._dmLib.pychip_DeviceController_DiscoverAllCommissionableNodes.argtypes = [ + c_void_p] self._dmLib.pychip_DeviceController_PrintDiscoveredDevices.argtypes = [ c_void_p] diff --git a/src/protocols/secure_channel/RendezvousParameters.h b/src/protocols/secure_channel/RendezvousParameters.h index 295daff2644ff5..043ad223626059 100644 --- a/src/protocols/secure_channel/RendezvousParameters.h +++ b/src/protocols/secure_channel/RendezvousParameters.h @@ -48,28 +48,12 @@ class RendezvousParameters bool HasPeerAddress() const { return mPeerAddress.IsInitialized(); } Transport::PeerAddress GetPeerAddress() const { return mPeerAddress; } - const Optional GetCSRNonce() const { return mCSRNonce; } - const Optional GetAttestationNonce() const { return mAttestationNonce; } RendezvousParameters & SetPeerAddress(const Transport::PeerAddress & peerAddress) { mPeerAddress = peerAddress; return *this; } - // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of RendezvousParameter object. - RendezvousParameters & SetCSRNonce(ByteSpan csrNonce) - { - mCSRNonce.SetValue(csrNonce); - return *this; - } - - // The lifetime of the buffer attestationNonce is pointing to, should exceed the lifetime of RendezvousParameter object. - RendezvousParameters & SetAttestationNonce(ByteSpan attestationNonce) - { - mAttestationNonce.SetValue(attestationNonce); - return *this; - } - bool HasDiscriminator() const { return mDiscriminator <= kMaxRendezvousDiscriminatorValue; } uint16_t GetDiscriminator() const { return mDiscriminator; } RendezvousParameters & SetDiscriminator(uint16_t discriminator) @@ -79,8 +63,6 @@ class RendezvousParameters } bool HasPASEVerifier() const { return mHasPASEVerifier; } - bool HasCSRNonce() const { return mCSRNonce.HasValue(); } - bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } const PASEVerifier & GetPASEVerifier() const { return mPASEVerifier; } RendezvousParameters & SetPASEVerifier(PASEVerifier & verifier) { @@ -113,8 +95,6 @@ class RendezvousParameters Transport::PeerAddress mPeerAddress; ///< the peer node address uint32_t mSetupPINCode = 0; ///< the target peripheral setup PIN Code uint16_t mDiscriminator = UINT16_MAX; ///< the target peripheral discriminator - Optional mCSRNonce; ///< CSR Nonce passed by the commissioner - Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner PASEVerifier mPASEVerifier; bool mHasPASEVerifier = false; @@ -125,4 +105,31 @@ class RendezvousParameters #endif // CONFIG_NETWORK_LAYER_BLE }; +class CommissioningParameters +{ +public: + bool HasCSRNonce() const { return mCSRNonce.HasValue(); } + bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } + const Optional GetCSRNonce() const { return mCSRNonce; } + const Optional GetAttestationNonce() const { return mAttestationNonce; } + + // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object. + CommissioningParameters & SetCSRNonce(ByteSpan csrNonce) + { + mCSRNonce.SetValue(csrNonce); + return *this; + } + + // The lifetime of the buffer attestationNonce is pointing to, should exceed the lifetime of CommissioningParameters object. + CommissioningParameters & SetAttestationNonce(ByteSpan attestationNonce) + { + mAttestationNonce.SetValue(attestationNonce); + return *this; + } + +private: + Optional mCSRNonce; ///< CSR Nonce passed by the commissioner + Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner +}; + } // namespace chip From 70f23b6fcf3bc67a37593984552be5d7d857cb7d Mon Sep 17 00:00:00 2001 From: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 3 Dec 2021 11:52:33 -0500 Subject: [PATCH 05/11] Add VScode tasks to build and flash efr32 apps with selected boards. (#12478) * Add task to build and flash efr32 examples for selected boards. Update efr32.py and targets.py to support board selection * restyle * add Global blacklist for all boards except BRD4161A * Restyled by autopep8 * address PR comments * Update testdata txt files to validate news boards in all targets dry-run * fix build_all_except_host Co-authored-by: Restyled.io --- .vscode/tasks.json | 46 ++++ scripts/build/build/targets.py | 40 ++- scripts/build/builders/efr32.py | 23 ++ .../testdata/all_targets_except_host.txt | 42 +++ .../build/testdata/build_all_except_host.txt | 252 ++++++++++++++++++ 5 files changed, 392 insertions(+), 11 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fda87757b21a9c..a0f49412f87aed 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -170,6 +170,17 @@ "${workspaceFolder}/src/test_driver/mbed/unit_tests/build" ] } + }, + { + "label": "Flash EFR32 board", + "type": "shell", + "command": "python3", + "args": [ + "${workspaceFolder}/out/${input:exampleTarget}/chip-efr32-*.flash.py" + ], + "problemMatcher": { + "base": "$gcc" + } } ], "inputs": [ @@ -229,10 +240,45 @@ "android-x64-chip-tool", "android-x86-chip-tool", "efr32-brd4161a-light", + "efr32-brd4163a-light", + "efr32-brd4164a-light", + "efr32-brd4166a-light", + "efr32-brd4170a-light", + "efr32-brd4186a-light", + "efr32-brd4187a-light", + "efr32-brd4304a-light", "efr32-brd4161a-light-rpc", + "efr32-brd4163a-light-rpc", + "efr32-brd4164a-light-rpc", + "efr32-brd4166a-light-rpc", + "efr32-brd4170a-light-rpc", + "efr32-brd4186a-light-rpc", + "efr32-brd4187a-light-rpc", + "efr32-brd4304a-light-rpc", "efr32-brd4161a-lock", + "efr32-brd4163a-lock", + "efr32-brd4164a-lock", + "efr32-brd4166a-lock", + "efr32-brd4170a-lock", + "efr32-brd4186a-lock", + "efr32-brd4187a-lock", + "efr32-brd4304a-lock", "efr32-brd4161a-unit-test", + "efr32-brd4163a-unit-test", + "efr32-brd4164a-unit-test", + "efr32-brd4166a-unit-test", + "efr32-brd4170a-unit-test", + "efr32-brd4186a-unit-test", + "efr32-brd4187a-unit-test", + "efr32-brd4304a-unit-test", "efr32-brd4161a-window-covering", + "efr32-brd4163a-window-covering", + "efr32-brd4164a-window-covering", + "efr32-brd4166a-window-covering", + "efr32-brd4170a-window-covering", + "efr32-brd4186a-window-covering", + "efr32-brd4187a-window-covering", + "efr32-brd4304a-window-covering", "esp32-c3devkit-all-clusters", "esp32-devkitc-all-clusters", "esp32-devkitc-all-clusters-ipv6only", diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index b6f90a30e8cc60..ccc8da7a91ef89 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -214,20 +214,38 @@ def Esp32Targets(): def Efr32Targets(): - efr_target = Target('efr32-brd4161a', Efr32Builder, - board=Efr32Board.BRD4161A) + efr_target = Target('efr32', Efr32Builder) + + board_targets = [ + efr_target.Extend('brd4161a', board=Efr32Board.BRD4161A), + efr_target.Extend('brd4163a', board=Efr32Board.BRD4163A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4164a', board=Efr32Board.BRD4164A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4166a', board=Efr32Board.BRD4166A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4170a', board=Efr32Board.BRD4170A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4186a', board=Efr32Board.BRD4186A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4187a', board=Efr32Board.BRD4187A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4304a', board=Efr32Board.BRD4304A).GlobBlacklist( + 'only user requested') + ] - yield efr_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING) - yield efr_target.Extend('unit-test', app=Efr32App.UNIT_TEST) + for board_target in board_targets: + yield board_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING) + yield board_target.Extend('unit-test', app=Efr32App.UNIT_TEST) - rpc_aware_targets = [ - efr_target.Extend('light', app=Efr32App.LIGHT), - efr_target.Extend('lock', app=Efr32App.LOCK) - ] + rpc_aware_targets = [ + board_target.Extend('light', app=Efr32App.LIGHT), + board_target.Extend('lock', app=Efr32App.LOCK) + ] - for target in rpc_aware_targets: - yield target - yield target.Extend('rpc', enable_rpcs=True) + for target in rpc_aware_targets: + yield target + yield target.Extend('rpc', enable_rpcs=True) def NrfTargets(): diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 4f90419291bb6c..437138f4d6b3de 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -67,10 +67,33 @@ def BuildRoot(self, root): class Efr32Board(Enum): BRD4161A = 1 + BRD4163A = 2 + BRD4164A = 3 + BRD4166A = 4 + BRD4170A = 5 + BRD4186A = 6 + BRD4187A = 7 + BRD4304A = 8 def GnArgName(self): if self == Efr32Board.BRD4161A: return 'BRD4161A' + elif self == Efr32Board.BRD4163A: + return 'BRD4163A' + elif self == Efr32Board.BRD4164A: + return 'BRD4164A' + elif self == Efr32Board.BRD4166A: + return 'BRD4166A' + elif self == Efr32Board.BRD4170A: + return 'BRD4170A' + elif self == Efr32Board.BRD4186A: + return 'BRD4186A' + elif self == Efr32Board.BRD4187A: + return 'BRD4187A' + elif self == Efr32Board.BRD4304A: + return 'BRD4304A' + else: + raise Exception('Unknown board #: %r' % self) class Efr32Builder(GnBuilder): diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 29b96163e85a39..b3f1f751625cb9 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -15,6 +15,48 @@ efr32-brd4161a-lock efr32-brd4161a-lock-rpc efr32-brd4161a-unit-test efr32-brd4161a-window-covering +efr32-brd4163a-light (NOGLOB: only user requested) +efr32-brd4163a-light-rpc (NOGLOB: only user requested) +efr32-brd4163a-lock (NOGLOB: only user requested) +efr32-brd4163a-lock-rpc (NOGLOB: only user requested) +efr32-brd4163a-unit-test (NOGLOB: only user requested) +efr32-brd4163a-window-covering (NOGLOB: only user requested) +efr32-brd4164a-light (NOGLOB: only user requested) +efr32-brd4164a-light-rpc (NOGLOB: only user requested) +efr32-brd4164a-lock (NOGLOB: only user requested) +efr32-brd4164a-lock-rpc (NOGLOB: only user requested) +efr32-brd4164a-unit-test (NOGLOB: only user requested) +efr32-brd4164a-window-covering (NOGLOB: only user requested) +efr32-brd4166a-light (NOGLOB: only user requested) +efr32-brd4166a-light-rpc (NOGLOB: only user requested) +efr32-brd4166a-lock (NOGLOB: only user requested) +efr32-brd4166a-lock-rpc (NOGLOB: only user requested) +efr32-brd4166a-unit-test (NOGLOB: only user requested) +efr32-brd4166a-window-covering (NOGLOB: only user requested) +efr32-brd4170a-light (NOGLOB: only user requested) +efr32-brd4170a-light-rpc (NOGLOB: only user requested) +efr32-brd4170a-lock (NOGLOB: only user requested) +efr32-brd4170a-lock-rpc (NOGLOB: only user requested) +efr32-brd4170a-unit-test (NOGLOB: only user requested) +efr32-brd4170a-window-covering (NOGLOB: only user requested) +efr32-brd4186a-light (NOGLOB: only user requested) +efr32-brd4186a-light-rpc (NOGLOB: only user requested) +efr32-brd4186a-lock (NOGLOB: only user requested) +efr32-brd4186a-lock-rpc (NOGLOB: only user requested) +efr32-brd4186a-unit-test (NOGLOB: only user requested) +efr32-brd4186a-window-covering (NOGLOB: only user requested) +efr32-brd4187a-light (NOGLOB: only user requested) +efr32-brd4187a-light-rpc (NOGLOB: only user requested) +efr32-brd4187a-lock (NOGLOB: only user requested) +efr32-brd4187a-lock-rpc (NOGLOB: only user requested) +efr32-brd4187a-unit-test (NOGLOB: only user requested) +efr32-brd4187a-window-covering (NOGLOB: only user requested) +efr32-brd4304a-light (NOGLOB: only user requested) +efr32-brd4304a-light-rpc (NOGLOB: only user requested) +efr32-brd4304a-lock (NOGLOB: only user requested) +efr32-brd4304a-lock-rpc (NOGLOB: only user requested) +efr32-brd4304a-unit-test (NOGLOB: only user requested) +efr32-brd4304a-window-covering (NOGLOB: only user requested) esp32-c3devkit-all-clusters esp32-devkitc-all-clusters esp32-devkitc-all-clusters-ipv6only diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 3c99220615f5c6..d075af52751845 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -142,6 +142,132 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src # Generating efr32-brd4161a-window-covering gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4161A"' {out}/efr32-brd4161a-window-covering +# Generating efr32-brd4163a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-light + +# Generating efr32-brd4163a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4163A" import("//with_pw_rpc.gni")' {out}/efr32-brd4163a-light-rpc + +# Generating efr32-brd4163a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-lock + +# Generating efr32-brd4163a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4163A" import("//with_pw_rpc.gni")' {out}/efr32-brd4163a-lock-rpc + +# Generating efr32-brd4163a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-unit-test + +# Generating efr32-brd4163a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4163A"' {out}/efr32-brd4163a-window-covering + +# Generating efr32-brd4164a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-light + +# Generating efr32-brd4164a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4164A" import("//with_pw_rpc.gni")' {out}/efr32-brd4164a-light-rpc + +# Generating efr32-brd4164a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-lock + +# Generating efr32-brd4164a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4164A" import("//with_pw_rpc.gni")' {out}/efr32-brd4164a-lock-rpc + +# Generating efr32-brd4164a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-unit-test + +# Generating efr32-brd4164a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4164A"' {out}/efr32-brd4164a-window-covering + +# Generating efr32-brd4166a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-light + +# Generating efr32-brd4166a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4166A" import("//with_pw_rpc.gni")' {out}/efr32-brd4166a-light-rpc + +# Generating efr32-brd4166a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-lock + +# Generating efr32-brd4166a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4166A" import("//with_pw_rpc.gni")' {out}/efr32-brd4166a-lock-rpc + +# Generating efr32-brd4166a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-unit-test + +# Generating efr32-brd4166a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4166A"' {out}/efr32-brd4166a-window-covering + +# Generating efr32-brd4170a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-light + +# Generating efr32-brd4170a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4170A" import("//with_pw_rpc.gni")' {out}/efr32-brd4170a-light-rpc + +# Generating efr32-brd4170a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-lock + +# Generating efr32-brd4170a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4170A" import("//with_pw_rpc.gni")' {out}/efr32-brd4170a-lock-rpc + +# Generating efr32-brd4170a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-unit-test + +# Generating efr32-brd4170a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4170A"' {out}/efr32-brd4170a-window-covering + +# Generating efr32-brd4186a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-light + +# Generating efr32-brd4186a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4186A" import("//with_pw_rpc.gni")' {out}/efr32-brd4186a-light-rpc + +# Generating efr32-brd4186a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-lock + +# Generating efr32-brd4186a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4186A" import("//with_pw_rpc.gni")' {out}/efr32-brd4186a-lock-rpc + +# Generating efr32-brd4186a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-unit-test + +# Generating efr32-brd4186a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4186A"' {out}/efr32-brd4186a-window-covering + +# Generating efr32-brd4187a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-light + +# Generating efr32-brd4187a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4187A" import("//with_pw_rpc.gni")' {out}/efr32-brd4187a-light-rpc + +# Generating efr32-brd4187a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-lock + +# Generating efr32-brd4187a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4187A" import("//with_pw_rpc.gni")' {out}/efr32-brd4187a-lock-rpc + +# Generating efr32-brd4187a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-unit-test + +# Generating efr32-brd4187a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4187A"' {out}/efr32-brd4187a-window-covering + +# Generating efr32-brd4304a-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-light + +# Generating efr32-brd4304a-light-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/efr32 '--args=efr32_board="BRD4304A" import("//with_pw_rpc.gni")' {out}/efr32-brd4304a-light-rpc + +# Generating efr32-brd4304a-lock +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-lock + +# Generating efr32-brd4304a-lock-rpc +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/efr32 '--args=efr32_board="BRD4304A" import("//with_pw_rpc.gni")' {out}/efr32-brd4304a-lock-rpc + +# Generating efr32-brd4304a-unit-test +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src/test_driver/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-unit-test + +# Generating efr32-brd4304a-window-covering +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-window-covering + # Generating esp32-c3devkit-all-clusters mkdir -p {out}/esp32-c3devkit-all-clusters @@ -602,6 +728,132 @@ ninja -C {out}/efr32-brd4161a-unit-test # Building efr32-brd4161a-window-covering ninja -C {out}/efr32-brd4161a-window-covering +# Building efr32-brd4163a-light +ninja -C {out}/efr32-brd4163a-light + +# Building efr32-brd4163a-light-rpc +ninja -C {out}/efr32-brd4163a-light-rpc + +# Building efr32-brd4163a-lock +ninja -C {out}/efr32-brd4163a-lock + +# Building efr32-brd4163a-lock-rpc +ninja -C {out}/efr32-brd4163a-lock-rpc + +# Building efr32-brd4163a-unit-test +ninja -C {out}/efr32-brd4163a-unit-test + +# Building efr32-brd4163a-window-covering +ninja -C {out}/efr32-brd4163a-window-covering + +# Building efr32-brd4164a-light +ninja -C {out}/efr32-brd4164a-light + +# Building efr32-brd4164a-light-rpc +ninja -C {out}/efr32-brd4164a-light-rpc + +# Building efr32-brd4164a-lock +ninja -C {out}/efr32-brd4164a-lock + +# Building efr32-brd4164a-lock-rpc +ninja -C {out}/efr32-brd4164a-lock-rpc + +# Building efr32-brd4164a-unit-test +ninja -C {out}/efr32-brd4164a-unit-test + +# Building efr32-brd4164a-window-covering +ninja -C {out}/efr32-brd4164a-window-covering + +# Building efr32-brd4166a-light +ninja -C {out}/efr32-brd4166a-light + +# Building efr32-brd4166a-light-rpc +ninja -C {out}/efr32-brd4166a-light-rpc + +# Building efr32-brd4166a-lock +ninja -C {out}/efr32-brd4166a-lock + +# Building efr32-brd4166a-lock-rpc +ninja -C {out}/efr32-brd4166a-lock-rpc + +# Building efr32-brd4166a-unit-test +ninja -C {out}/efr32-brd4166a-unit-test + +# Building efr32-brd4166a-window-covering +ninja -C {out}/efr32-brd4166a-window-covering + +# Building efr32-brd4170a-light +ninja -C {out}/efr32-brd4170a-light + +# Building efr32-brd4170a-light-rpc +ninja -C {out}/efr32-brd4170a-light-rpc + +# Building efr32-brd4170a-lock +ninja -C {out}/efr32-brd4170a-lock + +# Building efr32-brd4170a-lock-rpc +ninja -C {out}/efr32-brd4170a-lock-rpc + +# Building efr32-brd4170a-unit-test +ninja -C {out}/efr32-brd4170a-unit-test + +# Building efr32-brd4170a-window-covering +ninja -C {out}/efr32-brd4170a-window-covering + +# Building efr32-brd4186a-light +ninja -C {out}/efr32-brd4186a-light + +# Building efr32-brd4186a-light-rpc +ninja -C {out}/efr32-brd4186a-light-rpc + +# Building efr32-brd4186a-lock +ninja -C {out}/efr32-brd4186a-lock + +# Building efr32-brd4186a-lock-rpc +ninja -C {out}/efr32-brd4186a-lock-rpc + +# Building efr32-brd4186a-unit-test +ninja -C {out}/efr32-brd4186a-unit-test + +# Building efr32-brd4186a-window-covering +ninja -C {out}/efr32-brd4186a-window-covering + +# Building efr32-brd4187a-light +ninja -C {out}/efr32-brd4187a-light + +# Building efr32-brd4187a-light-rpc +ninja -C {out}/efr32-brd4187a-light-rpc + +# Building efr32-brd4187a-lock +ninja -C {out}/efr32-brd4187a-lock + +# Building efr32-brd4187a-lock-rpc +ninja -C {out}/efr32-brd4187a-lock-rpc + +# Building efr32-brd4187a-unit-test +ninja -C {out}/efr32-brd4187a-unit-test + +# Building efr32-brd4187a-window-covering +ninja -C {out}/efr32-brd4187a-window-covering + +# Building efr32-brd4304a-light +ninja -C {out}/efr32-brd4304a-light + +# Building efr32-brd4304a-light-rpc +ninja -C {out}/efr32-brd4304a-light-rpc + +# Building efr32-brd4304a-lock +ninja -C {out}/efr32-brd4304a-lock + +# Building efr32-brd4304a-lock-rpc +ninja -C {out}/efr32-brd4304a-lock-rpc + +# Building efr32-brd4304a-unit-test +ninja -C {out}/efr32-brd4304a-unit-test + +# Building efr32-brd4304a-window-covering +ninja -C {out}/efr32-brd4304a-window-covering + rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-c3devkit-all-clusters From 59ca4148ad864ce20b7b1841f571b5461508d87b Mon Sep 17 00:00:00 2001 From: Yuanyao Zhong <82843247+yyzhong-g@users.noreply.github.com> Date: Fri, 3 Dec 2021 12:02:05 -0500 Subject: [PATCH 06/11] Add tracing service to example/platform/esp rpc (#12386) * Add tracing service to example/platform/esp rpc * Restyled by clang-format Co-authored-by: Restyled.io --- .../esp32/main/CMakeLists.txt | 3 ++- examples/platform/esp32/Rpc.cpp | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 29430a67c079a6..804eb4c365185b 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -225,6 +225,7 @@ target_compile_options(${COMPONENT_LIB} PRIVATE "-DPW_RPC_BUTTON_SERVICE=1" "-DPW_RPC_DEVICE_SERVICE=1" "-DPW_RPC_LIGHTING_SERVICE=1" - "-DPW_RPC_LOCKING_SERVICE=1") + "-DPW_RPC_LOCKING_SERVICE=1" + "-DPW_RPC_TRACING_SERVICE=1") endif (CONFIG_ENABLE_PW_RPC) diff --git a/examples/platform/esp32/Rpc.cpp b/examples/platform/esp32/Rpc.cpp index 3cfe0070e815b6..9286191dc4eeca 100644 --- a/examples/platform/esp32/Rpc.cpp +++ b/examples/platform/esp32/Rpc.cpp @@ -52,6 +52,23 @@ #include "pigweed/rpc_services/Locking.h" #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +#include "pw_trace/trace.h" +#include "pw_trace_tokenized/trace_rpc_service_nanopb.h" + +// Define trace time for pw_trace +PW_TRACE_TIME_TYPE pw_trace_GetTraceTime() +{ + return (PW_TRACE_TIME_TYPE) chip::System::SystemClock().GetMonotonicMicroseconds64().count(); +} +// Microsecond time source +size_t pw_trace_GetTraceTimeTicksPerSecond() +{ + return 1000000; +} + +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + namespace chip { namespace rpc { @@ -122,6 +139,10 @@ Lighting lighting_service; Locking locking; #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +pw::trace::TraceService trace_service; +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + void RegisterServices(pw::rpc::Server & server) { #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -143,6 +164,10 @@ void RegisterServices(pw::rpc::Server & server) #if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE server.RegisterService(locking); #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + server.RegisterService(trace_service); +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE } } // namespace From fc07dcf020181348fd15a31f4be348e59c336ba6 Mon Sep 17 00:00:00 2001 From: Martin Turon Date: Fri, 3 Dec 2021 09:54:30 -0800 Subject: [PATCH 07/11] [build] Update banner to say MATTER with logo and proper font. (#12540) --- scripts/bootstrap.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 7570976129905c..a0a8f2e7c615ae 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -38,11 +38,17 @@ _bootstrap_or_activate() { local _CHIP_BANNER="$( cat < Date: Fri, 3 Dec 2021 13:29:59 -0500 Subject: [PATCH 08/11] Fix handling of list-typed attributes in Darwin tests. (#12538) Two issues here: 1) asTestValue did not handle list attributes properly: it assigned @(0) to the NSArray*. 2) This compiled, because we were not enabling -Werror for the build of the test harness. This fixes both issues. No codegen changes, because we don't actually have any non-excluded writable list-typed attributes yet. Which is good, because they would not have passed CI due to crashing when we try to treat an NSNumber* as NSArray*. --- .github/workflows/darwin.yaml | 2 +- src/darwin/Framework/CHIP/templates/helper.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index ead897aa3e924e..3880c6bbe8f8fe 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -114,7 +114,7 @@ jobs: run: | mkdir -p /tmp/darwin/framework-tests ../../../out/debug/chip-all-clusters-app > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & - xcodebuild test -target "CHIP" -scheme "CHIP Framework Tests" -sdk macosx > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2) + xcodebuild test -target "CHIP" -scheme "CHIP Framework Tests" -sdk macosx OTHER_CFLAGS='${inherited} -Werror -Wno-documentation -Wno-conditional-uninitialized -Wno-incomplete-umbrella' > >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2) working-directory: src/darwin/Framework - name: Uploading log files uses: actions/upload-artifact@v2 diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 1383e9f02231d4..1aaa3e0c1ba4b6 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -56,6 +56,8 @@ function asTestValue() return '[@"Test" dataUsingEncoding:NSUTF8StringEncoding]'; } else if (StringHelper.isCharString(this.type)) { return '@"Test"'; + } else if (this.isArray) { + return '[NSArray array]'; } else { return `@(${this.min || this.max || 0})`; } From 3c6a943dba23b99b8198083a9471fcc480408378 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 3 Dec 2021 14:02:25 -0500 Subject: [PATCH 09/11] Increase the test waits for timed interaction tests. (#12558) The tests are failing intermittently because the client starts the wait when it _sends_ the message and the server starts its timer when it _receives_ the message. So if the message takes >5ms to be delivered initially, the test ends up with an unexpectedly successful command. The right fix for this would be for the client to start its delay when it receives the status response, but that requires more hooks into the IM state machine than we have (and probably than we want). For now, just increase the timeout used by the client to make it very unlikely that that much time passes before the timer on the server expires. --- src/app/tests/suites/TestClusterComplexTypes.yaml | 4 ++-- zzz_generated/chip-tool/zap-generated/test/Commands.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/tests/suites/TestClusterComplexTypes.yaml b/src/app/tests/suites/TestClusterComplexTypes.yaml index 1118f8b8f51204..79e334d1c982b2 100644 --- a/src/app/tests/suites/TestClusterComplexTypes.yaml +++ b/src/app/tests/suites/TestClusterComplexTypes.yaml @@ -63,7 +63,7 @@ tests: timedInteractionTimeoutMs: 1 # Try to ensure that we are unresponsive for long enough that the timeout # expires. - busyWaitMs: 5 + busyWaitMs: 100 response: error: UNSUPPORTED_ACCESS @@ -81,6 +81,6 @@ tests: timedInteractionTimeoutMs: 1 # Try to ensure that we are unresponsive for long enough that the timeout # expires. - busyWaitMs: 5 + busyWaitMs: 100 response: error: UNSUPPORTED_ACCESS diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index f47595c3b6210e..573443627cd573 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -42880,10 +42880,10 @@ class TestClusterComplexTypes : public TestCommand chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 1)); { using namespace chip::System::Clock::Literals; - // Busy-wait for 5 milliseconds. + // Busy-wait for 100 milliseconds. auto & clock = chip::System::SystemClock(); auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 5_ms) + while (clock.GetMonotonicTimestamp() - start < 100_ms) ; } return CHIP_NO_ERROR; @@ -42940,10 +42940,10 @@ class TestClusterComplexTypes : public TestCommand chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 1)); { using namespace chip::System::Clock::Literals; - // Busy-wait for 5 milliseconds. + // Busy-wait for 100 milliseconds. auto & clock = chip::System::SystemClock(); auto start = clock.GetMonotonicTimestamp(); - while (clock.GetMonotonicTimestamp() - start < 5_ms) + while (clock.GetMonotonicTimestamp() - start < 100_ms) ; } return CHIP_NO_ERROR; From 4f4268e0f32b1f53b3b37f3cd7958e66fc9d8163 Mon Sep 17 00:00:00 2001 From: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:42:09 +0100 Subject: [PATCH 10/11] Pull request/power source configuration cluster (#12209) * Implemented Power source configuration cluster * Add power source configuration in all-clusters-app and controller-clusters * Autogenerate all * Clean up zap errors trickled down from ToT * Added power source configuration implementation - A read on Sources attribute searches for all power source server clusters and decodes it in the response * Enabled Power source configuration and Power source clusters in lock-app * Regenerate all Regenerate all after rebasing on ToT * Changed Sources attribute to external since lists can not be defined in ZAP right now * Add power source configuration source file for mbed and esp32 compilation + regenerate all * Regenerate after rebase. Not sure why this on off related code always toggles on autogen. * Improved read implementation * Corrected INVALID_PATH logic * Add missing source for Power source configuration cluster * Updated descriptor cluster server tests to include Power source configuration cluster * Regenerate all after rebase on ToT Regenerate after changing descriptor cluster tests * Use endpoint 0 for Power source configuration cluster test * Regenerate after rebase on ToT Rebase and regenerate Rebase and regenerate * Renamed confusing variable name * Rebase and regen --- .../all-clusters-common/all-clusters-app.zap | 296 +- .../esp32/main/CMakeLists.txt | 1 + examples/all-clusters-app/mbed/CMakeLists.txt | 1 + examples/lock-app/esp32/main/CMakeLists.txt | 2 + examples/lock-app/lock-common/lock-app.zap | 333 + examples/lock-app/mbed/CMakeLists.txt | 1 + .../power-source-configuration-server.cpp | 97 + .../tests/suites/TestDescriptorCluster.yaml | 1 + .../power-source-configuration-cluster.xml | 16 +- src/app/zap-templates/zcl/zcl.json | 1 - src/app/zap_cluster_list.py | 4 +- .../data_model/controller-clusters.zap | 312 +- .../java/zap-generated/CHIPCallbackTypes.h | 33 +- .../java/zap-generated/CHIPClusters-JNI.cpp | 816 +- .../zap-generated/CHIPClustersRead-JNI.cpp | 585 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 89 + .../java/zap-generated/CHIPReadCallbacks.h | 24 + .../chip/devicecontroller/ChipClusters.java | 348 +- .../devicecontroller/ClusterInfoMapping.java | 37 + .../devicecontroller/ClusterReadMapping.java | 206 +- .../devicecontroller/ClusterWriteMapping.java | 20 +- .../python/chip/clusters/CHIPClusters.cpp | 11344 ++++++++++++++++ .../python/chip/clusters/CHIPClusters.py | 105 +- .../python/chip/clusters/Objects.py | 16 + src/darwin/Framework/CHIP/templates/helper.js | 1 + .../CHIP/zap-generated/CHIPCallbackBridge.mm | 20 + .../CHIPCallbackBridge_internal.h | 11 + .../CHIP/zap-generated/CHIPClustersObjc.h | 125 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 601 +- .../zap-generated/CHIPClustersObjc_internal.h | 4 + .../CHIP/zap-generated/CHIPTestClustersObjc.h | 26 +- .../zap-generated/CHIPTestClustersObjc.mm | 306 +- .../Framework/CHIPTests/CHIPClustersTests.m | 454 +- .../PluginApplicationCallbacks.h | 1 + .../zap-generated/attribute-size.cpp | 29 + .../zap-generated/callback-stub.cpp | 8 + .../zap-generated/endpoint_config.h | 538 +- .../zap-generated/gen_config.h | 6 + .../app-common/zap-generated/attribute-id.h | 1 + .../zap-generated/attributes/Accessors.cpp | 6 + .../zap-generated/attributes/Accessors.h | 6 + .../zap-generated/cluster-objects.h | 12 + .../app-common/zap-generated/ids/Attributes.h | 4 + .../zap-generated/cluster/Commands.h | 2152 +-- .../zap-generated/reporting/Commands.h | 78 - .../chip-tool/zap-generated/test/Commands.h | 30 +- .../zap-generated/CHIPClientCallbacks.cpp | 21 + .../zap-generated/CHIPClientCallbacks.h | 5 + .../zap-generated/CHIPClusters.cpp | 427 +- .../zap-generated/CHIPClusters.h | 74 +- .../PluginApplicationCallbacks.h | 1 + .../zap-generated/callback-stub.cpp | 8 + .../zap-generated/endpoint_config.h | 104 +- .../zap-generated/gen_config.h | 5 + .../zap-generated/tests/CHIPClustersTest.cpp | 145 +- .../zap-generated/tests/CHIPClustersTest.h | 36 +- .../PluginApplicationCallbacks.h | 2 + .../lock-app/zap-generated/attribute-size.cpp | 29 + .../lock-app/zap-generated/callback-stub.cpp | 16 + .../lock-app/zap-generated/endpoint_config.h | 524 +- .../lock-app/zap-generated/gen_config.h | 12 + 61 files changed, 13825 insertions(+), 6691 deletions(-) create mode 100644 src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp create mode 100644 src/controller/python/chip/clusters/CHIPClusters.cpp diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 65df1f07560b01..840a3846316938 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1417,6 +1417,57 @@ } ] }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "Sources", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "General Commissioning", "code": 48, @@ -9139,251 +9190,8 @@ "define": "BRIDGED_DEVICE_BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ReachableChanged", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ - { - "name": "VendorName", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorID", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductName", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NodeLabel", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersion", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersionString", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "ClusterRevision", "code": 65533, diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 804eb4c365185b..78a2a7b8661456 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -73,6 +73,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" #${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-client ) diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 2357c24ea3017f..c6b1eb1fd336a9 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -137,6 +137,7 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/identify-server/identify-server.cpp ${APP_CLUSTERS}/window-covering-server/window-covering-server.cpp ${APP_CLUSTERS}/general_diagnostics_server/general_diagnostics_server.cpp + ${APP_CLUSTERS}/power-source-configuration-server/power-source-configuration-server.cpp ) target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index ce2c2116ca6e59..a0f804c93478aa 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -53,6 +53,7 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi_network_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software_diagnostics_server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general_diagnostics_server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" PRIV_REQUIRES bt chip QRCode) get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) @@ -142,6 +143,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" PRIV_REQUIRES chip QRCode bt) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 70b95007c712d5..58ed740597e982 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1184,6 +1184,168 @@ } ] }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "Sources", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "USB", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WiredAssessedCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "General Commissioning", "code": 48, @@ -5090,6 +5252,177 @@ } ] }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Power Source", + "code": 47, + "mfgCode": null, + "define": "POWER_SOURCE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "Status", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Order", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Description", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "Battery", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WiredAssessedCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryChargeLevel", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryReplacementNeeded", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryReplaceability", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatteryReplacementDescription", + "code": 19, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Occupancy Sensing", "code": 1030, diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index d6ca61db3ac0d2..1fc39a643cc919 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -89,6 +89,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp + ${CHIP_ROOT}/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp ) target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) diff --git a/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp new file mode 100644 index 00000000000000..9f17ee23590589 --- /dev/null +++ b/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp @@ -0,0 +1,97 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/**************************************************************************** + * @file + * @brief Implementation for the Descriptor Server Cluster + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerSourceConfiguration::Attributes; + +namespace { + +class PowerSourceConfigurationAttrAccess : public AttributeAccessInterface +{ +public: + // Register on all endpoints. + PowerSourceConfigurationAttrAccess() : AttributeAccessInterface(Optional::Missing(), PowerSourceConfiguration::Id) + {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; +}; + +PowerSourceConfigurationAttrAccess gAttrAccess; + +CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (aPath.mClusterId != PowerSourceConfiguration::Id || aPath.mEndpointId != 0x00) + { + return CHIP_ERROR_INVALID_PATH_LIST; + } + + switch (aPath.mAttributeId) + { + case Sources::Id: + err = aEncoder.EncodeList([](const TagBoundEncoder & encoder) -> CHIP_ERROR { + uint16_t clusterCount = 0; + + for (uint16_t endpointIndex = 0; endpointIndex < emberAfEndpointCount(); endpointIndex++) + { + clusterCount = emberAfClusterCount(endpointIndex, true); + + for (uint8_t clusterIndex = 0; clusterIndex < clusterCount; clusterIndex++) + { + EmberAfCluster * cluster = emberAfGetNthCluster(endpointIndex, clusterIndex, true); + + if (cluster->clusterId == PowerSource::Id) + { + ReturnErrorOnFailure(encoder.Encode(endpointIndex)); + break; // There is only 1 server cluster per endpoint + } + } + } + + return CHIP_NO_ERROR; + }); + break; + default: + break; + } + + return err; +} + +} // anonymous namespace + +void MatterPowerSourceConfigurationPluginServerInitCallback(void) +{ + registerAttributeAccessOverride(&gAttrAccess); +} diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index ec787d928d6802..41ee3a11fd0955 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -39,6 +39,7 @@ tests: 0x0028, # Basic Information 0x0029, # OTA Software Update Provider 0x002A, # OTA Software Update Requestor + 0x002E, # Power Source Configuration 0x0030, # General Commissioning 0x0031, # Network Commissioning 0x0032, # Diagnostic Logs diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml index 0660a40963ed99..23d802ac115043 100644 --- a/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml @@ -17,21 +17,15 @@ limitations under the License. - - General Power Source Configuration - 0x002e + CHIP + This cluster is used to describe the configuration and capabilities of a Device's power system. + 0x002E POWER_SOURCE_CONFIGURATION_CLUSTER true true - This cluster is used to describe the configuration and capabilities of a Device’s power system. It is -among the clusters referenced by the Root Node device type, and provides an ordering overview as -well as linking to the one or more endpoints each carrying a Power device type and Power Source -cluster. - - - - + + Sources diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 2f67b24b5124b0..2ffebaae0cebed 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -12,7 +12,6 @@ "boolean-state-cluster.xml", "bridged-actions-cluster.xml", "bridged-device-basic.xml", - "bridged-device-basic-information-cluster.xml", "chip-ota.xml", "chip-types.xml", "clusters-extensions.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index ff0d53a307a099..18a0a70f89f547 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -53,8 +53,8 @@ 'OTA_BOOTLOAD_CLUSTER': [], 'OTA_PROVIDER_CLUSTER': ['ota-provider'], 'OTA_REQUESTOR_CLUSTER': [], - 'POWER_CONFIG_CLUSTER': [], 'POWER_SOURCE_CLUSTER': [], + 'POWER_SOURCE_CONFIGURATION_CLUSTER': ['power-source-configuration-server'], 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-server'], 'RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER': [], @@ -121,8 +121,8 @@ 'OTA_BOOTLOAD_CLUSTER': [], 'OTA_PROVIDER_CLUSTER': [], 'OTA_REQUESTOR_CLUSTER': [], - 'POWER_CONFIG_CLUSTER': [], 'POWER_SOURCE_CLUSTER': [], + 'POWER_SOURCE_CONFIGURATION_CLUSTER': [], 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-client'], 'RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER': [], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index b6b1149c19bb2b..db8ab8eda2853f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -2093,6 +2093,73 @@ } ] }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Power Source Configuration", + "code": 46, + "mfgCode": null, + "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "Sources", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Power Source", "code": 47, @@ -4941,251 +5008,8 @@ "define": "BRIDGED_DEVICE_BASIC_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 0 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 0 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 0 - }, - { - "name": "ReachableChanged", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ - { - "name": "VendorName", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorID", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductName", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "NodeLabel", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersion", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersionString", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "ClusterRevision", "code": 65533, diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 40dbc7f5b9d083..426ebe3e0174e9 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -145,34 +145,6 @@ typedef void (*CHIPBridgedActionsClusterSetupUrlAttributeCallbackType)( typedef void (*CHIPBridgedActionsClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::BridgedActions::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterVendorNameAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::VendorName::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterVendorIDAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::VendorID::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterProductNameAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductName::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterNodeLabelAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterHardwareVersionAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterHardwareVersionStringAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterSoftwareVersionAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterSoftwareVersionStringAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterManufacturingDateAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterPartNumberAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::PartNumber::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterProductURLAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductURL::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterProductLabelAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterSerialNumberAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo::DecodableArgType); -typedef void (*CHIPBridgedDeviceBasicClusterReachableAttributeCallbackType)( - void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::Reachable::TypeInfo::DecodableArgType); typedef void (*CHIPBridgedDeviceBasicClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); @@ -683,6 +655,11 @@ typedef void (*CHIPPowerSourceClusterFeatureMapAttributeCallbackType)( typedef void (*CHIPPowerSourceClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceConfigurationClusterSourcesAttributeCallbackType)( + void *, const chip::app::Clusters::PowerSourceConfiguration::Attributes::Sources::TypeInfo::DecodableType &); +typedef void (*CHIPPowerSourceConfigurationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + typedef void (*CHIPPressureMeasurementClusterMeasuredValueAttributeCallbackType)( void *, chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); typedef void (*CHIPPressureMeasurementClusterMinMeasuredValueAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index ea3e97921619a3..e08dea3c1cc44f 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -4014,813 +4014,6 @@ JNI_METHOD(jlong, BridgedDeviceBasicCluster, initWithDevice)(JNIEnv * env, jobje return reinterpret_cast(cppCluster); } -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeVendorNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportVendorNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeVendorIDAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorID(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeProductNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeProductName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportProductNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, writeNodeLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeNodeLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeNodeLabel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportNodeLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNodeLabel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeHardwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportHardwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeHardwareVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeHardwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeHardwareVersionString( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportHardwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeHardwareVersionString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeSoftwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportSoftwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSoftwareVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeSoftwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSoftwareVersionString( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportSoftwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSoftwareVersionString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeManufacturingDateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeManufacturingDate(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportManufacturingDateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeManufacturingDate(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribePartNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributePartNumber(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportPartNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePartNumber(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeProductURLAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeProductURL(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportProductURLAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductURL(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeProductLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeProductLabel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportProductLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductLabel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeSerialNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSerialNumber(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportSerialNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSerialNumber(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeReachableAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeReachable(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, reportReachableAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeReachable(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { @@ -20147,6 +19340,15 @@ JNI_METHOD(void, PowerSourceCluster, reportClusterRevisionAttribute)(JNIEnv * en onReport.release(); } +JNI_METHOD(jlong, PowerSourceConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + PowerSourceConfigurationCluster * cppCluster = new PowerSourceConfigurationCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + JNI_METHOD(jlong, PressureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index f5415b29ebd1ae..ac2ee3c2795e04 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -1881,516 +1881,6 @@ JNI_METHOD(void, BridgedActionsCluster, readClusterRevisionAttribute) onFailure.release(); } -JNI_METHOD(void, BridgedDeviceBasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::VendorName::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::VendorID::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readProductNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductName::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readNodeLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readHardwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readHardwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readSoftwareVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readSoftwareVersionStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readManufacturingDateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readProductURLAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readProductLabelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readSerialNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BridgedDeviceBasicCluster, readReachableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::Reachable::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::BridgedDeviceBasicCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - JNI_METHOD(void, BridgedDeviceBasicCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -9237,6 +8727,81 @@ JNI_METHOD(void, PowerSourceCluster, readClusterRevisionAttribute)(JNIEnv * env, onFailure.release(); } +JNI_METHOD(void, PowerSourceConfigurationCluster, readSourcesAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSourceConfiguration::Attributes::Sources::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::PowerSourceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, PowerSourceConfigurationCluster, readClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::PowerSourceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, PressureMeasurementCluster, readMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 82cf4da1419695..43e4db1f0d0117 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -3756,6 +3756,95 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPPowerSourceConfigurationSourcesAttributeCallback::CHIPPowerSourceConfigurationSourcesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPPowerSourceConfigurationSourcesAttributeCallback::~CHIPPowerSourceConfigurationSourcesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPowerSourceConfigurationSourcesAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + bool entryNull = false; + uint8_t entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); + } + VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding SourcesAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback:: CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index b497adff751538..215a7c4bd239f0 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -1037,6 +1037,30 @@ class CHIPPowerSourceActiveBatteryFaultsAttributeCallback bool keepAlive; }; +class CHIPPowerSourceConfigurationSourcesAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPPowerSourceConfigurationSourcesAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPPowerSourceConfigurationSourcesAttributeCallback(); + + static void maybeDestroy(CHIPPowerSourceConfigurationSourcesAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 6bd507ad9ba6cd..d769c8f70a0fae 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -1820,192 +1820,6 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void readVendorNameAttribute(CharStringAttributeCallback callback) { - readVendorNameAttribute(chipClusterPtr, callback); - } - - public void subscribeVendorNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportVendorNameAttribute(CharStringAttributeCallback callback) { - reportVendorNameAttribute(chipClusterPtr, callback); - } - - public void readVendorIDAttribute(IntegerAttributeCallback callback) { - readVendorIDAttribute(chipClusterPtr, callback); - } - - public void subscribeVendorIDAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportVendorIDAttribute(IntegerAttributeCallback callback) { - reportVendorIDAttribute(chipClusterPtr, callback); - } - - public void readProductNameAttribute(CharStringAttributeCallback callback) { - readProductNameAttribute(chipClusterPtr, callback); - } - - public void subscribeProductNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportProductNameAttribute(CharStringAttributeCallback callback) { - reportProductNameAttribute(chipClusterPtr, callback); - } - - public void readNodeLabelAttribute(CharStringAttributeCallback callback) { - readNodeLabelAttribute(chipClusterPtr, callback); - } - - public void writeNodeLabelAttribute(DefaultClusterCallback callback, String value) { - writeNodeLabelAttribute(chipClusterPtr, callback, value); - } - - public void subscribeNodeLabelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportNodeLabelAttribute(CharStringAttributeCallback callback) { - reportNodeLabelAttribute(chipClusterPtr, callback); - } - - public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { - readHardwareVersionAttribute(chipClusterPtr, callback); - } - - public void subscribeHardwareVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportHardwareVersionAttribute(IntegerAttributeCallback callback) { - reportHardwareVersionAttribute(chipClusterPtr, callback); - } - - public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { - readHardwareVersionStringAttribute(chipClusterPtr, callback); - } - - public void subscribeHardwareVersionStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportHardwareVersionStringAttribute(CharStringAttributeCallback callback) { - reportHardwareVersionStringAttribute(chipClusterPtr, callback); - } - - public void readSoftwareVersionAttribute(LongAttributeCallback callback) { - readSoftwareVersionAttribute(chipClusterPtr, callback); - } - - public void subscribeSoftwareVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportSoftwareVersionAttribute(LongAttributeCallback callback) { - reportSoftwareVersionAttribute(chipClusterPtr, callback); - } - - public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { - readSoftwareVersionStringAttribute(chipClusterPtr, callback); - } - - public void subscribeSoftwareVersionStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { - reportSoftwareVersionStringAttribute(chipClusterPtr, callback); - } - - public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { - readManufacturingDateAttribute(chipClusterPtr, callback); - } - - public void subscribeManufacturingDateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportManufacturingDateAttribute(CharStringAttributeCallback callback) { - reportManufacturingDateAttribute(chipClusterPtr, callback); - } - - public void readPartNumberAttribute(CharStringAttributeCallback callback) { - readPartNumberAttribute(chipClusterPtr, callback); - } - - public void subscribePartNumberAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportPartNumberAttribute(CharStringAttributeCallback callback) { - reportPartNumberAttribute(chipClusterPtr, callback); - } - - public void readProductURLAttribute(CharStringAttributeCallback callback) { - readProductURLAttribute(chipClusterPtr, callback); - } - - public void subscribeProductURLAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportProductURLAttribute(CharStringAttributeCallback callback) { - reportProductURLAttribute(chipClusterPtr, callback); - } - - public void readProductLabelAttribute(CharStringAttributeCallback callback) { - readProductLabelAttribute(chipClusterPtr, callback); - } - - public void subscribeProductLabelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportProductLabelAttribute(CharStringAttributeCallback callback) { - reportProductLabelAttribute(chipClusterPtr, callback); - } - - public void readSerialNumberAttribute(CharStringAttributeCallback callback) { - readSerialNumberAttribute(chipClusterPtr, callback); - } - - public void subscribeSerialNumberAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportSerialNumberAttribute(CharStringAttributeCallback callback) { - reportSerialNumberAttribute(chipClusterPtr, callback); - } - - public void readReachableAttribute(BooleanAttributeCallback callback) { - readReachableAttribute(chipClusterPtr, callback); - } - - public void subscribeReachableAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportReachableAttribute(BooleanAttributeCallback callback) { - reportReachableAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -2019,135 +1833,6 @@ public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { reportClusterRevisionAttribute(chipClusterPtr, callback); } - private native void readVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeVendorNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readVendorIDAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeVendorIDAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorIDAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void readProductNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeProductNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readNodeLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void writeNodeLabelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, String value); - - private native void subscribeNodeLabelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNodeLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readHardwareVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeHardwareVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportHardwareVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void readHardwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeHardwareVersionStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportHardwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback); - - private native void subscribeSoftwareVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback); - - private native void readSoftwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeSoftwareVersionStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSoftwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readManufacturingDateAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeManufacturingDateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportManufacturingDateAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readPartNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribePartNumberAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPartNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readProductURLAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeProductURLAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductURLAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readProductLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeProductLabelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readSerialNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeSerialNumberAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSerialNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void readReachableAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); - - private native void subscribeReachableAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportReachableAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); - private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -8793,6 +8478,39 @@ private native void reportClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } + public static class PowerSourceConfigurationCluster extends BaseChipCluster { + public PowerSourceConfigurationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + public static long clusterId() { + return Long.parseUnsignedLong("46"); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface SourcesAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + } + + public void readSourcesAttribute(SourcesAttributeCallback callback) { + readSourcesAttribute(chipClusterPtr, callback); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + private native void readSourcesAttribute( + long chipClusterPtr, SourcesAttributeCallback callback); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + } + public static class PressureMeasurementCluster extends BaseChipCluster { public PressureMeasurementCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index c1e5fb23ffc458..e018fc5f6dd8fd 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -2150,6 +2150,32 @@ public void onError(Exception ex) { } } + public static class DelegatedSourcesAttributeCallback + implements ChipClusters.PowerSourceConfigurationCluster.SourcesAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedAddSceneResponseCallback implements ChipClusters.ScenesCluster.AddSceneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -3126,6 +3152,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.PowerSourceCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("powerSource", powerSourceClusterInfo); + ClusterInfo powerSourceConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PowerSourceConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("powerSourceConfiguration", powerSourceConfigurationClusterInfo); ClusterInfo pressureMeasurementClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.PressureMeasurementCluster(ptr, endpointId), @@ -3264,6 +3295,9 @@ public void combineCommand( .combineCommands(source.get("onOffSwitchConfiguration")); destination.get("operationalCredentials").combineCommands(source.get("operationalCredentials")); destination.get("powerSource").combineCommands(source.get("powerSource")); + destination + .get("powerSourceConfiguration") + .combineCommands(source.get("powerSourceConfiguration")); destination.get("pressureMeasurement").combineCommands(source.get("pressureMeasurement")); destination .get("pumpConfigurationAndControl") @@ -7124,6 +7158,9 @@ public Map> getCommandMap() { commandMap.put("operationalCredentials", operationalCredentialsClusterInteractionInfoMap); Map powerSourceClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("powerSource", powerSourceClusterInteractionInfoMap); + Map powerSourceConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("powerSourceConfiguration", powerSourceConfigurationClusterInteractionInfoMap); Map pressureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("pressureMeasurement", pressureMeasurementClusterInteractionInfoMap); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 12df6a1498dec6..92e31f9978fccb 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -722,182 +722,6 @@ public Map> getReadAttributeMap() { "readClusterRevisionAttribute", readBridgedActionsClusterRevisionAttributeInteractionInfo); readAttributeMap.put("bridgedActions", readBridgedActionsInteractionInfo); Map readBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); - Map readBridgedDeviceBasicVendorNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicVendorNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readVendorNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicVendorNameCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readVendorNameAttribute", readBridgedDeviceBasicVendorNameAttributeInteractionInfo); - Map readBridgedDeviceBasicVendorIDCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicVendorIDAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readVendorIDAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBridgedDeviceBasicVendorIDCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readVendorIDAttribute", readBridgedDeviceBasicVendorIDAttributeInteractionInfo); - Map readBridgedDeviceBasicProductNameCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductNameAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductNameAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductNameCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductNameAttribute", readBridgedDeviceBasicProductNameAttributeInteractionInfo); - Map readBridgedDeviceBasicNodeLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicNodeLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readNodeLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicNodeLabelCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readNodeLabelAttribute", readBridgedDeviceBasicNodeLabelAttributeInteractionInfo); - Map readBridgedDeviceBasicHardwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readHardwareVersionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBridgedDeviceBasicHardwareVersionCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readHardwareVersionAttribute", - readBridgedDeviceBasicHardwareVersionAttributeInteractionInfo); - Map readBridgedDeviceBasicHardwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readHardwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicHardwareVersionStringCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readHardwareVersionStringAttribute", - readBridgedDeviceBasicHardwareVersionStringAttributeInteractionInfo); - Map readBridgedDeviceBasicSoftwareVersionCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSoftwareVersionAttribute((ChipClusters.LongAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readBridgedDeviceBasicSoftwareVersionCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSoftwareVersionAttribute", - readBridgedDeviceBasicSoftwareVersionAttributeInteractionInfo); - Map readBridgedDeviceBasicSoftwareVersionStringCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSoftwareVersionStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicSoftwareVersionStringCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSoftwareVersionStringAttribute", - readBridgedDeviceBasicSoftwareVersionStringAttributeInteractionInfo); - Map readBridgedDeviceBasicManufacturingDateCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readManufacturingDateAttribute( - (ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicManufacturingDateCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readManufacturingDateAttribute", - readBridgedDeviceBasicManufacturingDateAttributeInteractionInfo); - Map readBridgedDeviceBasicPartNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicPartNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readPartNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicPartNumberCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readPartNumberAttribute", readBridgedDeviceBasicPartNumberAttributeInteractionInfo); - Map readBridgedDeviceBasicProductURLCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductURLAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductURLAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductURLCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductURLAttribute", readBridgedDeviceBasicProductURLAttributeInteractionInfo); - Map readBridgedDeviceBasicProductLabelCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicProductLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readProductLabelAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicProductLabelCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readProductLabelAttribute", readBridgedDeviceBasicProductLabelAttributeInteractionInfo); - Map readBridgedDeviceBasicSerialNumberCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicSerialNumberAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readSerialNumberAttribute((ChipClusters.CharStringAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBridgedDeviceBasicSerialNumberCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readSerialNumberAttribute", readBridgedDeviceBasicSerialNumberAttributeInteractionInfo); - Map readBridgedDeviceBasicReachableCommandParams = - new LinkedHashMap(); - InteractionInfo readBridgedDeviceBasicReachableAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .readReachableAttribute((ChipClusters.BooleanAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), - readBridgedDeviceBasicReachableCommandParams); - readBridgedDeviceBasicInteractionInfo.put( - "readReachableAttribute", readBridgedDeviceBasicReachableAttributeInteractionInfo); Map readBridgedDeviceBasicClusterRevisionCommandParams = new LinkedHashMap(); InteractionInfo readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo = @@ -3448,6 +3272,36 @@ public Map> getReadAttributeMap() { readPowerSourceInteractionInfo.put( "readClusterRevisionAttribute", readPowerSourceClusterRevisionAttributeInteractionInfo); readAttributeMap.put("powerSource", readPowerSourceInteractionInfo); + Map readPowerSourceConfigurationInteractionInfo = + new LinkedHashMap<>(); + Map readPowerSourceConfigurationSourcesCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceConfigurationSourcesAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceConfigurationCluster) cluster) + .readSourcesAttribute( + (ChipClusters.PowerSourceConfigurationCluster.SourcesAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedSourcesAttributeCallback(), + readPowerSourceConfigurationSourcesCommandParams); + readPowerSourceConfigurationInteractionInfo.put( + "readSourcesAttribute", readPowerSourceConfigurationSourcesAttributeInteractionInfo); + Map readPowerSourceConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceConfigurationClusterRevisionCommandParams); + readPowerSourceConfigurationInteractionInfo.put( + "readClusterRevisionAttribute", + readPowerSourceConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("powerSourceConfiguration", readPowerSourceConfigurationInteractionInfo); Map readPressureMeasurementInteractionInfo = new LinkedHashMap<>(); Map readPressureMeasurementMeasuredValueCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index d535b15affa632..2ade2a6dd15e0e 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -137,23 +137,6 @@ public Map> getWriteAttributeMap() { Map writeBridgedActionsInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("bridgedActions", writeBridgedActionsInteractionInfo); Map writeBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); - Map writeBridgedDeviceBasicNodeLabelCommandParams = - new LinkedHashMap(); - CommandParameterInfo bridgedDeviceBasicnodeLabelCommandParameterInfo = - new CommandParameterInfo("value", String.class); - writeBridgedDeviceBasicNodeLabelCommandParams.put( - "value", bridgedDeviceBasicnodeLabelCommandParameterInfo); - InteractionInfo writeBridgedDeviceBasicNodeLabelAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BridgedDeviceBasicCluster) cluster) - .writeNodeLabelAttribute( - (DefaultClusterCallback) callback, (String) commandArguments.get("value")); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBridgedDeviceBasicNodeLabelCommandParams); - writeBridgedDeviceBasicInteractionInfo.put( - "writeNodeLabelAttribute", writeBridgedDeviceBasicNodeLabelAttributeInteractionInfo); writeAttributeMap.put("bridgedDeviceBasic", writeBridgedDeviceBasicInteractionInfo); Map writeColorControlInteractionInfo = new LinkedHashMap<>(); Map writeColorControlColorControlOptionsCommandParams = @@ -700,6 +683,9 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("operationalCredentials", writeOperationalCredentialsInteractionInfo); Map writePowerSourceInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("powerSource", writePowerSourceInteractionInfo); + Map writePowerSourceConfigurationInteractionInfo = + new LinkedHashMap<>(); + writeAttributeMap.put("powerSourceConfiguration", writePowerSourceConfigurationInteractionInfo); Map writePressureMeasurementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("pressureMeasurement", writePressureMeasurementInteractionInfo); Map writePumpConfigurationAndControlInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp new file mode 100644 index 00000000000000..4cfc3488498eff --- /dev/null +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -0,0 +1,11344 @@ +/* + * + * Copyright (c) 2021 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace chip; +using namespace chip::app; + +namespace { + +// Define pointers for external ZCL response delegates. + +using SuccessResponseDelegate = void (*)(); +using FailureResponseDelegate = void (*)(uint8_t); +SuccessResponseDelegate gSuccessResponseDelegate; +FailureResponseDelegate gFailureResponseDelegate; + +// Define callbacks for ZCL commands and attribute requests. + +#if CHIP_PROGRESS_LOGGING +std::string ByteSpanToString(chip::ByteSpan value) +{ + std::string strValue = ""; + for (size_t i = 0; i < value.size(); i++) + { + strValue += ' '; + strValue += std::to_string(value.data()[i]); + } + return strValue; +} +#endif + +void OnDefaultSuccessResponse(void * /* context */) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} + +void OnDefaultFailureResponse(void * /* context */, uint8_t status) +{ + if (gFailureResponseDelegate != nullptr) + gFailureResponseDelegate(status); +} + +template +void OnAttributeResponse(void * /* context */, AttributeType value) +{ + std::string strValue = std::to_string(value); + ChipLogProgress(Zcl, " attributeValue: %s", strValue.c_str()); + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} + +template <> +void OnAttributeResponse(void * /* context */, chip::ByteSpan value) +{ + ChipLogProgress(Zcl, " attributeValue: (span of length %zd) %s", value.size(), ByteSpanToString(value).c_str()); + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} + +template <> +void OnAttributeResponse(void * /* context */, chip::CharSpan value) +{ + ChipLogProgress(Zcl, " attributeValue: '%.*s'", static_cast(value.size()), value.data()); + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} + +template <> +void OnAttributeResponse(void * /* context */, bool value) +{ + ChipLogProgress(Zcl, " attributeValue: %s", value ? "true" : "false"); + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} + +static void +OnApplicationLauncherApplicationLauncherListListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gApplicationLauncherApplicationLauncherListListAttributeCallback{ + OnApplicationLauncherApplicationLauncherListListAttributeResponse, nullptr + }; +static void OnAudioOutputAudioOutputListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gAudioOutputAudioOutputListListAttributeCallback{ + OnAudioOutputAudioOutputListListAttributeResponse, nullptr +}; +static void OnBridgedActionsActionListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gBridgedActionsActionListListAttributeCallback{ + OnBridgedActionsActionListListAttributeResponse, nullptr +}; +static void OnBridgedActionsEndpointListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gBridgedActionsEndpointListListAttributeCallback{ + OnBridgedActionsEndpointListListAttributeResponse, nullptr +}; +static void +OnContentLauncherAcceptsHeaderListListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gContentLauncherAcceptsHeaderListListAttributeCallback{ OnContentLauncherAcceptsHeaderListListAttributeResponse, nullptr }; +static void OnContentLauncherSupportedStreamingTypesListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gContentLauncherSupportedStreamingTypesListAttributeCallback{ OnContentLauncherSupportedStreamingTypesListAttributeResponse, + nullptr }; +static void OnDescriptorDeviceListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gDescriptorDeviceListListAttributeCallback{ + OnDescriptorDeviceListListAttributeResponse, nullptr +}; +static void OnDescriptorServerListListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gDescriptorServerListListAttributeCallback{ + OnDescriptorServerListListAttributeResponse, nullptr +}; +static void OnDescriptorClientListListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gDescriptorClientListListAttributeCallback{ + OnDescriptorClientListListAttributeResponse, nullptr +}; +static void OnDescriptorPartsListListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gDescriptorPartsListListAttributeCallback{ + OnDescriptorPartsListListAttributeResponse, nullptr +}; +static void OnFixedLabelLabelListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gFixedLabelLabelListListAttributeCallback{ + OnFixedLabelLabelListListAttributeResponse, nullptr +}; +static void OnGeneralCommissioningBasicCommissioningInfoListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gGeneralCommissioningBasicCommissioningInfoListListAttributeCallback{ + OnGeneralCommissioningBasicCommissioningInfoListListAttributeResponse, nullptr + }; +static void OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gGeneralDiagnosticsNetworkInterfacesListAttributeCallback{ OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse, + nullptr }; +static void OnGeneralDiagnosticsActiveHardwareFaultsListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gGeneralDiagnosticsActiveHardwareFaultsListAttributeCallback{ OnGeneralDiagnosticsActiveHardwareFaultsListAttributeResponse, + nullptr }; +static void OnGeneralDiagnosticsActiveRadioFaultsListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gGeneralDiagnosticsActiveRadioFaultsListAttributeCallback{ OnGeneralDiagnosticsActiveRadioFaultsListAttributeResponse, + nullptr }; +static void OnGeneralDiagnosticsActiveNetworkFaultsListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gGeneralDiagnosticsActiveNetworkFaultsListAttributeCallback{ OnGeneralDiagnosticsActiveNetworkFaultsListAttributeResponse, + nullptr }; +static void OnGroupKeyManagementGroupsListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gGroupKeyManagementGroupsListAttributeCallback{ + OnGroupKeyManagementGroupsListAttributeResponse, nullptr +}; +static void OnGroupKeyManagementGroupKeysListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gGroupKeyManagementGroupKeysListAttributeCallback{ + OnGroupKeyManagementGroupKeysListAttributeResponse, nullptr +}; +static void OnMediaInputMediaInputListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gMediaInputMediaInputListListAttributeCallback{ + OnMediaInputMediaInputListListAttributeResponse, nullptr +}; +static void OnModeSelectSupportedModesListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gModeSelectSupportedModesListAttributeCallback{ + OnModeSelectSupportedModesListAttributeResponse, nullptr +}; +static void OnOperationalCredentialsFabricsListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gOperationalCredentialsFabricsListListAttributeCallback{ OnOperationalCredentialsFabricsListListAttributeResponse, nullptr }; +static void OnOperationalCredentialsTrustedRootCertificatesListAttributeResponse( + void * context, const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gOperationalCredentialsTrustedRootCertificatesListAttributeCallback{ + OnOperationalCredentialsTrustedRootCertificatesListAttributeResponse, nullptr + }; +static void OnPowerSourceActiveBatteryFaultsListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gPowerSourceActiveBatteryFaultsListAttributeCallback{ + OnPowerSourceActiveBatteryFaultsListAttributeResponse, nullptr +}; +static void OnPowerSourceConfigurationSourcesListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gPowerSourceConfigurationSourcesListAttributeCallback{ OnPowerSourceConfigurationSourcesListAttributeResponse, nullptr }; +static void OnSoftwareDiagnosticsThreadMetricsListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gSoftwareDiagnosticsThreadMetricsListAttributeCallback{ OnSoftwareDiagnosticsThreadMetricsListAttributeResponse, nullptr }; +static void OnTvChannelTvChannelListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gTvChannelTvChannelListListAttributeCallback{ + OnTvChannelTvChannelListListAttributeResponse, nullptr +}; +static void OnTargetNavigatorTargetNavigatorListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gTargetNavigatorTargetNavigatorListListAttributeCallback{ OnTargetNavigatorTargetNavigatorListListAttributeResponse, nullptr }; +static void OnTestClusterListInt8uListAttributeResponse(void * context, const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gTestClusterListInt8uListAttributeCallback{ + OnTestClusterListInt8uListAttributeResponse, nullptr +}; +static void OnTestClusterListOctetStringListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback gTestClusterListOctetStringListAttributeCallback{ + OnTestClusterListOctetStringListAttributeResponse, nullptr +}; +static void OnTestClusterListStructOctetStringListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gTestClusterListStructOctetStringListAttributeCallback{ OnTestClusterListStructOctetStringListAttributeResponse, nullptr }; +static void OnTestClusterListNullablesAndOptionalsStructListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gTestClusterListNullablesAndOptionalsStructListAttributeCallback{ + OnTestClusterListNullablesAndOptionalsStructListAttributeResponse, nullptr + }; +static void OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gThreadNetworkDiagnosticsNeighborTableListListAttributeCallback{ + OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse, nullptr + }; +static void OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gThreadNetworkDiagnosticsRouteTableListListAttributeCallback{ OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse, + nullptr }; +static void OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback{ OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse, + nullptr }; +static void OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback{ + OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse, nullptr + }; +static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse( + void * context, const chip::app::DataModel::DecodableList & list) +{ + if (gSuccessResponseDelegate != nullptr) + gSuccessResponseDelegate(); +} +chip::Callback::Callback + gThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback{ + OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse, nullptr + }; + +chip::Callback::Callback gDefaultSuccessCallback{ OnDefaultSuccessResponse, nullptr }; +chip::Callback::Callback gDefaultFailureCallback{ OnDefaultFailureResponse, nullptr }; +chip::Callback::Callback gBooleanAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt8uAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt8sAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt16uAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt16sAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt32uAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt32sAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt64uAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gInt64sAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gOctetStringAttributeCallback{ OnAttributeResponse, nullptr }; +chip::Callback::Callback gCharStringAttributeCallback{ OnAttributeResponse, nullptr }; + +} // namespace + +extern "C" { + +void chip_ime_SetSuccessResponseDelegate(SuccessResponseDelegate delegate) +{ + gSuccessResponseDelegate = delegate; +} + +void chip_ime_SetFailureResponseDelegate(FailureResponseDelegate delegate) +{ + gFailureResponseDelegate = delegate; +} + +// Cluster AccountLogin + +chip::ChipError::StorageType chip_ime_ReadAttribute_AccountLogin_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AccountLoginCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_AccountLogin_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AccountLoginCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster AccountLogin +// Cluster AdministratorCommissioning + +chip::ChipError::StorageType chip_ime_ReadAttribute_AdministratorCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AdministratorCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_AdministratorCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AdministratorCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster AdministratorCommissioning +// Cluster ApplicationBasic + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_VendorName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeVendorName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_VendorName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeVendorName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_VendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_VendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_ApplicationName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeApplicationName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_ApplicationName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeApplicationName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_ProductId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeProductId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_ProductId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeProductId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_ApplicationId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeApplicationId(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_ApplicationId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeApplicationId(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_CatalogVendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCatalogVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_CatalogVendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCatalogVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_ApplicationStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeApplicationStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_ApplicationStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeApplicationStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ApplicationBasic +// Cluster ApplicationLauncher + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationLauncher_ApplicationLauncherList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeApplicationLauncherList(gApplicationLauncherApplicationLauncherListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationLauncher_CatalogVendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCatalogVendorId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationLauncher_CatalogVendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCatalogVendorId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationLauncher_ApplicationId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeApplicationId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationLauncher_ApplicationId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeApplicationId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ApplicationLauncher_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ApplicationLauncher_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ApplicationLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ApplicationLauncher +// Cluster AudioOutput + +chip::ChipError::StorageType chip_ime_ReadAttribute_AudioOutput_AudioOutputList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeAudioOutputList(gAudioOutputAudioOutputListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_AudioOutput_CurrentAudioOutput(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentAudioOutput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_AudioOutput_CurrentAudioOutput(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentAudioOutput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_AudioOutput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_AudioOutput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::AudioOutputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster AudioOutput +// Cluster BarrierControl + +chip::ChipError::StorageType chip_ime_ReadAttribute_BarrierControl_BarrierMovingState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBarrierMovingState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BarrierControl_BarrierMovingState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBarrierMovingState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BarrierControl_BarrierSafetyStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBarrierSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BarrierControl_BarrierSafetyStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBarrierSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BarrierControl_BarrierCapabilities(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBarrierCapabilities(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BarrierControl_BarrierCapabilities(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBarrierCapabilities(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BarrierControl_BarrierPosition(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBarrierPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BarrierControl_BarrierPosition(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBarrierPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BarrierControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BarrierControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BarrierControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster BarrierControl +// Cluster Basic + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_InteractionModelVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInteractionModelVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_InteractionModelVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInteractionModelVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_VendorName(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeVendorName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_VendorName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeVendorName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_VendorID(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeVendorID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_VendorID(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeVendorID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ProductName(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeProductName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ProductName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeProductName(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ProductID(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeProductID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ProductID(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeProductID(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_NodeLabel(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNodeLabel(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_NodeLabel(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNodeLabel(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_Location(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLocation(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_Location(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLocation(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_HardwareVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeHardwareVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_HardwareVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeHardwareVersion(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_HardwareVersionString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeHardwareVersionString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_HardwareVersionString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeHardwareVersionString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_SoftwareVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSoftwareVersion(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_SoftwareVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSoftwareVersion(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_SoftwareVersionString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSoftwareVersionString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_SoftwareVersionString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSoftwareVersionString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ManufacturingDate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeManufacturingDate(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ManufacturingDate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeManufacturingDate(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_PartNumber(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePartNumber(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_PartNumber(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePartNumber(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ProductURL(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeProductURL(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ProductURL(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeProductURL(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ProductLabel(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeProductLabel(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ProductLabel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeProductLabel(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_SerialNumber(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSerialNumber(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_SerialNumber(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSerialNumber(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_LocalConfigDisabled(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLocalConfigDisabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_LocalConfigDisabled(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLocalConfigDisabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_Reachable(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeReachable(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_Reachable(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeReachable(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_UniqueID(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeUniqueID(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Basic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Basic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Basic +// Cluster BinaryInputBasic + +chip::ChipError::StorageType chip_ime_ReadAttribute_BinaryInputBasic_OutOfService(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOutOfService(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BinaryInputBasic_OutOfService(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOutOfService(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BinaryInputBasic_PresentValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePresentValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BinaryInputBasic_PresentValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePresentValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BinaryInputBasic_StatusFlags(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStatusFlags(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BinaryInputBasic_StatusFlags(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStatusFlags(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BinaryInputBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BinaryInputBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BinaryInputBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster BinaryInputBasic +// Cluster Binding + +chip::ChipError::StorageType chip_ime_ReadAttribute_Binding_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BindingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Binding_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BindingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Binding +// Cluster BooleanState + +chip::ChipError::StorageType chip_ime_ReadAttribute_BooleanState_StateValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BooleanStateCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStateValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BooleanState_StateValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BooleanStateCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStateValue(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BooleanState_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BooleanStateCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BooleanState_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BooleanStateCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster BooleanState +// Cluster BridgedActions + +chip::ChipError::StorageType chip_ime_ReadAttribute_BridgedActions_ActionList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActionList(gBridgedActionsActionListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BridgedActions_EndpointList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeEndpointList(gBridgedActionsEndpointListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BridgedActions_SetupUrl(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSetupUrl(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BridgedActions_SetupUrl(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSetupUrl(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_BridgedActions_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BridgedActions_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedActionsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster BridgedActions +// Cluster BridgedDeviceBasic + +chip::ChipError::StorageType chip_ime_ReadAttribute_BridgedDeviceBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedDeviceBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_BridgedDeviceBasic_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::BridgedDeviceBasicCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster BridgedDeviceBasic +// Cluster ColorControl + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CurrentHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentHue(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_CurrentHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentHue(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CurrentSaturation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentSaturation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_CurrentSaturation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentSaturation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_RemainingTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRemainingTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_RemainingTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRemainingTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CurrentX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_CurrentX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CurrentY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_CurrentY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_DriftCompensation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDriftCompensation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_DriftCompensation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDriftCompensation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CompensationText(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCompensationText(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_CompensationText(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCompensationText(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorTemperature(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorTemperature(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorTemperature(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorTemperature(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorControlOptions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorControlOptions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorControlOptions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorControlOptions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_NumberOfPrimaries(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNumberOfPrimaries(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_NumberOfPrimaries(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNumberOfPrimaries(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary1X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary1X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary1X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary1X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary1Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary1Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary1Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary1Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary1Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary1Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary1Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary1Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary2X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary2X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary2X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary2X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary2Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary2Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary2Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary2Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary2Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary2Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary2Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary2Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary3X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary3X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary3X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary3X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary3Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary3Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary3Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary3Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary3Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary3Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary3Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary3Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary4X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary4X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary4X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary4X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary4Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary4Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary4Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary4Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary4Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary4Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary4Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary4Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary5X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary5X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary5X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary5X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary5Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary5Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary5Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary5Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary5Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary5Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary5Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary5Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary6X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary6X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary6X(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary6X(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary6Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary6Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary6Y(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary6Y(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_Primary6Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePrimary6Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_Primary6Intensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePrimary6Intensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_WhitePointX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeWhitePointX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_WhitePointX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeWhitePointX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_WhitePointY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeWhitePointY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_WhitePointY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeWhitePointY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointRX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointRX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointRX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointRX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointRY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointRY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointRY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointRY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointRIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointRIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointRIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointRIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointGX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointGX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointGX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointGX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointGY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointGY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointGY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointGY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointGIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointGIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointGIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointGIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointBX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointBX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointBX(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointBX(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointBY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointBY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointBY(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointBY(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorPointBIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorPointBIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorPointBIntensity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorPointBIntensity(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_EnhancedCurrentHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnhancedCurrentHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_EnhancedCurrentHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEnhancedCurrentHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_EnhancedColorMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnhancedColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_EnhancedColorMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEnhancedColorMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorLoopActive(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorLoopActive(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorLoopActive(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorLoopActive(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorLoopDirection(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorLoopDirection(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorLoopDirection(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorLoopDirection(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorLoopTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorLoopTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorLoopTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorLoopTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorLoopStartEnhancedHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorLoopStartEnhancedHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorLoopStartEnhancedHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorLoopStartEnhancedHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorLoopStoredEnhancedHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorLoopStoredEnhancedHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorLoopStoredEnhancedHue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorLoopStoredEnhancedHue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorCapabilities(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorCapabilities(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorCapabilities(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorCapabilities(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorTempPhysicalMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorTempPhysicalMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorTempPhysicalMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorTempPhysicalMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ColorTempPhysicalMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeColorTempPhysicalMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ColorTempPhysicalMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeColorTempPhysicalMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_CoupleColorTempToLevelMinMireds(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_ColorControl_CoupleColorTempToLevelMinMireds(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCoupleColorTempToLevelMinMireds(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_StartUpColorTemperatureMireds(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartUpColorTemperatureMireds(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_StartUpColorTemperatureMireds(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartUpColorTemperatureMireds(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ColorControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ColorControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ColorControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ColorControl +// Cluster ContentLauncher + +chip::ChipError::StorageType chip_ime_ReadAttribute_ContentLauncher_AcceptsHeaderList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ContentLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeAcceptsHeaderList(gContentLauncherAcceptsHeaderListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ContentLauncher_SupportedStreamingTypes(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ContentLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeSupportedStreamingTypes(gContentLauncherSupportedStreamingTypesListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ContentLauncher_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ContentLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ContentLauncher_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ContentLauncherCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ContentLauncher +// Cluster Descriptor + +chip::ChipError::StorageType chip_ime_ReadAttribute_Descriptor_DeviceList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDeviceList(gDescriptorDeviceListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Descriptor_ServerList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeServerList(gDescriptorServerListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Descriptor_ClientList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClientList(gDescriptorClientListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Descriptor_PartsList(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePartsList(gDescriptorPartsListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Descriptor_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Descriptor_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DescriptorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Descriptor +// Cluster DiagnosticLogs + +// End of Cluster DiagnosticLogs +// Cluster DoorLock + +chip::ChipError::StorageType chip_ime_ReadAttribute_DoorLock_LockState(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLockState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_DoorLock_LockState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLockState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_DoorLock_LockType(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLockType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_DoorLock_LockType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLockType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_DoorLock_ActuatorEnabled(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeActuatorEnabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_DoorLock_ActuatorEnabled(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeActuatorEnabled(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_DoorLock_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_DoorLock_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::DoorLockCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster DoorLock +// Cluster ElectricalMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_MeasurementType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasurementType(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_MeasurementType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasurementType(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_TotalActivePower(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTotalActivePower(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_TotalActivePower(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTotalActivePower(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsVoltage(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsVoltage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsVoltage(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltageMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsVoltageMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsVoltageMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsVoltageMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsVoltageMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsVoltageMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsVoltageMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsVoltageMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrent(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsCurrent(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsCurrent(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsCurrent(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrentMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsCurrentMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsCurrentMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsCurrentMin(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_RmsCurrentMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRmsCurrentMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_RmsCurrentMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRmsCurrentMax(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_ActivePower(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeActivePower(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_ActivePower(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeActivePower(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_ActivePowerMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeActivePowerMin(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_ActivePowerMin(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeActivePowerMin(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_ActivePowerMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeActivePowerMax(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_ActivePowerMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeActivePowerMax(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ElectricalMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ElectricalMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ElectricalMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ElectricalMeasurement +// Cluster EthernetNetworkDiagnostics + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_PHYRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePHYRate(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_PHYRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePHYRate(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_FullDuplex(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFullDuplex(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_FullDuplex(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFullDuplex(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_PacketRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketRxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_PacketRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketRxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_PacketTxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketTxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_PacketTxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketTxCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_TxErrCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxErrCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_TxErrCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxErrCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_CollisionCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCollisionCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_CollisionCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCollisionCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_CarrierDetect(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCarrierDetect(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_CarrierDetect(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCarrierDetect(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_TimeSinceReset(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTimeSinceReset(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_TimeSinceReset(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTimeSinceReset(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_EthernetNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_EthernetNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::EthernetNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster EthernetNetworkDiagnostics +// Cluster FixedLabel + +chip::ChipError::StorageType chip_ime_ReadAttribute_FixedLabel_LabelList(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FixedLabelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLabelList(gFixedLabelLabelListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_FixedLabel_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FixedLabelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FixedLabel_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FixedLabelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster FixedLabel +// Cluster FlowMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FlowMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FlowMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FlowMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FlowMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_FlowMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster FlowMeasurement +// Cluster GeneralCommissioning + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralCommissioning_Breadcrumb(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBreadcrumb(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralCommissioning_Breadcrumb(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBreadcrumb(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralCommissioning_BasicCommissioningInfoList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeBasicCommissioningInfoList(gGeneralCommissioningBasicCommissioningInfoListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster GeneralCommissioning +// Cluster GeneralDiagnostics + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_NetworkInterfaces(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeNetworkInterfaces(gGeneralDiagnosticsNetworkInterfacesListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_RebootCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRebootCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralDiagnostics_RebootCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRebootCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_UpTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeUpTime(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralDiagnostics_UpTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeUpTime(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_TotalOperationalHours(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTotalOperationalHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralDiagnostics_TotalOperationalHours(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTotalOperationalHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_BootReasons(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBootReasons(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralDiagnostics_BootReasons(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBootReasons(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_ActiveHardwareFaults(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActiveHardwareFaults(gGeneralDiagnosticsActiveHardwareFaultsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_ActiveRadioFaults(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActiveRadioFaults(gGeneralDiagnosticsActiveRadioFaultsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_ActiveNetworkFaults(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActiveNetworkFaults(gGeneralDiagnosticsActiveNetworkFaultsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GeneralDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GeneralDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GeneralDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster GeneralDiagnostics +// Cluster GroupKeyManagement + +chip::ChipError::StorageType chip_ime_ReadAttribute_GroupKeyManagement_Groups(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeGroups(gGroupKeyManagementGroupsListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GroupKeyManagement_GroupKeys(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeGroupKeys(gGroupKeyManagementGroupKeysListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_GroupKeyManagement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_GroupKeyManagement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster GroupKeyManagement +// Cluster Groups + +chip::ChipError::StorageType chip_ime_ReadAttribute_Groups_NameSupport(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Groups_NameSupport(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Groups_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Groups_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::GroupsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Groups +// Cluster Identify + +chip::ChipError::StorageType chip_ime_ReadAttribute_Identify_IdentifyTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeIdentifyTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Identify_IdentifyTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeIdentifyTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Identify_IdentifyType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeIdentifyType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Identify_IdentifyType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeIdentifyType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Identify_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Identify_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IdentifyCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Identify +// Cluster IlluminanceMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_LightSensorType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLightSensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_LightSensorType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLightSensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_IlluminanceMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_IlluminanceMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::IlluminanceMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster IlluminanceMeasurement +// Cluster KeypadInput + +chip::ChipError::StorageType chip_ime_ReadAttribute_KeypadInput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::KeypadInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_KeypadInput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::KeypadInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster KeypadInput +// Cluster LevelControl + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_CurrentLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_CurrentLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_RemainingTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRemainingTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_RemainingTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRemainingTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_MinLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_MinLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_MaxLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_MaxLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_CurrentFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_CurrentFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_MinFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_MinFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_MaxFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_MaxFrequency(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxFrequency(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_Options(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOptions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_Options(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOptions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_OnOffTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnOffTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_OnOffTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnOffTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_OnLevel(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_OnLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_OnTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_OnTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_OffTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOffTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_OffTransitionTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOffTransitionTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_DefaultMoveRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDefaultMoveRate(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_DefaultMoveRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDefaultMoveRate(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_StartUpCurrentLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartUpCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_StartUpCurrentLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartUpCurrentLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_LevelControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LevelControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LevelControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster LevelControl +// Cluster LowPower + +chip::ChipError::StorageType chip_ime_ReadAttribute_LowPower_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LowPowerCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_LowPower_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::LowPowerCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster LowPower +// Cluster MediaInput + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaInput_MediaInputList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeMediaInputList(gMediaInputMediaInputListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaInput_CurrentMediaInput(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentMediaInput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaInput_CurrentMediaInput(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentMediaInput(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaInput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaInput_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaInputCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster MediaInput +// Cluster MediaPlayback + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_PlaybackState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePlaybackState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_PlaybackState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePlaybackState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_StartTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartTime(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_StartTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartTime(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_Duration(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDuration(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_Duration(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDuration(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_PositionUpdatedAt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePositionUpdatedAt(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_PositionUpdatedAt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePositionUpdatedAt(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_Position(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePosition(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_Position(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePosition(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_PlaybackSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePlaybackSpeed(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_PlaybackSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePlaybackSpeed(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_SeekRangeEnd(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSeekRangeEnd(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_SeekRangeEnd(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSeekRangeEnd(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_SeekRangeStart(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSeekRangeStart(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_SeekRangeStart(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSeekRangeStart(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_MediaPlayback_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_MediaPlayback_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::MediaPlaybackCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster MediaPlayback +// Cluster ModeSelect + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_CurrentMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ModeSelect_CurrentMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_SupportedModes(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeSupportedModes(gModeSelectSupportedModesListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_OnMode(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ModeSelect_OnMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_StartUpMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartUpMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ModeSelect_StartUpMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartUpMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_Description(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDescription(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ModeSelect_Description(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDescription(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ModeSelect_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ModeSelect_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ModeSelectCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ModeSelect +// Cluster NetworkCommissioning + +chip::ChipError::StorageType chip_ime_ReadAttribute_NetworkCommissioning_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::NetworkCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_NetworkCommissioning_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::NetworkCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_NetworkCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::NetworkCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_NetworkCommissioning_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::NetworkCommissioningCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster NetworkCommissioning +// Cluster OtaSoftwareUpdateProvider + +chip::ChipError::StorageType chip_ime_ReadAttribute_OtaSoftwareUpdateProvider_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OtaSoftwareUpdateProvider_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateProviderCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OtaSoftwareUpdateProvider +// Cluster OtaSoftwareUpdateRequestor + +chip::ChipError::StorageType chip_ime_ReadAttribute_OtaSoftwareUpdateRequestor_DefaultOtaProvider(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDefaultOtaProvider(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OtaSoftwareUpdateRequestor_DefaultOtaProvider( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDefaultOtaProvider(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OtaSoftwareUpdateRequestor_UpdatePossible(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeUpdatePossible(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OtaSoftwareUpdateRequestor_UpdatePossible(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeUpdatePossible(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OtaSoftwareUpdateRequestor_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OtaSoftwareUpdateRequestor_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OtaSoftwareUpdateRequestor +// Cluster OccupancySensing + +chip::ChipError::StorageType chip_ime_ReadAttribute_OccupancySensing_Occupancy(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupancy(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OccupancySensing_Occupancy(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOccupancy(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OccupancySensing_OccupancySensorType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupancySensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OccupancySensing_OccupancySensorType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOccupancySensorType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OccupancySensing_OccupancySensorTypeBitmap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupancySensorTypeBitmap(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OccupancySensing_OccupancySensorTypeBitmap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOccupancySensorTypeBitmap(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OccupancySensing_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OccupancySensing_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OccupancySensingCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OccupancySensing +// Cluster OnOff + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_OnOff(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnOff(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_OnOff(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnOff(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_GlobalSceneControl(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeGlobalSceneControl(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_GlobalSceneControl(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeGlobalSceneControl(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_OnTime(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOnTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_OnTime(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOnTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_OffWaitTime(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOffWaitTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_OffWaitTime(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOffWaitTime(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_StartUpOnOff(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartUpOnOff(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_StartUpOnOff(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartUpOnOff(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_FeatureMap(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOff_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOff_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OnOff +// Cluster OnOffSwitchConfiguration + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOffSwitchConfiguration_SwitchType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSwitchType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOffSwitchConfiguration_SwitchType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSwitchType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOffSwitchConfiguration_SwitchActions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSwitchActions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOffSwitchConfiguration_SwitchActions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSwitchActions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OnOffSwitchConfiguration_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OnOffSwitchConfiguration_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OnOffSwitchConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OnOffSwitchConfiguration +// Cluster OperationalCredentials + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_FabricsList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeFabricsList(gOperationalCredentialsFabricsListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_SupportedFabrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSupportedFabrics(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OperationalCredentials_SupportedFabrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSupportedFabrics(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_CommissionedFabrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCommissionedFabrics(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OperationalCredentials_CommissionedFabrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCommissionedFabrics(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_TrustedRootCertificates(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeTrustedRootCertificates(gOperationalCredentialsTrustedRootCertificatesListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_CurrentFabricIndex(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentFabricIndex(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OperationalCredentials_CurrentFabricIndex(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentFabricIndex(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_OperationalCredentials_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster OperationalCredentials +// Cluster PowerSource + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_Status(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_Status(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_Order(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOrder(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_Order(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOrder(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_Description(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDescription(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_Description(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDescription(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_BatteryVoltage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBatteryVoltage(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_BatteryVoltage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBatteryVoltage(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_BatteryPercentRemaining(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBatteryPercentRemaining(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_BatteryPercentRemaining(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBatteryPercentRemaining(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_BatteryTimeRemaining(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBatteryTimeRemaining(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_BatteryTimeRemaining(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBatteryTimeRemaining(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_BatteryChargeLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBatteryChargeLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_BatteryChargeLevel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBatteryChargeLevel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_ActiveBatteryFaults(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActiveBatteryFaults(gPowerSourceActiveBatteryFaultsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_BatteryChargeState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBatteryChargeState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_BatteryChargeState(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBatteryChargeState(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSource_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PowerSource_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster PowerSource +// Cluster PowerSourceConfiguration + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSourceConfiguration_Sources(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeSources(gPowerSourceConfigurationSourcesListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PowerSourceConfiguration_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PowerSourceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +// End of Cluster PowerSourceConfiguration +// Cluster PressureMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_PressureMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PressureMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PressureMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PressureMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PressureMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PressureMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PressureMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PressureMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PressureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster PressureMeasurement +// Cluster PumpConfigurationAndControl + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MinConstPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinConstPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MinConstPressure(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinConstPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxConstPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxConstPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxConstPressure(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxConstPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MinCompPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinCompPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MinCompPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinCompPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxCompPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxCompPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxCompPressure(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxCompPressure(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MinConstSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinConstSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MinConstSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinConstSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxConstSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxConstSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxConstSpeed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxConstSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MinConstFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinConstFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MinConstFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinConstFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxConstFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxConstFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxConstFlow(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxConstFlow(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MinConstTemp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinConstTemp(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MinConstTemp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinConstTemp(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_MaxConstTemp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxConstTemp(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_MaxConstTemp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxConstTemp(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_PumpStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePumpStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_PumpStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePumpStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_EffectiveOperationMode( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEffectiveOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_EffectiveOperationMode( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEffectiveOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_EffectiveControlMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEffectiveControlMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_EffectiveControlMode( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEffectiveControlMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_Capacity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCapacity(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Capacity(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCapacity(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_Speed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Speed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSpeed(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeRunningHours(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLifetimeRunningHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeRunningHours( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLifetimeRunningHours(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_Power(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePower(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_Power(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePower(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_LifetimeEnergyConsumed( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLifetimeEnergyConsumed(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_LifetimeEnergyConsumed( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLifetimeEnergyConsumed(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_OperationMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_OperationMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOperationMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_ControlMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeControlMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_ControlMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeControlMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_AlarmMask(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAlarmMask(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_AlarmMask(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAlarmMask(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_PumpConfigurationAndControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_PumpConfigurationAndControl_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::PumpConfigurationAndControlCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster PumpConfigurationAndControl +// Cluster RelativeHumidityMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_MinMeasuredValue(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster RelativeHumidityMeasurement +// Cluster Scenes + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_SceneCount(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSceneCount(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_SceneCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSceneCount(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_CurrentScene(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentScene(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_CurrentScene(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentScene(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_CurrentGroup(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentGroup(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_CurrentGroup(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentGroup(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_SceneValid(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSceneValid(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_SceneValid(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSceneValid(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_NameSupport(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_NameSupport(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNameSupport(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Scenes_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Scenes_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ScenesCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Scenes +// Cluster SoftwareDiagnostics + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_ThreadMetrics(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeThreadMetrics(gSoftwareDiagnosticsThreadMetricsListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapFree(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentHeapFree(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_SoftwareDiagnostics_CurrentHeapFree(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentHeapFree(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapUsed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentHeapUsed(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_SoftwareDiagnostics_CurrentHeapUsed(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentHeapUsed(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_CurrentHeapHighWatermark(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentHeapHighWatermark(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_SoftwareDiagnostics_CurrentHeapHighWatermark(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentHeapHighWatermark(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_SoftwareDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_SoftwareDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SoftwareDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster SoftwareDiagnostics +// Cluster Switch + +chip::ChipError::StorageType chip_ime_ReadAttribute_Switch_NumberOfPositions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNumberOfPositions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Switch_NumberOfPositions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNumberOfPositions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Switch_CurrentPosition(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Switch_CurrentPosition(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPosition(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Switch_MultiPressMax(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMultiPressMax(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Switch_MultiPressMax(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMultiPressMax(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Switch_FeatureMap(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Switch_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Switch_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Switch_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::SwitchCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Switch +// Cluster TvChannel + +chip::ChipError::StorageType chip_ime_ReadAttribute_TvChannel_TvChannelList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeTvChannelList(gTvChannelTvChannelListListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TvChannel_TvChannelLineup(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTvChannelLineup(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TvChannel_TvChannelLineup(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTvChannelLineup(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TvChannel_CurrentTvChannel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentTvChannel(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TvChannel_CurrentTvChannel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentTvChannel(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TvChannel_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TvChannel_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TvChannelCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster TvChannel +// Cluster TargetNavigator + +chip::ChipError::StorageType chip_ime_ReadAttribute_TargetNavigator_TargetNavigatorList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TargetNavigatorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeTargetNavigatorList(gTargetNavigatorTargetNavigatorListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TargetNavigator_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TargetNavigatorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TargetNavigator_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TargetNavigatorCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster TargetNavigator +// Cluster TemperatureMeasurement + +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_MeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_MinMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_MaxMeasuredValue(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_Tolerance(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster TemperatureMeasurement +// Cluster TestCluster + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Boolean(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Boolean(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Bitmap8(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Bitmap8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Bitmap16(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Bitmap16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Bitmap32(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Bitmap32(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Bitmap64(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Bitmap64(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int8u(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int16u(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int16u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int32u(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int32u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int64u(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int64u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int8s(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int8s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int16s(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int16s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int32s(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int32s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Int64s(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Int64s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Enum8(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Enum8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Enum16(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Enum16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_OctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_OctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ListInt8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeListInt8u(gTestClusterListInt8uListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ListOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeListOctetString(gTestClusterListOctetStringListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ListStructOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeListStructOctetString(gTestClusterListStructOctetStringListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_LongOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLongOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_LongOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLongOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_CharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_CharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_LongCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLongCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_LongCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLongCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_EpochUs(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEpochUs(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_EpochUs(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEpochUs(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_EpochS(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEpochS(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_EpochS(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEpochS(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_VendorId(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_VendorId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeVendorId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ListNullablesAndOptionalsStruct(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeListNullablesAndOptionalsStruct(gTestClusterListNullablesAndOptionalsStructListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Unsupported(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeUnsupported(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_Unsupported(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeUnsupported(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBoolean(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableBoolean(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableBitmap8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableBitmap16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap32(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableBitmap32(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableBitmap64(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableBitmap64(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt8u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt16u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt16u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt32u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt32u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt64u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt64u(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt8s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt8s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt16s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt16s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt32s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt32s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableInt64s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableInt64s(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableEnum8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableEnum8(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableEnum16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableEnum16(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableOctetString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableOctetString(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_NullableCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNullableCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_NullableCharString(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNullableCharString(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TestCluster_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster TestCluster +// Cluster Thermostat + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_LocalTemperature(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLocalTemperature(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_LocalTemperature(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLocalTemperature(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_AbsMinHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAbsMinHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_AbsMinHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAbsMinHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_AbsMaxHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAbsMaxHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_AbsMaxHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAbsMaxHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_AbsMinCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAbsMinCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_AbsMinCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAbsMinCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_AbsMaxCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAbsMaxCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_AbsMaxCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAbsMaxCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupiedCoolingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_OccupiedCoolingSetpoint(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOccupiedCoolingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupiedHeatingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_OccupiedHeatingSetpoint(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOccupiedHeatingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MinHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_MinHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MaxHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_MaxHeatSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxHeatSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MinCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_MinCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MaxCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMaxCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_MaxCoolSetpointLimit(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMaxCoolSetpointLimit(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MinSetpointDeadBand(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinSetpointDeadBand(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_MinSetpointDeadBand(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMinSetpointDeadBand(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeControlSequenceOfOperation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_ControlSequenceOfOperation(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeControlSequenceOfOperation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_SystemMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSystemMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_SystemMode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSystemMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_StartOfWeek(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStartOfWeek(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_StartOfWeek(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStartOfWeek(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_NumberOfWeeklyTransitions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNumberOfWeeklyTransitions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_NumberOfWeeklyTransitions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNumberOfWeeklyTransitions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_NumberOfDailyTransitions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNumberOfDailyTransitions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_NumberOfDailyTransitions(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNumberOfDailyTransitions(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_Thermostat_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster Thermostat +// Cluster ThermostatUserInterfaceConfiguration + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThermostatUserInterfaceConfiguration_TemperatureDisplayMode( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTemperatureDisplayMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThermostatUserInterfaceConfiguration_TemperatureDisplayMode( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTemperatureDisplayMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThermostatUserInterfaceConfiguration_KeypadLockout( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeKeypadLockout(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThermostatUserInterfaceConfiguration_KeypadLockout( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeKeypadLockout(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThermostatUserInterfaceConfiguration_ScheduleProgrammingVisibility( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeScheduleProgrammingVisibility(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThermostatUserInterfaceConfiguration_ScheduleProgrammingVisibility( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeScheduleProgrammingVisibility(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThermostatUserInterfaceConfiguration_ClusterRevision( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThermostatUserInterfaceConfiguration_ClusterRevision( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatUserInterfaceConfigurationCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ThermostatUserInterfaceConfiguration +// Cluster ThreadNetworkDiagnostics + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Channel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeChannel(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_Channel(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeChannel(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RoutingRole(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRoutingRole(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RoutingRole(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRoutingRole(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_NetworkName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeNetworkName(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_NetworkName(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeNetworkName(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PanId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePanId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_PanId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePanId(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ExtendedPanId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeExtendedPanId(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ExtendedPanId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeExtendedPanId(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_MeshLocalPrefix(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMeshLocalPrefix(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_MeshLocalPrefix(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMeshLocalPrefix(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_NeighborTableList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeNeighborTableList(gThreadNetworkDiagnosticsNeighborTableListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RouteTableList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeRouteTableList(gThreadNetworkDiagnosticsRouteTableListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PartitionId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePartitionId(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_PartitionId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePartitionId(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Weighting(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeWeighting(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_Weighting(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeWeighting(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_DataVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_DataVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_StableDataVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeStableDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_StableDataVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeStableDataVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_LeaderRouterId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLeaderRouterId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_LeaderRouterId(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLeaderRouterId(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_DetachedRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDetachedRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_DetachedRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDetachedRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ChildRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeChildRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ChildRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeChildRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RouterRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRouterRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RouterRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRouterRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_LeaderRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLeaderRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_LeaderRoleCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeLeaderRoleCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_AttachAttemptCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeAttachAttemptCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_AttachAttemptCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeAttachAttemptCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PartitionIdChangeCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePartitionIdChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_PartitionIdChangeCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePartitionIdChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_BetterPartitionAttachAttemptCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeBetterPartitionAttachAttemptCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_BetterPartitionAttachAttemptCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBetterPartitionAttachAttemptCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ParentChangeCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeParentChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ParentChangeCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeParentChangeCount(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxTotalCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxTotalCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxUnicastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxUnicastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBroadcastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxBroadcastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxAckRequestedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxAckRequestedCount(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxAckedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxAckedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxAckedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxAckedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxNoAckRequestedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxNoAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxNoAckRequestedCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxNoAckRequestedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDataCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxDataCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDataPollCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxDataPollCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBeaconCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxBeaconCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxBeaconRequestCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxBeaconRequestCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxRetryCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxRetryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxRetryCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxRetryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxDirectMaxRetryExpiryCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxDirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxDirectMaxRetryExpiryCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxDirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxIndirectMaxRetryExpiryCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxIndirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxIndirectMaxRetryExpiryCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxIndirectMaxRetryExpiryCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrCcaCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxErrCcaCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxErrCcaCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxErrCcaCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrAbortCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxErrAbortCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxErrAbortCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxErrAbortCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_TxErrBusyChannelCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTxErrBusyChannelCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_TxErrBusyChannelCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTxErrBusyChannelCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxTotalCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxTotalCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxTotalCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxUnicastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxUnicastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxUnicastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBroadcastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxBroadcastCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxBroadcastCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDataCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxDataCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxDataCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDataPollCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxDataPollCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxDataPollCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBeaconCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxBeaconCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxBeaconCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxBeaconRequestCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxBeaconRequestCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxBeaconRequestCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxAddressFilteredCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxAddressFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxAddressFilteredCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxAddressFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDestAddrFilteredCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxDestAddrFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxDestAddrFilteredCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxDestAddrFilteredCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxDuplicatedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxDuplicatedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxDuplicatedCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxDuplicatedCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrNoFrameCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrNoFrameCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrNoFrameCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrNoFrameCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrUnknownNeighborCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrUnknownNeighborCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrUnknownNeighborCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrUnknownNeighborCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrInvalidSrcAddrCount(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrInvalidSrcAddrCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrInvalidSrcAddrCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrInvalidSrcAddrCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrSecCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrSecCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrSecCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrSecCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrFcsCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrFcsCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrFcsCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrFcsCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_RxErrOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRxErrOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_RxErrOtherCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRxErrOtherCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ActiveTimestamp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeActiveTimestamp(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ActiveTimestamp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeActiveTimestamp(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_PendingTimestamp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePendingTimestamp(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_PendingTimestamp(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePendingTimestamp(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Delay(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeDelay(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_Delay(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeDelay(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_SecurityPolicy(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeSecurityPolicy(gThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ChannelMask(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeChannelMask(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ChannelMask(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeChannelMask(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_OperationalDatasetComponents( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeOperationalDatasetComponents( + gThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ActiveNetworkFaultsList(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeActiveNetworkFaultsList(gThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback.Cancel(), + gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThreadNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster ThreadNetworkDiagnostics +// Cluster WakeOnLan + +chip::ChipError::StorageType chip_ime_ReadAttribute_WakeOnLan_WakeOnLanMacAddress(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WakeOnLanCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeWakeOnLanMacAddress(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WakeOnLan_WakeOnLanMacAddress(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WakeOnLanCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeWakeOnLanMacAddress(gCharStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WakeOnLan_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WakeOnLanCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WakeOnLan_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WakeOnLanCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster WakeOnLan +// Cluster WiFiNetworkDiagnostics + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_Bssid(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBssid(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_Bssid(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBssid(gOctetStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_SecurityType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSecurityType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_SecurityType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSecurityType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_WiFiVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeWiFiVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_WiFiVersion(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeWiFiVersion(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_ChannelNumber(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeChannelNumber(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_ChannelNumber(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeChannelNumber(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_Rssi(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeRssi(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_Rssi(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeRssi(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_BeaconLostCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBeaconLostCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_BeaconLostCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBeaconLostCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_BeaconRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBeaconRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_BeaconRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeBeaconRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_PacketMulticastRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketMulticastRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_PacketMulticastRxCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketMulticastRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_PacketMulticastTxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketMulticastTxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_PacketMulticastTxCount( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketMulticastTxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_PacketUnicastRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketUnicastRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_PacketUnicastRxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketUnicastRxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_PacketUnicastTxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributePacketUnicastTxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_PacketUnicastTxCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributePacketUnicastTxCount(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_CurrentMaxRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentMaxRate(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_CurrentMaxRate(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentMaxRate(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_OverrunCount(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOverrunCount(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WiFiNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WiFiNetworkDiagnostics_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WiFiNetworkDiagnosticsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster WiFiNetworkDiagnostics +// Cluster WindowCovering + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_Type(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_Type(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentPositionLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentPositionTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_ConfigStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeConfigStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_ConfigStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeConfigStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionLiftPercentage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentPositionLiftPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionLiftPercentage(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionLiftPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionTiltPercentage(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeCurrentPositionTiltPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType +chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionTiltPercentage(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionTiltPercentage(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_OperationalStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOperationalStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_OperationalStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeOperationalStatus(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_TargetPositionLiftPercent100ths(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTargetPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_TargetPositionLiftPercent100ths( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTargetPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_TargetPositionTiltPercent100ths(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTargetPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_TargetPositionTiltPercent100ths( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTargetPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_EndProductType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEndProductType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_EndProductType(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeEndProductType(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionLiftPercent100ths(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeCurrentPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionLiftPercent100ths( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionLiftPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_CurrentPositionTiltPercent100ths(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .ReadAttributeCurrentPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_CurrentPositionTiltPercent100ths( + chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeCurrentPositionTiltPercent100ths(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_InstalledOpenLimitLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInstalledOpenLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_InstalledOpenLimitLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInstalledOpenLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_InstalledClosedLimitLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInstalledClosedLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_InstalledClosedLimitLift(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInstalledClosedLimitLift(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_InstalledOpenLimitTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInstalledOpenLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_InstalledOpenLimitTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInstalledOpenLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_InstalledClosedLimitTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInstalledClosedLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_InstalledClosedLimitTilt(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeInstalledClosedLimitTilt(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), + minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_Mode(chip::DeviceProxy * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_Mode(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_SafetyStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_SafetyStatus(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeSafetyStatus(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_FeatureMap(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_ClusterRevision(chip::DeviceProxy * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, + maxInterval) + .AsInteger(); +} + +// End of Cluster WindowCovering +} diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index be67bbb15d09ef..2bec056d79a87c 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -657,91 +657,6 @@ class ChipClusters: "commands": { }, "attributes": { - 0x00000001: { - "attributeName": "VendorName", - "attributeId": 0x00000001, - "type": "str", - "reportable": True, - }, - 0x00000002: { - "attributeName": "VendorID", - "attributeId": 0x00000002, - "type": "int", - "reportable": True, - }, - 0x00000003: { - "attributeName": "ProductName", - "attributeId": 0x00000003, - "type": "str", - "reportable": True, - }, - 0x00000005: { - "attributeName": "NodeLabel", - "attributeId": 0x00000005, - "type": "str", - "reportable": True, - "writable": True, - }, - 0x00000007: { - "attributeName": "HardwareVersion", - "attributeId": 0x00000007, - "type": "int", - "reportable": True, - }, - 0x00000008: { - "attributeName": "HardwareVersionString", - "attributeId": 0x00000008, - "type": "str", - "reportable": True, - }, - 0x00000009: { - "attributeName": "SoftwareVersion", - "attributeId": 0x00000009, - "type": "int", - "reportable": True, - }, - 0x0000000A: { - "attributeName": "SoftwareVersionString", - "attributeId": 0x0000000A, - "type": "str", - "reportable": True, - }, - 0x0000000B: { - "attributeName": "ManufacturingDate", - "attributeId": 0x0000000B, - "type": "str", - "reportable": True, - }, - 0x0000000C: { - "attributeName": "PartNumber", - "attributeId": 0x0000000C, - "type": "str", - "reportable": True, - }, - 0x0000000D: { - "attributeName": "ProductURL", - "attributeId": 0x0000000D, - "type": "str", - "reportable": True, - }, - 0x0000000E: { - "attributeName": "ProductLabel", - "attributeId": 0x0000000E, - "type": "str", - "reportable": True, - }, - 0x0000000F: { - "attributeName": "SerialNumber", - "attributeId": 0x0000000F, - "type": "str", - "reportable": True, - }, - 0x00000011: { - "attributeName": "Reachable", - "attributeId": 0x00000011, - "type": "bool", - "reportable": True, - }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -3094,6 +3009,24 @@ class ChipClusters: }, }, } + _POWER_SOURCE_CONFIGURATION_CLUSTER_INFO = { + "clusterName": "PowerSourceConfiguration", + "clusterId": 0x0000002E, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "Sources", + "attributeId": 0x00000000, + "type": "int", + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + }, + }, + } _PRESSURE_MEASUREMENT_CLUSTER_INFO = { "clusterName": "PressureMeasurement", "clusterId": 0x00000403, @@ -5295,6 +5228,7 @@ class ChipClusters: 0x00000007: _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, 0x0000003E: _OPERATIONAL_CREDENTIALS_CLUSTER_INFO, 0x0000002F: _POWER_SOURCE_CLUSTER_INFO, + 0x0000002E: _POWER_SOURCE_CONFIGURATION_CLUSTER_INFO, 0x00000403: _PRESSURE_MEASUREMENT_CLUSTER_INFO, 0x00000200: _PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, 0x00000405: _RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_INFO, @@ -5355,6 +5289,7 @@ class ChipClusters: "OnOffSwitchConfiguration": _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, "OperationalCredentials": _OPERATIONAL_CREDENTIALS_CLUSTER_INFO, "PowerSource": _POWER_SOURCE_CLUSTER_INFO, + "PowerSourceConfiguration": _POWER_SOURCE_CONFIGURATION_CLUSTER_INFO, "PressureMeasurement": _PRESSURE_MEASUREMENT_CLUSTER_INFO, "PumpConfigurationAndControl": _PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, "RelativeHumidityMeasurement": _RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 652b05fd51b2d4..bea22788661c43 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -5949,6 +5949,22 @@ class PowerSourceConfiguration(Cluster): id: typing.ClassVar[int] = 0x002E class Attributes: + @dataclass + class Sources(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002E + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = None + @dataclass class FeatureMap(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 1aaa3e0c1ba4b6..d036e1cbf27f75 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -45,6 +45,7 @@ function asExpectedEndpointForCluster(clusterName) case 'TrustedRootCertificates': case 'OtaSoftwareUpdateProvider': case 'OtaSoftwareUpdateRequestor': + case 'PowerSourceConfiguration': return 0; } return 1; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 6622417c7e4743..4d90a0c2cf9d5c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -830,6 +830,26 @@ DispatchSuccess(context, objCValue); }; +void CHIPPowerSourceConfigurationSourcesListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + if (iter_0.GetStatus() != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + void CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value) diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index ecf7dc89dfcbf6..cabe08c01511a7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -744,6 +744,17 @@ class CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; +class CHIPPowerSourceConfigurationSourcesListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPPowerSourceConfigurationSourcesListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + class CHIPSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 0b3c8344d76804..15264926e1595c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -581,118 +581,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBridgedDeviceBasic : CHIPCluster -- (void)readAttributeVendorNameWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeVendorNameWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeVendorNameWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeVendorIDWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeVendorIDWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeVendorIDWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeProductNameWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeProductNameWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeProductNameWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeNodeLabelWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)subscribeAttributeNodeLabelWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeNodeLabelWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeHardwareVersionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeHardwareVersionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeHardwareVersionWithResponseHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))responseHandler; - -- (void)readAttributeHardwareVersionStringWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeHardwareVersionStringWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeHardwareVersionStringWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler; - -- (void)readAttributeSoftwareVersionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeSoftwareVersionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeSoftwareVersionWithResponseHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))responseHandler; - -- (void)readAttributeSoftwareVersionStringWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeSoftwareVersionStringWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeSoftwareVersionStringWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler; - -- (void)readAttributeManufacturingDateWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeManufacturingDateWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeManufacturingDateWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler; - -- (void)readAttributePartNumberWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributePartNumberWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributePartNumberWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeProductURLWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeProductURLWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeProductURLWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeProductLabelWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeProductLabelWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeProductLabelWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeSerialNumberWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeSerialNumberWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeSerialNumberWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler; - -- (void)readAttributeReachableWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeReachableWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler; -- (void)reportAttributeReachableWithResponseHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))responseHandler; - - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval @@ -2634,6 +2522,19 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Power Source Configuration + * + */ +@interface CHIPPowerSourceConfiguration : CHIPCluster + +- (void)readAttributeSourcesWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +@end + /** * Cluster Pressure Measurement * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 4ce736f57c8b43..98d018edcac12c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -2729,567 +2729,6 @@ @implementation CHIPBridgedDeviceBasic return &_cppCluster; } -- (void)readAttributeVendorNameWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::VendorName::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeVendorNameWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeVendorName(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeVendorNameWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeVendorName(success); - }, - true); -} - -- (void)readAttributeVendorIDWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPInt16uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::VendorID::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeVendorIDWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeVendorID(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeVendorIDWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPInt16uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeVendorID(success); - }, - true); -} - -- (void)readAttributeProductNameWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::ProductName::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeProductNameWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeProductName(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeProductNameWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeProductName(success); - }, - true); -} - -- (void)readAttributeNodeLabelWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeNodeLabelWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeNodeLabel(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeNodeLabelWithResponseHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeNodeLabel(success); - }, - true); -} - -- (void)readAttributeHardwareVersionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPInt16uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeHardwareVersionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeHardwareVersion(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeHardwareVersionWithResponseHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPInt16uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeHardwareVersion(success); - }, - true); -} - -- (void)readAttributeHardwareVersionStringWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeHardwareVersionStringWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeHardwareVersionString(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeHardwareVersionStringWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeHardwareVersionString(success); - }, - true); -} - -- (void)readAttributeSoftwareVersionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPInt32uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeSoftwareVersionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeSoftwareVersion(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeSoftwareVersionWithResponseHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPInt32uAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeSoftwareVersion(success); - }, - true); -} - -- (void)readAttributeSoftwareVersionStringWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeSoftwareVersionStringWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeSoftwareVersionString(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeSoftwareVersionStringWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeSoftwareVersionString(success); - }, - true); -} - -- (void)readAttributeManufacturingDateWithCompletionHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeManufacturingDateWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeManufacturingDate(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeManufacturingDateWithResponseHandler:(void (^)(NSString * _Nullable value, - NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeManufacturingDate(success); - }, - true); -} - -- (void)readAttributePartNumberWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributePartNumberWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributePartNumber(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributePartNumberWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributePartNumber(success); - }, - true); -} - -- (void)readAttributeProductURLWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeProductURLWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeProductURL(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeProductURLWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeProductURL(success); - }, - true); -} - -- (void)readAttributeProductLabelWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeProductLabelWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeProductLabel(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeProductLabelWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeProductLabel(success); - }, - true); -} - -- (void)readAttributeSerialNumberWithCompletionHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeSerialNumberWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeSerialNumber(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeSerialNumberWithResponseHandler:(void (^)( - NSString * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPCharStringAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeSerialNumber(success); - }, - true); -} - -- (void)readAttributeReachableWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPBooleanAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - completionHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = BridgedDeviceBasic::Attributes::Reachable::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeReachableWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - responseHandler:(ResponseHandler)responseHandler -{ - new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.SubscribeAttributeReachable(success, failure, minInterval, maxInterval); - }); -} - -- (void)reportAttributeReachableWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler -{ - new CHIPBooleanAttributeCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable value) { - responseHandler(value, error); - }, - ^(Cancelable * success, Cancelable * failure) { - return self.cppCluster.ReportAttributeReachable(success); - }, - true); -} - - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -13453,6 +12892,46 @@ new CHIPInt16uAttributeCallbackBridge( @end +@implementation CHIPPowerSourceConfiguration + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)readAttributeSourcesWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceConfigurationSourcesListAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSourceConfiguration::Attributes::Sources::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + @implementation CHIPPressureMeasurement - (chip::Controller::ClusterBase *)getCluster diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h index 81c2739f0e451f..1ef8001ef4dee5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h @@ -185,6 +185,10 @@ @property (readonly) chip::Controller::PowerSourceCluster cppCluster; @end +@interface CHIPPowerSourceConfiguration () +@property (readonly) chip::Controller::PowerSourceConfigurationCluster cppCluster; +@end + @interface CHIPPressureMeasurement () @property (readonly) chip::Controller::PressureMeasurementCluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index aca21a7a489f5d..fa73c746f6750b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -180,21 +180,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestBridgedDeviceBasic : CHIPBridgedDeviceBasic -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -638,6 +623,17 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Power Source Configuration + * + */ +@interface CHIPTestPowerSourceConfiguration : CHIPPowerSourceConfiguration + +- (void)writeAttributeSourcesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; + +@end + /** * Cluster Pressure Measurement * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index d4fcab97b05ac8..251d7373f573cc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -1178,242 +1178,6 @@ @implementation CHIPTestBridgedDeviceBasic return &_cppCluster; } -- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorID::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductName::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; - TypeInfo::Type cppValue; - cppValue = [self asCharSpan:value]; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(NSError * _Nullable error, id _Nullable ignored) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = BridgedDeviceBasic::Attributes::Reachable::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.boolValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -5284,6 +5048,76 @@ new CHIPDefaultSuccessCallbackBridge( @end +@interface CHIPTestPowerSourceConfiguration () +@property (readonly) chip::Controller::PowerSourceConfigurationClusterTest cppCluster; +@end + +@implementation CHIPTestPowerSourceConfiguration + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributeSourcesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSourceConfiguration::Attributes::Sources::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + @interface CHIPTestPressureMeasurement () @property (readonly) chip::Controller::PressureMeasurementClusterTest cppCluster; @end diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 791268d6715d06..b0651e928b5998 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -29781,25 +29781,26 @@ - (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue count], 18); + XCTAssertEqual([actualValue count], 19); XCTAssertEqual([actualValue[0] unsignedIntValue], 3UL); XCTAssertEqual([actualValue[1] unsignedIntValue], 29UL); XCTAssertEqual([actualValue[2] unsignedIntValue], 40UL); XCTAssertEqual([actualValue[3] unsignedIntValue], 41UL); XCTAssertEqual([actualValue[4] unsignedIntValue], 42UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 48UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 49UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 50UL); - XCTAssertEqual([actualValue[8] unsignedIntValue], 51UL); - XCTAssertEqual([actualValue[9] unsignedIntValue], 52UL); - XCTAssertEqual([actualValue[10] unsignedIntValue], 53UL); - XCTAssertEqual([actualValue[11] unsignedIntValue], 54UL); - XCTAssertEqual([actualValue[12] unsignedIntValue], 55UL); - XCTAssertEqual([actualValue[13] unsignedIntValue], 60UL); - XCTAssertEqual([actualValue[14] unsignedIntValue], 62UL); - XCTAssertEqual([actualValue[15] unsignedIntValue], 1029UL); - XCTAssertEqual([actualValue[16] unsignedIntValue], 61440UL); - XCTAssertEqual([actualValue[17] unsignedIntValue], 61444UL); + XCTAssertEqual([actualValue[5] unsignedIntValue], 46UL); + XCTAssertEqual([actualValue[6] unsignedIntValue], 48UL); + XCTAssertEqual([actualValue[7] unsignedIntValue], 49UL); + XCTAssertEqual([actualValue[8] unsignedIntValue], 50UL); + XCTAssertEqual([actualValue[9] unsignedIntValue], 51UL); + XCTAssertEqual([actualValue[10] unsignedIntValue], 52UL); + XCTAssertEqual([actualValue[11] unsignedIntValue], 53UL); + XCTAssertEqual([actualValue[12] unsignedIntValue], 54UL); + XCTAssertEqual([actualValue[13] unsignedIntValue], 55UL); + XCTAssertEqual([actualValue[14] unsignedIntValue], 60UL); + XCTAssertEqual([actualValue[15] unsignedIntValue], 62UL); + XCTAssertEqual([actualValue[16] unsignedIntValue], 1029UL); + XCTAssertEqual([actualValue[17] unsignedIntValue], 61440UL); + XCTAssertEqual([actualValue[18] unsignedIntValue], 61444UL); } [expectation fulfill]; @@ -32374,381 +32375,6 @@ - (void)testSendClusterBridgedActionsReadAttributeClusterRevisionWithCompletionH [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorNameWithCompletionHandler"]; - - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeVendorIDWithCompletionHandler"]; - - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic VendorID Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductNameWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductNameWithCompletionHandler"]; - - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductName Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeNodeLabelWithCompletionHandler"]; - - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicWriteAttributeNodeLabelWithValue -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"BridgedDeviceBasicWriteAttributeNodeLabelWithValue"]; - - NSString * _Nonnull value = @"Test"; - [cluster writeAttributeNodeLabelWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic NodeLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeHardwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic HardwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersion Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSoftwareVersionStringWithCompletionHandler"]; - - [cluster readAttributeSoftwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SoftwareVersionString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeManufacturingDateWithCompletionHandler"]; - - [cluster readAttributeManufacturingDateWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ManufacturingDate Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributePartNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributePartNumberWithCompletionHandler"]; - - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic PartNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductURLWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductURLWithCompletionHandler"]; - - [cluster readAttributeProductURLWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductURL Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeProductLabelWithCompletionHandler"]; - - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic ProductLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeSerialNumberWithCompletionHandler"]; - - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic SerialNumber Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterBridgedDeviceBasicReadAttributeReachableWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPBridgedDeviceBasic * cluster = [[CHIPBridgedDeviceBasic alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"BridgedDeviceBasicReadAttributeReachableWithCompletionHandler"]; - - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"BridgedDeviceBasic Reachable Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterBridgedDeviceBasicReadAttributeClusterRevisionWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -38288,6 +37914,56 @@ - (void)testSendClusterPowerSourceReadAttributeClusterRevisionWithCompletionHand [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterPowerSourceConfigurationReadAttributeSourcesWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeSourcesWithCompletionHandler"]; + + [cluster readAttributeSourcesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"PowerSourceConfiguration Sources Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterPowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPPowerSourceConfiguration * cluster = [[CHIPPowerSourceConfiguration alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"PowerSourceConfigurationReadAttributeClusterRevisionWithCompletionHandler"]; + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"PowerSourceConfiguration ClusterRevision Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterPressureMeasurementReadAttributeMeasuredValueWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); diff --git a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h index 89859ac5ae2dee..3f5c36cce8e594 100644 --- a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h @@ -64,6 +64,7 @@ MatterOnOffSwitchConfigurationPluginServerInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterPowerSourcePluginServerInitCallback(); \ + MatterPowerSourceConfigurationPluginServerInitCallback(); \ MatterPressureMeasurementPluginServerInitCallback(); \ MatterPumpConfigurationAndControlPluginServerInitCallback(); \ MatterRelativeHumidityMeasurementPluginServerInitCallback(); \ diff --git a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp index 53216da4432b3c..c895a1b465d390 100644 --- a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp @@ -690,6 +690,26 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x002E: // Power Source Configuration Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // Sources + { + entryLength = 1; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + copyListMember(dest, src, write, &entryOffset, entryLength); // INT8U + break; + } + } + break; + } case 0x0034: // Software Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -1283,6 +1303,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x002E: // Power Source Configuration Cluster + switch (attributeId) + { + case 0x0000: // Sources + // uint8_t + entryLength = 1; + break; + } + break; case 0x0034: // Software Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp index 52cf5b95692ef1..9add63fa52704c 100644 --- a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp @@ -155,6 +155,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_POWER_SOURCE_CLUSTER_ID: emberAfPowerSourceClusterInitCallback(endpoint); break; + case ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID: + emberAfPowerSourceConfigurationClusterInitCallback(endpoint); + break; case ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID: emberAfPressureMeasurementClusterInitCallback(endpoint); break; @@ -419,6 +422,11 @@ void __attribute__((weak)) emberAfPowerSourceClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfPowerSourceConfigurationClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfPressureMeasurementClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 07b38ca460f077..cf8f6e7501d4b3 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -320,21 +320,16 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* 1144 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ - \ - /* 1148 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 1152 - FeatureMap, */ \ + /* 1148 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 1156 - label list, */ \ + /* 1152 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -352,46 +347,46 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 1410 - Description, */ \ + /* 1406 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1417 - AutoRelockTime, */ \ + /* 1413 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 1421 - FeatureMap, */ \ + /* 1417 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 1425 - LifetimeRunningHours, */ \ + /* 1421 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1428 - Power, */ \ + /* 1424 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1431 - LifetimeEnergyConsumed, */ \ + /* 1427 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1435 - FeatureMap, */ \ + /* 1431 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1439 - FeatureMap, */ \ + /* 1435 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1443 - IAS CIE address, */ \ + /* 1439 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 1451 - tv channel list, */ \ + /* 1447 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -409,7 +404,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1705 - target navigator list, */ \ + /* 1701 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -427,30 +422,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1959 - start time, */ \ + /* 1955 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1967 - duration, */ \ + /* 1963 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1975 - position updated at, */ \ + /* 1971 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1983 - position, */ \ + /* 1979 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1991 - playback speed, */ \ + /* 1987 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1999 - seek range end, */ \ + /* 1995 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2007 - seek range start, */ \ + /* 2003 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 2015 - media input list, */ \ + /* 2011 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -468,7 +463,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2269 - accepts header list, */ \ + /* 2265 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -484,7 +479,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2523 - supported streaming types, */ \ + /* 2519 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -502,7 +497,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2777 - audio output list, */ \ + /* 2773 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -520,7 +515,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 3031 - application launcher list, */ \ + /* 3027 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -538,119 +533,119 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 3285 - bitmap32, */ \ + /* 3281 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3289 - bitmap64, */ \ + /* 3285 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3297 - int24u, */ \ + /* 3293 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3300 - int32u, */ \ + /* 3296 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3304 - int40u, */ \ + /* 3300 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3309 - int48u, */ \ + /* 3305 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3315 - int56u, */ \ + /* 3311 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3322 - int64u, */ \ + /* 3318 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3330 - int24s, */ \ + /* 3326 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3333 - int32s, */ \ + /* 3329 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3337 - int40s, */ \ + /* 3333 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3342 - int48s, */ \ + /* 3338 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3348 - int56s, */ \ + /* 3344 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3355 - int64s, */ \ + /* 3351 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3363 - float_single, */ \ + /* 3359 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3367 - float_double, */ \ + /* 3363 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3375 - epoch_us, */ \ + /* 3371 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3383 - epoch_s, */ \ + /* 3379 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3387 - nullable_bitmap32, */ \ + /* 3383 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3391 - nullable_bitmap64, */ \ + /* 3387 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3399 - nullable_int24u, */ \ + /* 3395 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3402 - nullable_int32u, */ \ + /* 3398 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3406 - nullable_int40u, */ \ + /* 3402 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3411 - nullable_int48u, */ \ + /* 3407 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3417 - nullable_int56u, */ \ + /* 3413 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3424 - nullable_int64u, */ \ + /* 3420 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3432 - nullable_int24s, */ \ + /* 3428 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3435 - nullable_int32s, */ \ + /* 3431 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3439 - nullable_int40s, */ \ + /* 3435 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3444 - nullable_int48s, */ \ + /* 3440 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3450 - nullable_int56s, */ \ + /* 3446 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3457 - nullable_int64s, */ \ + /* 3453 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3465 - nullable_float_single, */ \ + /* 3461 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3469 - nullable_float_double, */ \ + /* 3465 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 3477 - measurement type, */ \ + /* 3473 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3481 - total active power, */ \ + /* 3477 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 3485 - FeatureMap, */ \ + /* 3481 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -951,21 +946,16 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* 1144 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ - \ - /* 1148 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 1152 - FeatureMap, */ \ + /* 1148 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 1156 - label list, */ \ + /* 1152 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -983,46 +973,46 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 1410 - Description, */ \ + /* 1406 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1417 - AutoRelockTime, */ \ + /* 1413 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 1421 - FeatureMap, */ \ + /* 1417 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 1425 - LifetimeRunningHours, */ \ + /* 1421 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1428 - Power, */ \ + /* 1424 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1431 - LifetimeEnergyConsumed, */ \ + /* 1427 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1435 - FeatureMap, */ \ + /* 1431 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1439 - FeatureMap, */ \ + /* 1435 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1443 - IAS CIE address, */ \ + /* 1439 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 1451 - tv channel list, */ \ + /* 1447 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1040,7 +1030,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1705 - target navigator list, */ \ + /* 1701 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1058,30 +1048,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1959 - start time, */ \ + /* 1955 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1967 - duration, */ \ + /* 1963 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1975 - position updated at, */ \ + /* 1971 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1983 - position, */ \ + /* 1979 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1991 - playback speed, */ \ + /* 1987 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1999 - seek range end, */ \ + /* 1995 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2007 - seek range start, */ \ + /* 2003 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 2015 - media input list, */ \ + /* 2011 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1099,7 +1089,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2269 - accepts header list, */ \ + /* 2265 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1115,7 +1105,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2523 - supported streaming types, */ \ + /* 2519 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1133,7 +1123,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2777 - audio output list, */ \ + /* 2773 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1151,7 +1141,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 3031 - application launcher list, */ \ + /* 3027 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1169,125 +1159,125 @@ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 3285 - bitmap32, */ \ + /* 3281 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3289 - bitmap64, */ \ + /* 3285 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3297 - int24u, */ \ + /* 3293 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3300 - int32u, */ \ + /* 3296 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3304 - int40u, */ \ + /* 3300 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3309 - int48u, */ \ + /* 3305 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3315 - int56u, */ \ + /* 3311 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3322 - int64u, */ \ + /* 3318 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3330 - int24s, */ \ + /* 3326 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3333 - int32s, */ \ + /* 3329 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3337 - int40s, */ \ + /* 3333 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3342 - int48s, */ \ + /* 3338 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3348 - int56s, */ \ + /* 3344 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3355 - int64s, */ \ + /* 3351 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3363 - float_single, */ \ + /* 3359 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3367 - float_double, */ \ + /* 3363 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3375 - epoch_us, */ \ + /* 3371 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3383 - epoch_s, */ \ + /* 3379 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3387 - nullable_bitmap32, */ \ + /* 3383 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3391 - nullable_bitmap64, */ \ + /* 3387 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3399 - nullable_int24u, */ \ + /* 3395 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3402 - nullable_int32u, */ \ + /* 3398 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3406 - nullable_int40u, */ \ + /* 3402 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3411 - nullable_int48u, */ \ + /* 3407 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3417 - nullable_int56u, */ \ + /* 3413 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3424 - nullable_int64u, */ \ + /* 3420 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3432 - nullable_int24s, */ \ + /* 3428 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3435 - nullable_int32s, */ \ + /* 3431 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3439 - nullable_int40s, */ \ + /* 3435 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3444 - nullable_int48s, */ \ + /* 3440 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3450 - nullable_int56s, */ \ + /* 3446 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3457 - nullable_int64s, */ \ + /* 3453 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3465 - nullable_float_single, */ \ + /* 3461 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3469 - nullable_float_double, */ \ + /* 3465 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 3477 - measurement type, */ \ + /* 3473 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3481 - total active power, */ \ + /* 3477 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 3485 - FeatureMap, */ \ + /* 3481 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (141) +#define GENERATED_DEFAULTS_COUNT (140) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1377,7 +1367,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 568 +#define GENERATED_ATTRIBUTE_COUNT 556 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1427,6 +1417,10 @@ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* default ota provider */ \ { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Sources */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ @@ -1677,32 +1671,17 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorID */ \ - { 0x0003, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductName */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* NodeLabel */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* HardwareVersion */ \ - { 0x0008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_LONG_DEFAULTS_INDEX(1148) }, /* SoftwareVersion */ \ - { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ - { 0x000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ - { 0x000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* PartNumber */ \ - { 0x000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductURL */ \ - { 0x000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductLabel */ \ - { 0x000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SerialNumber */ \ - { 0x0011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0x00) }, /* Reachable */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1152) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1148) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1156) }, /* label list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1152) }, /* label list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ @@ -1714,7 +1693,7 @@ { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* SupportedModes */ \ { 0x0002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1410) }, /* Description */ \ + { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1406) }, /* Description */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -1722,7 +1701,7 @@ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0) }, /* NumberOfLogRecordsSupported */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1417) }, /* AutoRelockTime */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1413) }, /* AutoRelockTime */ \ { 0x0025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* OperatingMode */ \ { 0x0026, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFF6) }, /* SupportedOperatingModes */ \ @@ -1748,7 +1727,7 @@ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* Mode */ \ { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1421) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1417) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ @@ -1778,16 +1757,16 @@ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1425) }, /* LifetimeRunningHours */ \ - { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1428) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(1421) }, /* LifetimeRunningHours */ \ + { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1424) }, /* Power */ \ { 0x0017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1431) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(1427) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(7) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(8) }, /* ControlMode */ \ { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1435) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1431) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -1817,7 +1796,7 @@ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1439) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1435) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -1938,7 +1917,7 @@ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1443) }, /* IAS CIE address */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1439) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1947,28 +1926,28 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1451) }, /* tv channel list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1447) }, /* tv channel list */ \ { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* tv channel lineup */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1705) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1701) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1959) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1967) }, /* duration */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1975) }, /* position updated at */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1983) }, /* position */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1991) }, /* playback speed */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1999) }, /* seek range end */ \ - { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2007) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1955) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1963) }, /* duration */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1971) }, /* position updated at */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1979) }, /* position */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1987) }, /* playback speed */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1995) }, /* seek range end */ \ + { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2003) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2015) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2011) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1979,17 +1958,17 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2269) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2523) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2265) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2519) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2777) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2773) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3031) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3027) }, /* application launcher list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -2011,28 +1990,28 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3285) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3289) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3281) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3285) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3297) }, /* int24u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3300) }, /* int32u */ \ - { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3304) }, /* int40u */ \ - { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3309) }, /* int48u */ \ - { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3315) }, /* int56u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3322) }, /* int64u */ \ + { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3293) }, /* int24u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3296) }, /* int32u */ \ + { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3300) }, /* int40u */ \ + { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3305) }, /* int48u */ \ + { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3311) }, /* int56u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3318) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3330) }, /* int24s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3333) }, /* int32s */ \ - { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3337) }, /* int40s */ \ - { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3342) }, /* int48s */ \ - { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3348) }, /* int56s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3355) }, /* int64s */ \ + { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3326) }, /* int24s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3329) }, /* int32s */ \ + { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3333) }, /* int40s */ \ + { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3338) }, /* int48s */ \ + { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3344) }, /* int56s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3351) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3363) }, /* float_single */ \ - { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3367) }, /* float_double */ \ + { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3359) }, /* float_single */ \ + { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3363) }, /* float_double */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -2045,8 +2024,8 @@ { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3375) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3383) }, /* epoch_s */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3371) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3379) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x0023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -2070,49 +2049,49 @@ { 0x8002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x8003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3387) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(3383) }, /* nullable_bitmap32 */ \ { 0x8004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3391) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(3387) }, /* nullable_bitmap64 */ \ { 0x8005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x8006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x8007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3399) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(3395) }, /* nullable_int24u */ \ { 0x8008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3402) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(3398) }, /* nullable_int32u */ \ { 0x8009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3406) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(3402) }, /* nullable_int40u */ \ { 0x800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3411) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(3407) }, /* nullable_int48u */ \ { 0x800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3417) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(3413) }, /* nullable_int56u */ \ { 0x800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3424) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(3420) }, /* nullable_int64u */ \ { 0x800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3432) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(3428) }, /* nullable_int24s */ \ { 0x8010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3435) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(3431) }, /* nullable_int32s */ \ { 0x8011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3439) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(3435) }, /* nullable_int40s */ \ { 0x8012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3444) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(3440) }, /* nullable_int48s */ \ { 0x8013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3450) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(3446) }, /* nullable_int56s */ \ { 0x8014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3457) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(3453) }, /* nullable_int64s */ \ { 0x8015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x8016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x8017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3465) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(3461) }, /* nullable_float_single */ \ { 0x8018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3469) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(3465) }, /* nullable_float_double */ \ { 0x8019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2137,8 +2116,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3477) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3481) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3473) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3477) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2159,7 +2138,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3485) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3481) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2223,7 +2202,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 65 +#define GENERATED_CLUSTER_COUNT 66 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -2248,225 +2227,228 @@ 0x002A, ZAP_ATTRIBUTE_INDEX(29), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(32), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(32), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ + { \ + 0x0030, ZAP_ATTRIBUTE_INDEX(34), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(38), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(40), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(40), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(42), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(40), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(42), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(49), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(51), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(55), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(57), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(120), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(122), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(135), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(137), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(146), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(148), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(147), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(149), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(153), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(155), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(157), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(159), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(158), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(160), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(161), \ + ZAP_ATTRIBUTE_INDEX(163), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(164), \ + ZAP_ATTRIBUTE_INDEX(166), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(166), \ + ZAP_ATTRIBUTE_INDEX(168), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(172), \ + ZAP_ATTRIBUTE_INDEX(174), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(179), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(181), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(182), \ + ZAP_ATTRIBUTE_INDEX(184), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(197), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(199), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(201), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(203), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(206), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0025, ZAP_ATTRIBUTE_INDEX(208), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(210), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(212), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(221), 15, 646, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(223), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(236), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(224), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(241), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(229), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(243), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(231), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(245), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(233), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(251), \ + ZAP_ATTRIBUTE_INDEX(239), \ 8, \ 14, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(259), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(247), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(279), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(267), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(284), \ + ZAP_ATTRIBUTE_INDEX(272), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(310), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(298), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(329), \ + ZAP_ATTRIBUTE_INDEX(317), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(333), \ + ZAP_ATTRIBUTE_INDEX(321), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(386), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(374), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(392), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(380), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(397), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(385), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(401), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(389), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(406), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(394), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(411), \ + ZAP_ATTRIBUTE_INDEX(399), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(415), \ + ZAP_ATTRIBUTE_INDEX(403), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(421), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(409), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(423), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(411), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(427), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(415), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(429), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(417), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(438), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(426), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(441), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(429), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(442), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(430), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(443), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(431), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(446), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(434), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(449), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(437), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(453), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(441), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(461), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(449), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(462), 77, 2285, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(450), 77, 2285, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(539), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(527), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(551), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(539), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(552), \ + ZAP_ATTRIBUTE_INDEX(540), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(559), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(547), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(564), \ + ZAP_ATTRIBUTE_INDEX(552), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2478,17 +2460,17 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 1925 }, { ZAP_CLUSTER_INDEX(18), 44, 6044 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 19, 1927 }, { ZAP_CLUSTER_INDEX(19), 44, 5400 }, { ZAP_CLUSTER_INDEX(63), 3, 18 }, \ } // Largest attribute size is needed for various buffers #define ATTRIBUTE_LARGEST (1003) // Total size of singleton attributes -#define ATTRIBUTE_SINGLETONS_SIZE (1333) +#define ATTRIBUTE_SINGLETONS_SIZE (689) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7987) +#define ATTRIBUTE_MAX_SIZE (7345) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/all-clusters-app/zap-generated/gen_config.h b/zzz_generated/all-clusters-app/zap-generated/gen_config.h index 84dbd77bcf5134..b2da54d083c4c7 100644 --- a/zzz_generated/all-clusters-app/zap-generated/gen_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/gen_config.h @@ -71,6 +71,7 @@ #define EMBER_AF_ON_OFF_SWITCH_CONFIG_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_PRESSURE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_PUMP_CONFIG_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (2) @@ -310,6 +311,11 @@ #define EMBER_AF_PLUGIN_POWER_SOURCE_SERVER #define EMBER_AF_PLUGIN_POWER_SOURCE +// Use this macro to check if the server side of the Power Source Configuration cluster is included +#define ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE_CONFIGURATION_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE_CONFIGURATION + // Use this macro to check if the server side of the Pressure Measurement cluster is included #define ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_SERVER #define EMBER_AF_PLUGIN_PRESSURE_MEASUREMENT_SERVER diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index e1ba4b54913edb..1f3a6ba93ab379 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -322,6 +322,7 @@ // Client attributes // Server attributes +#define ZCL_SOURCES_ATTRIBUTE_ID (0x0000) // Attribute ids for cluster: Power Source diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 0e0d213a00f24b..a8e0ffb86d941f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -4706,6 +4706,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) } // namespace Attributes } // namespace OtaSoftwareUpdateRequestor +namespace PowerSourceConfiguration { +namespace Attributes { + +} // namespace Attributes +} // namespace PowerSourceConfiguration + namespace PowerSource { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 8bc3b866bf7de8..e571c62eadbe97 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -913,6 +913,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Attributes } // namespace OtaSoftwareUpdateRequestor +namespace PowerSourceConfiguration { +namespace Attributes { + +} // namespace Attributes +} // namespace PowerSourceConfiguration + namespace PowerSource { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 777fbb9d196d0e..90408879629d8c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -7815,6 +7815,18 @@ struct TypeInfo namespace PowerSourceConfiguration { namespace Attributes { +namespace Sources { +struct TypeInfo +{ + using Type = DataModel::List; + using DecodableType = DataModel::DecodableList; + using DecodableArgType = const DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::PowerSourceConfiguration::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Sources::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Sources namespace FeatureMap { struct TypeInfo { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 7460f124e21a43..63286642c6bc6c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -986,6 +986,10 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace PowerSourceConfiguration { namespace Attributes { +namespace Sources { +static constexpr AttributeId Id = 0x00000000; +} // namespace Sources + namespace FeatureMap { static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; } // namespace FeatureMap diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 0776c0e40c18a9..f9b7b99da73e7e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -2543,6 +2543,15 @@ static void OnPowerSourceActiveBatteryFaultsListAttributeResponse(void * context command->SetCommandExitStatus(err); } +static void OnPowerSourceConfigurationSourcesListAttributeResponse(void * context, + const chip::app::DataModel::DecodableList & list) +{ + CHIP_ERROR err = LogValue("OnPowerSourceConfigurationSourcesListAttributeResponse", 0, list); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +} + static void OnSoftwareDiagnosticsThreadMetricsListAttributeResponse( void * context, const chip::app::DataModel::DecodableList & @@ -3924,6 +3933,7 @@ static void OnTestClusterTestSpecificResponseSuccess( | OnOffSwitchConfiguration | 0x0007 | | OperationalCredentials | 0x003E | | PowerSource | 0x002F | +| PowerSourceConfiguration | 0x002E | | PressureMeasurement | 0x0403 | | PumpConfigurationAndControl | 0x0200 | | RelativeHumidityMeasurement | 0x0405 | @@ -9237,1263 +9247,9 @@ class ReportBridgedActionsClusterRevision : public ModelCommand | Commands: | | |------------------------------------------------------------------------------| | Attributes: | | -| * VendorName | 0x0001 | -| * VendorID | 0x0002 | -| * ProductName | 0x0003 | -| * NodeLabel | 0x0005 | -| * HardwareVersion | 0x0007 | -| * HardwareVersionString | 0x0008 | -| * SoftwareVersion | 0x0009 | -| * SoftwareVersionString | 0x000A | -| * ManufacturingDate | 0x000B | -| * PartNumber | 0x000C | -| * ProductURL | 0x000D | -| * ProductLabel | 0x000E | -| * SerialNumber | 0x000F | -| * Reachable | 0x0011 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -/* - * Attribute VendorName - */ -class ReadBridgedDeviceBasicVendorName : public ModelCommand -{ -public: - ReadBridgedDeviceBasicVendorName() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-name"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicVendorName() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicVendorName : public ModelCommand -{ -public: - ReportBridgedDeviceBasicVendorName() : ModelCommand("report") - { - AddArgument("attr-name", "vendor-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicVendorName() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeVendorName(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeVendorName(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute VendorID - */ -class ReadBridgedDeviceBasicVendorID : public ModelCommand -{ -public: - ReadBridgedDeviceBasicVendorID() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-id"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicVendorID() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicVendorID : public ModelCommand -{ -public: - ReportBridgedDeviceBasicVendorID() : ModelCommand("report") - { - AddArgument("attr-name", "vendor-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicVendorID() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeVendorID(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeVendorID(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt16uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductName - */ -class ReadBridgedDeviceBasicProductName : public ModelCommand -{ -public: - ReadBridgedDeviceBasicProductName() : ModelCommand("read") - { - AddArgument("attr-name", "product-name"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicProductName() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicProductName : public ModelCommand -{ -public: - ReportBridgedDeviceBasicProductName() : ModelCommand("report") - { - AddArgument("attr-name", "product-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicProductName() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeProductName(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeProductName(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NodeLabel - */ -class ReadBridgedDeviceBasicNodeLabel : public ModelCommand -{ -public: - ReadBridgedDeviceBasicNodeLabel() : ModelCommand("read") - { - AddArgument("attr-name", "node-label"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicNodeLabel() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeNodeLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class WriteBridgedDeviceBasicNodeLabel : public ModelCommand -{ -public: - WriteBridgedDeviceBasicNodeLabel() : ModelCommand("write") - { - AddArgument("attr-name", "node-label"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBridgedDeviceBasicNodeLabel() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x01) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttributeNodeLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::CharSpan mValue; -}; - -class ReportBridgedDeviceBasicNodeLabel : public ModelCommand -{ -public: - ReportBridgedDeviceBasicNodeLabel() : ModelCommand("report") - { - AddArgument("attr-name", "node-label"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicNodeLabel() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeNodeLabel(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeNodeLabel(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute HardwareVersion - */ -class ReadBridgedDeviceBasicHardwareVersion : public ModelCommand -{ -public: - ReadBridgedDeviceBasicHardwareVersion() : ModelCommand("read") - { - AddArgument("attr-name", "hardware-version"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicHardwareVersion() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicHardwareVersion : public ModelCommand -{ -public: - ReportBridgedDeviceBasicHardwareVersion() : ModelCommand("report") - { - AddArgument("attr-name", "hardware-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicHardwareVersion() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeHardwareVersion(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeHardwareVersion(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt16uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute HardwareVersionString - */ -class ReadBridgedDeviceBasicHardwareVersionString : public ModelCommand -{ -public: - ReadBridgedDeviceBasicHardwareVersionString() : ModelCommand("read") - { - AddArgument("attr-name", "hardware-version-string"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicHardwareVersionString() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicHardwareVersionString : public ModelCommand -{ -public: - ReportBridgedDeviceBasicHardwareVersionString() : ModelCommand("report") - { - AddArgument("attr-name", "hardware-version-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicHardwareVersionString() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeHardwareVersionString(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeHardwareVersionString(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SoftwareVersion - */ -class ReadBridgedDeviceBasicSoftwareVersion : public ModelCommand -{ -public: - ReadBridgedDeviceBasicSoftwareVersion() : ModelCommand("read") - { - AddArgument("attr-name", "software-version"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicSoftwareVersion() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt32uAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicSoftwareVersion : public ModelCommand -{ -public: - ReportBridgedDeviceBasicSoftwareVersion() : ModelCommand("report") - { - AddArgument("attr-name", "software-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicSoftwareVersion() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeSoftwareVersion(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeSoftwareVersion(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt32uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SoftwareVersionString - */ -class ReadBridgedDeviceBasicSoftwareVersionString : public ModelCommand -{ -public: - ReadBridgedDeviceBasicSoftwareVersionString() : ModelCommand("read") - { - AddArgument("attr-name", "software-version-string"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicSoftwareVersionString() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicSoftwareVersionString : public ModelCommand -{ -public: - ReportBridgedDeviceBasicSoftwareVersionString() : ModelCommand("report") - { - AddArgument("attr-name", "software-version-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicSoftwareVersionString() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeSoftwareVersionString(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeSoftwareVersionString(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ManufacturingDate - */ -class ReadBridgedDeviceBasicManufacturingDate : public ModelCommand -{ -public: - ReadBridgedDeviceBasicManufacturingDate() : ModelCommand("read") - { - AddArgument("attr-name", "manufacturing-date"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicManufacturingDate() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeManufacturingDate(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicManufacturingDate : public ModelCommand -{ -public: - ReportBridgedDeviceBasicManufacturingDate() : ModelCommand("report") - { - AddArgument("attr-name", "manufacturing-date"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicManufacturingDate() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeManufacturingDate(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeManufacturingDate(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PartNumber - */ -class ReadBridgedDeviceBasicPartNumber : public ModelCommand -{ -public: - ReadBridgedDeviceBasicPartNumber() : ModelCommand("read") - { - AddArgument("attr-name", "part-number"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicPartNumber() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributePartNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicPartNumber : public ModelCommand -{ -public: - ReportBridgedDeviceBasicPartNumber() : ModelCommand("report") - { - AddArgument("attr-name", "part-number"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicPartNumber() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributePartNumber(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributePartNumber(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductURL - */ -class ReadBridgedDeviceBasicProductURL : public ModelCommand -{ -public: - ReadBridgedDeviceBasicProductURL() : ModelCommand("read") - { - AddArgument("attr-name", "product-url"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicProductURL() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeProductURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicProductURL : public ModelCommand -{ -public: - ReportBridgedDeviceBasicProductURL() : ModelCommand("report") - { - AddArgument("attr-name", "product-url"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicProductURL() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeProductURL(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeProductURL(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductLabel - */ -class ReadBridgedDeviceBasicProductLabel : public ModelCommand -{ -public: - ReadBridgedDeviceBasicProductLabel() : ModelCommand("read") - { - AddArgument("attr-name", "product-label"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicProductLabel() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeProductLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicProductLabel : public ModelCommand -{ -public: - ReportBridgedDeviceBasicProductLabel() : ModelCommand("report") - { - AddArgument("attr-name", "product-label"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicProductLabel() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeProductLabel(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeProductLabel(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SerialNumber - */ -class ReadBridgedDeviceBasicSerialNumber : public ModelCommand -{ -public: - ReadBridgedDeviceBasicSerialNumber() : ModelCommand("read") - { - AddArgument("attr-name", "serial-number"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicSerialNumber() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeSerialNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicSerialNumber : public ModelCommand -{ -public: - ReportBridgedDeviceBasicSerialNumber() : ModelCommand("report") - { - AddArgument("attr-name", "serial-number"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicSerialNumber() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeSerialNumber(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeSerialNumber(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Reachable - */ -class ReadBridgedDeviceBasicReachable : public ModelCommand -{ -public: - ReadBridgedDeviceBasicReachable() : ModelCommand("read") - { - AddArgument("attr-name", "reachable"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicReachable() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeReachable(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnBooleanAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportBridgedDeviceBasicReachable : public ModelCommand -{ -public: - ReportBridgedDeviceBasicReachable() : ModelCommand("report") - { - AddArgument("attr-name", "reachable"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicReachable() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeReachable(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeReachable(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnBooleanAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - /* * Attribute ClusterRevision */ @@ -29321,18 +28077,295 @@ class ReportOperationalCredentialsCurrentFabricIndex : public ModelCommand }; /* - * Attribute ClusterRevision + * Attribute ClusterRevision + */ +class ReadOperationalCredentialsClusterRevision : public ModelCommand +{ +public: + ReadOperationalCredentialsClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadOperationalCredentialsClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportOperationalCredentialsClusterRevision : public ModelCommand +{ +public: + ReportOperationalCredentialsClusterRevision() : ModelCommand("report") + { + AddArgument("attr-name", "cluster-revision"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportOperationalCredentialsClusterRevision() + { + delete onSuccessCallback; + delete onSuccessCallbackWithoutExit; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, endpointId); + + ReturnErrorOnFailure(cluster.ReportAttributeClusterRevision(onReportCallback->Cancel())); + + chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); + return cluster.SubscribeAttributeClusterRevision(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallbackWithoutExit = + new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeReport, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster PowerSource | 0x002F | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Status | 0x0000 | +| * Order | 0x0001 | +| * Description | 0x0002 | +| * BatteryVoltage | 0x000B | +| * BatteryPercentRemaining | 0x000C | +| * BatteryTimeRemaining | 0x000D | +| * BatteryChargeLevel | 0x000E | +| * ActiveBatteryFaults | 0x0012 | +| * BatteryChargeState | 0x001A | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute Status + */ +class ReadPowerSourceStatus : public ModelCommand +{ +public: + ReadPowerSourceStatus() : ModelCommand("read") + { + AddArgument("attr-name", "status"); + ModelCommand::AddArguments(); + } + + ~ReadPowerSourceStatus() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportPowerSourceStatus : public ModelCommand +{ +public: + ReportPowerSourceStatus() : ModelCommand("report") + { + AddArgument("attr-name", "status"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportPowerSourceStatus() + { + delete onSuccessCallback; + delete onSuccessCallbackWithoutExit; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, endpointId); + + ReturnErrorOnFailure(cluster.ReportAttributeStatus(onReportCallback->Cancel())); + + chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); + return cluster.SubscribeAttributeStatus(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallbackWithoutExit = + new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt8uAttributeReport, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/* + * Attribute Order + */ +class ReadPowerSourceOrder : public ModelCommand +{ +public: + ReadPowerSourceOrder() : ModelCommand("read") + { + AddArgument("attr-name", "order"); + ModelCommand::AddArguments(); + } + + ~ReadPowerSourceOrder() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOrder(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportPowerSourceOrder : public ModelCommand +{ +public: + ReportPowerSourceOrder() : ModelCommand("report") + { + AddArgument("attr-name", "order"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportPowerSourceOrder() + { + delete onSuccessCallback; + delete onSuccessCallbackWithoutExit; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, endpointId); + + ReturnErrorOnFailure(cluster.ReportAttributeOrder(onReportCallback->Cancel())); + + chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); + return cluster.SubscribeAttributeOrder(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallbackWithoutExit = + new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt8uAttributeReport, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/* + * Attribute Description */ -class ReadOperationalCredentialsClusterRevision : public ModelCommand +class ReadPowerSourceDescription : public ModelCommand { public: - ReadOperationalCredentialsClusterRevision() : ModelCommand("read") + ReadPowerSourceDescription() : ModelCommand("read") { - AddArgument("attr-name", "cluster-revision"); + AddArgument("attr-name", "description"); ModelCommand::AddArguments(); } - ~ReadOperationalCredentialsClusterRevision() + ~ReadPowerSourceDescription() { delete onSuccessCallback; delete onFailureCallback; @@ -29340,33 +28373,33 @@ class ReadOperationalCredentialsClusterRevision : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::OperationalCredentialsCluster cluster; + chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeDescription(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnCharStringAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportOperationalCredentialsClusterRevision : public ModelCommand +class ReportPowerSourceDescription : public ModelCommand { public: - ReportOperationalCredentialsClusterRevision() : ModelCommand("report") + ReportPowerSourceDescription() : ModelCommand("report") { - AddArgument("attr-name", "cluster-revision"); + AddArgument("attr-name", "description"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportOperationalCredentialsClusterRevision() + ~ReportPowerSourceDescription() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29376,15 +28409,15 @@ class ReportOperationalCredentialsClusterRevision : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x06) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); - chip::Controller::OperationalCredentialsCluster cluster; + chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeClusterRevision(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeDescription(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeClusterRevision(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + return cluster.SubscribeAttributeDescription(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29399,45 +28432,26 @@ class ReportOperationalCredentialsClusterRevision : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt16uAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnCharStringAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; -/*----------------------------------------------------------------------------*\ -| Cluster PowerSource | 0x002F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Status | 0x0000 | -| * Order | 0x0001 | -| * Description | 0x0002 | -| * BatteryVoltage | 0x000B | -| * BatteryPercentRemaining | 0x000C | -| * BatteryTimeRemaining | 0x000D | -| * BatteryChargeLevel | 0x000E | -| * ActiveBatteryFaults | 0x0012 | -| * BatteryChargeState | 0x001A | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -\*----------------------------------------------------------------------------*/ - /* - * Attribute Status + * Attribute BatteryVoltage */ -class ReadPowerSourceStatus : public ModelCommand +class ReadPowerSourceBatteryVoltage : public ModelCommand { public: - ReadPowerSourceStatus() : ModelCommand("read") + ReadPowerSourceBatteryVoltage() : ModelCommand("read") { - AddArgument("attr-name", "status"); + AddArgument("attr-name", "battery-voltage"); ModelCommand::AddArguments(); } - ~ReadPowerSourceStatus() + ~ReadPowerSourceBatteryVoltage() { delete onSuccessCallback; delete onFailureCallback; @@ -29449,29 +28463,29 @@ class ReadPowerSourceStatus : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBatteryVoltage(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceStatus : public ModelCommand +class ReportPowerSourceBatteryVoltage : public ModelCommand { public: - ReportPowerSourceStatus() : ModelCommand("report") + ReportPowerSourceBatteryVoltage() : ModelCommand("report") { - AddArgument("attr-name", "status"); + AddArgument("attr-name", "battery-voltage"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceStatus() + ~ReportPowerSourceBatteryVoltage() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29486,10 +28500,10 @@ class ReportPowerSourceStatus : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeStatus(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeBatteryVoltage(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeStatus(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + return cluster.SubscribeAttributeBatteryVoltage(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29504,26 +28518,26 @@ class ReportPowerSourceStatus : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt8uAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt32uAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; /* - * Attribute Order + * Attribute BatteryPercentRemaining */ -class ReadPowerSourceOrder : public ModelCommand +class ReadPowerSourceBatteryPercentRemaining : public ModelCommand { public: - ReadPowerSourceOrder() : ModelCommand("read") + ReadPowerSourceBatteryPercentRemaining() : ModelCommand("read") { - AddArgument("attr-name", "order"); + AddArgument("attr-name", "battery-percent-remaining"); ModelCommand::AddArguments(); } - ~ReadPowerSourceOrder() + ~ReadPowerSourceBatteryPercentRemaining() { delete onSuccessCallback; delete onFailureCallback; @@ -29535,7 +28549,7 @@ class ReadPowerSourceOrder : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeOrder(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBatteryPercentRemaining(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -29545,19 +28559,19 @@ class ReadPowerSourceOrder : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceOrder : public ModelCommand +class ReportPowerSourceBatteryPercentRemaining : public ModelCommand { public: - ReportPowerSourceOrder() : ModelCommand("report") + ReportPowerSourceBatteryPercentRemaining() : ModelCommand("report") { - AddArgument("attr-name", "order"); + AddArgument("attr-name", "battery-percent-remaining"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceOrder() + ~ReportPowerSourceBatteryPercentRemaining() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29572,10 +28586,11 @@ class ReportPowerSourceOrder : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeOrder(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeBatteryPercentRemaining(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeOrder(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + return cluster.SubscribeAttributeBatteryPercentRemaining(successCallback, onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29598,18 +28613,18 @@ class ReportPowerSourceOrder : public ModelCommand }; /* - * Attribute Description + * Attribute BatteryTimeRemaining */ -class ReadPowerSourceDescription : public ModelCommand +class ReadPowerSourceBatteryTimeRemaining : public ModelCommand { public: - ReadPowerSourceDescription() : ModelCommand("read") + ReadPowerSourceBatteryTimeRemaining() : ModelCommand("read") { - AddArgument("attr-name", "description"); + AddArgument("attr-name", "battery-time-remaining"); ModelCommand::AddArguments(); } - ~ReadPowerSourceDescription() + ~ReadPowerSourceBatteryTimeRemaining() { delete onSuccessCallback; delete onFailureCallback; @@ -29621,29 +28636,29 @@ class ReadPowerSourceDescription : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeDescription(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBatteryTimeRemaining(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceDescription : public ModelCommand +class ReportPowerSourceBatteryTimeRemaining : public ModelCommand { public: - ReportPowerSourceDescription() : ModelCommand("report") + ReportPowerSourceBatteryTimeRemaining() : ModelCommand("report") { - AddArgument("attr-name", "description"); + AddArgument("attr-name", "battery-time-remaining"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceDescription() + ~ReportPowerSourceBatteryTimeRemaining() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29658,10 +28673,11 @@ class ReportPowerSourceDescription : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeDescription(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeBatteryTimeRemaining(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeDescription(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + return cluster.SubscribeAttributeBatteryTimeRemaining(successCallback, onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29676,26 +28692,26 @@ class ReportPowerSourceDescription : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnCharStringAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt32uAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; /* - * Attribute BatteryVoltage + * Attribute BatteryChargeLevel */ -class ReadPowerSourceBatteryVoltage : public ModelCommand +class ReadPowerSourceBatteryChargeLevel : public ModelCommand { public: - ReadPowerSourceBatteryVoltage() : ModelCommand("read") + ReadPowerSourceBatteryChargeLevel() : ModelCommand("read") { - AddArgument("attr-name", "battery-voltage"); + AddArgument("attr-name", "battery-charge-level"); ModelCommand::AddArguments(); } - ~ReadPowerSourceBatteryVoltage() + ~ReadPowerSourceBatteryChargeLevel() { delete onSuccessCallback; delete onFailureCallback; @@ -29707,29 +28723,29 @@ class ReadPowerSourceBatteryVoltage : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeBatteryVoltage(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBatteryChargeLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceBatteryVoltage : public ModelCommand +class ReportPowerSourceBatteryChargeLevel : public ModelCommand { public: - ReportPowerSourceBatteryVoltage() : ModelCommand("report") + ReportPowerSourceBatteryChargeLevel() : ModelCommand("report") { - AddArgument("attr-name", "battery-voltage"); + AddArgument("attr-name", "battery-charge-level"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceBatteryVoltage() + ~ReportPowerSourceBatteryChargeLevel() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29744,10 +28760,11 @@ class ReportPowerSourceBatteryVoltage : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeBatteryVoltage(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeBatteryChargeLevel(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeBatteryVoltage(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); + return cluster.SubscribeAttributeBatteryChargeLevel(successCallback, onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29762,26 +28779,26 @@ class ReportPowerSourceBatteryVoltage : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt32uAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt8uAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; /* - * Attribute BatteryPercentRemaining + * Attribute ActiveBatteryFaults */ -class ReadPowerSourceBatteryPercentRemaining : public ModelCommand +class ReadPowerSourceActiveBatteryFaults : public ModelCommand { public: - ReadPowerSourceBatteryPercentRemaining() : ModelCommand("read") + ReadPowerSourceActiveBatteryFaults() : ModelCommand("read") { - AddArgument("attr-name", "battery-percent-remaining"); + AddArgument("attr-name", "active-battery-faults"); ModelCommand::AddArguments(); } - ~ReadPowerSourceBatteryPercentRemaining() + ~ReadPowerSourceActiveBatteryFaults() { delete onSuccessCallback; delete onFailureCallback; @@ -29793,7 +28810,42 @@ class ReadPowerSourceBatteryPercentRemaining : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeBatteryPercentRemaining(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeActiveBatteryFaults(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnPowerSourceActiveBatteryFaultsListAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute BatteryChargeState + */ +class ReadPowerSourceBatteryChargeState : public ModelCommand +{ +public: + ReadPowerSourceBatteryChargeState() : ModelCommand("read") + { + AddArgument("attr-name", "battery-charge-state"); + ModelCommand::AddArguments(); + } + + ~ReadPowerSourceBatteryChargeState() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::PowerSourceCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeBatteryChargeState(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -29803,19 +28855,19 @@ class ReadPowerSourceBatteryPercentRemaining : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceBatteryPercentRemaining : public ModelCommand +class ReportPowerSourceBatteryChargeState : public ModelCommand { public: - ReportPowerSourceBatteryPercentRemaining() : ModelCommand("report") + ReportPowerSourceBatteryChargeState() : ModelCommand("report") { - AddArgument("attr-name", "battery-percent-remaining"); + AddArgument("attr-name", "battery-charge-state"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceBatteryPercentRemaining() + ~ReportPowerSourceBatteryChargeState() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29830,11 +28882,11 @@ class ReportPowerSourceBatteryPercentRemaining : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeBatteryPercentRemaining(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeBatteryChargeState(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeBatteryPercentRemaining(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); + return cluster.SubscribeAttributeBatteryChargeState(successCallback, onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29857,18 +28909,18 @@ class ReportPowerSourceBatteryPercentRemaining : public ModelCommand }; /* - * Attribute BatteryTimeRemaining + * Attribute FeatureMap */ -class ReadPowerSourceBatteryTimeRemaining : public ModelCommand +class ReadPowerSourceFeatureMap : public ModelCommand { public: - ReadPowerSourceBatteryTimeRemaining() : ModelCommand("read") + ReadPowerSourceFeatureMap() : ModelCommand("read") { - AddArgument("attr-name", "battery-time-remaining"); + AddArgument("attr-name", "feature-map"); ModelCommand::AddArguments(); } - ~ReadPowerSourceBatteryTimeRemaining() + ~ReadPowerSourceFeatureMap() { delete onSuccessCallback; delete onFailureCallback; @@ -29880,7 +28932,7 @@ class ReadPowerSourceBatteryTimeRemaining : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeBatteryTimeRemaining(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -29890,19 +28942,19 @@ class ReadPowerSourceBatteryTimeRemaining : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceBatteryTimeRemaining : public ModelCommand +class ReportPowerSourceFeatureMap : public ModelCommand { public: - ReportPowerSourceBatteryTimeRemaining() : ModelCommand("report") + ReportPowerSourceFeatureMap() : ModelCommand("report") { - AddArgument("attr-name", "battery-time-remaining"); + AddArgument("attr-name", "feature-map"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceBatteryTimeRemaining() + ~ReportPowerSourceFeatureMap() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -29917,11 +28969,10 @@ class ReportPowerSourceBatteryTimeRemaining : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeBatteryTimeRemaining(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeFeatureMap(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeBatteryTimeRemaining(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); + return cluster.SubscribeAttributeFeatureMap(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -29944,18 +28995,18 @@ class ReportPowerSourceBatteryTimeRemaining : public ModelCommand }; /* - * Attribute BatteryChargeLevel + * Attribute ClusterRevision */ -class ReadPowerSourceBatteryChargeLevel : public ModelCommand +class ReadPowerSourceClusterRevision : public ModelCommand { public: - ReadPowerSourceBatteryChargeLevel() : ModelCommand("read") + ReadPowerSourceClusterRevision() : ModelCommand("read") { - AddArgument("attr-name", "battery-charge-level"); + AddArgument("attr-name", "cluster-revision"); ModelCommand::AddArguments(); } - ~ReadPowerSourceBatteryChargeLevel() + ~ReadPowerSourceClusterRevision() { delete onSuccessCallback; delete onFailureCallback; @@ -29967,29 +29018,29 @@ class ReadPowerSourceBatteryChargeLevel : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeBatteryChargeLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceBatteryChargeLevel : public ModelCommand +class ReportPowerSourceClusterRevision : public ModelCommand { public: - ReportPowerSourceBatteryChargeLevel() : ModelCommand("report") + ReportPowerSourceClusterRevision() : ModelCommand("report") { - AddArgument("attr-name", "battery-charge-level"); + AddArgument("attr-name", "cluster-revision"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportPowerSourceBatteryChargeLevel() + ~ReportPowerSourceClusterRevision() { delete onSuccessCallback; delete onSuccessCallbackWithoutExit; @@ -30004,11 +29055,10 @@ class ReportPowerSourceBatteryChargeLevel : public ModelCommand chip::Controller::PowerSourceCluster cluster; cluster.Associate(device, endpointId); - ReturnErrorOnFailure(cluster.ReportAttributeBatteryChargeLevel(onReportCallback->Cancel())); + ReturnErrorOnFailure(cluster.ReportAttributeClusterRevision(onReportCallback->Cancel())); chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeBatteryChargeLevel(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); + return cluster.SubscribeAttributeClusterRevision(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); } chip::System::Clock::Timeout GetWaitDuration() const override @@ -30023,148 +29073,36 @@ class ReportPowerSourceBatteryChargeLevel : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt8uAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; -/* - * Attribute ActiveBatteryFaults - */ -class ReadPowerSourceActiveBatteryFaults : public ModelCommand -{ -public: - ReadPowerSourceActiveBatteryFaults() : ModelCommand("read") - { - AddArgument("attr-name", "active-battery-faults"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceActiveBatteryFaults() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeActiveBatteryFaults(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnPowerSourceActiveBatteryFaultsListAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -/* - * Attribute BatteryChargeState - */ -class ReadPowerSourceBatteryChargeState : public ModelCommand -{ -public: - ReadPowerSourceBatteryChargeState() : ModelCommand("read") - { - AddArgument("attr-name", "battery-charge-state"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryChargeState() - { - delete onSuccessCallback; - delete onFailureCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttributeBatteryChargeState(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); -}; - -class ReportPowerSourceBatteryChargeState : public ModelCommand -{ -public: - ReportPowerSourceBatteryChargeState() : ModelCommand("report") - { - AddArgument("attr-name", "battery-charge-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryChargeState() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeBatteryChargeState(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeBatteryChargeState(successCallback, onFailureCallback->Cancel(), mMinInterval, - mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt8uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; +/*----------------------------------------------------------------------------*\ +| Cluster PowerSourceConfiguration | 0x002E | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Sources | 0x0000 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ /* - * Attribute FeatureMap + * Attribute Sources */ -class ReadPowerSourceFeatureMap : public ModelCommand +class ReadPowerSourceConfigurationSources : public ModelCommand { public: - ReadPowerSourceFeatureMap() : ModelCommand("read") + ReadPowerSourceConfigurationSources() : ModelCommand("read") { - AddArgument("attr-name", "feature-map"); + AddArgument("attr-name", "sources"); ModelCommand::AddArguments(); } - ~ReadPowerSourceFeatureMap() + ~ReadPowerSourceConfigurationSources() { delete onSuccessCallback; delete onFailureCallback; @@ -30172,85 +29110,34 @@ class ReadPowerSourceFeatureMap : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x002E) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::PowerSourceCluster cluster; + chip::Controller::PowerSourceConfigurationCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeSources(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnPowerSourceConfigurationSourcesListAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceFeatureMap : public ModelCommand -{ -public: - ReportPowerSourceFeatureMap() : ModelCommand("report") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceFeatureMap() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeFeatureMap(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeFeatureMap(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt32uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - /* * Attribute ClusterRevision */ -class ReadPowerSourceClusterRevision : public ModelCommand +class ReadPowerSourceConfigurationClusterRevision : public ModelCommand { public: - ReadPowerSourceClusterRevision() : ModelCommand("read") + ReadPowerSourceConfigurationClusterRevision() : ModelCommand("read") { AddArgument("attr-name", "cluster-revision"); ModelCommand::AddArguments(); } - ~ReadPowerSourceClusterRevision() + ~ReadPowerSourceConfigurationClusterRevision() { delete onSuccessCallback; delete onFailureCallback; @@ -30258,9 +29145,9 @@ class ReadPowerSourceClusterRevision : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x00) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x002E) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::PowerSourceCluster cluster; + chip::Controller::PowerSourceConfigurationCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -30272,58 +29159,6 @@ class ReadPowerSourceClusterRevision : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportPowerSourceClusterRevision : public ModelCommand -{ -public: - ReportPowerSourceClusterRevision() : ModelCommand("report") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceClusterRevision() - { - delete onSuccessCallback; - delete onSuccessCallbackWithoutExit; - delete onFailureCallback; - delete onReportCallback; - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x002F) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - ReturnErrorOnFailure(cluster.ReportAttributeClusterRevision(onReportCallback->Cancel())); - - chip::Callback::Cancelable * successCallback = mWait ? onSuccessCallbackWithoutExit->Cancel() : onSuccessCallback->Cancel(); - return cluster.SubscribeAttributeClusterRevision(successCallback, onFailureCallback->Cancel(), mMinInterval, mMaxInterval); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - -private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); - chip::Callback::Callback * onSuccessCallbackWithoutExit = - new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); - chip::Callback::Callback * onFailureCallback = - new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt16uAttributeReport, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - /*----------------------------------------------------------------------------*\ | Cluster PressureMeasurement | 0x0403 | |------------------------------------------------------------------------------| @@ -56630,37 +55465,8 @@ void registerClusterBridgedDeviceBasic(Commands & commands) const char * clusterName = "BridgedDeviceBasic"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -57429,6 +56235,17 @@ void registerClusterPowerSource(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterPowerSourceConfiguration(Commands & commands) +{ + const char * clusterName = "PowerSourceConfiguration"; + + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterPressureMeasurement(Commands & commands) { const char * clusterName = "PressureMeasurement"; @@ -58254,6 +57071,7 @@ void registerClusters(Commands & commands) registerClusterOnOffSwitchConfiguration(commands); registerClusterOperationalCredentials(commands); registerClusterPowerSource(commands); + registerClusterPowerSourceConfiguration(commands); registerClusterPressureMeasurement(commands); registerClusterPumpConfigurationAndControl(commands); registerClusterRelativeHumidityMeasurement(commands); diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index d30328496698fe..180ae81d6ce20b 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -78,20 +78,6 @@ class Listen : public ReportingCommand delete onReportBooleanStateClusterRevisionCallback; delete onReportBridgedActionsSetupUrlCallback; delete onReportBridgedActionsClusterRevisionCallback; - delete onReportBridgedDeviceBasicVendorNameCallback; - delete onReportBridgedDeviceBasicVendorIDCallback; - delete onReportBridgedDeviceBasicProductNameCallback; - delete onReportBridgedDeviceBasicNodeLabelCallback; - delete onReportBridgedDeviceBasicHardwareVersionCallback; - delete onReportBridgedDeviceBasicHardwareVersionStringCallback; - delete onReportBridgedDeviceBasicSoftwareVersionCallback; - delete onReportBridgedDeviceBasicSoftwareVersionStringCallback; - delete onReportBridgedDeviceBasicManufacturingDateCallback; - delete onReportBridgedDeviceBasicPartNumberCallback; - delete onReportBridgedDeviceBasicProductURLCallback; - delete onReportBridgedDeviceBasicProductLabelCallback; - delete onReportBridgedDeviceBasicSerialNumberCallback; - delete onReportBridgedDeviceBasicReachableCallback; delete onReportBridgedDeviceBasicClusterRevisionCallback; delete onReportColorControlCurrentHueCallback; delete onReportColorControlCurrentSaturationCallback; @@ -628,42 +614,6 @@ class Listen : public ReportingCommand callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0025, 0xFFFD, onReportBridgedActionsClusterRevisionCallback->Cancel(), BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0001, onReportBridgedDeviceBasicVendorNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0002, onReportBridgedDeviceBasicVendorIDCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0003, - onReportBridgedDeviceBasicProductNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0005, onReportBridgedDeviceBasicNodeLabelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0007, - onReportBridgedDeviceBasicHardwareVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0008, - onReportBridgedDeviceBasicHardwareVersionStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0009, - onReportBridgedDeviceBasicSoftwareVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000A, - onReportBridgedDeviceBasicSoftwareVersionStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000B, - onReportBridgedDeviceBasicManufacturingDateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000C, onReportBridgedDeviceBasicPartNumberCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000D, onReportBridgedDeviceBasicProductURLCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000E, - onReportBridgedDeviceBasicProductLabelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x000F, - onReportBridgedDeviceBasicSerialNumberCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0x0011, onReportBridgedDeviceBasicReachableCallback->Cancel(), - BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0xFFFD, onReportBridgedDeviceBasicClusterRevisionCallback->Cancel(), BasicAttributeFilter); @@ -1878,34 +1828,6 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnCharStringAttributeResponse, this); chip::Callback::Callback * onReportBridgedActionsClusterRevisionCallback = new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicVendorNameCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicVendorIDCallback = - new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicProductNameCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicNodeLabelCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicHardwareVersionCallback = - new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicHardwareVersionStringCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicSoftwareVersionCallback = - new chip::Callback::Callback(OnInt32uAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicSoftwareVersionStringCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicManufacturingDateCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicPartNumberCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicProductURLCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicProductLabelCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicSerialNumberCallback = - new chip::Callback::Callback(OnCharStringAttributeResponse, this); - chip::Callback::Callback * onReportBridgedDeviceBasicReachableCallback = - new chip::Callback::Callback(OnBooleanAttributeResponse, this); chip::Callback::Callback * onReportBridgedDeviceBasicClusterRevisionCallback = new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportColorControlCurrentHueCallback = diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 573443627cd573..eb749fa2490543 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -46659,32 +46659,34 @@ class TestDescriptorCluster : public TestCommand VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 4)); VerifyOrReturn(CheckValue("serverList[4]", iter.GetValue(), 42UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 5)); - VerifyOrReturn(CheckValue("serverList[5]", iter.GetValue(), 48UL)); + VerifyOrReturn(CheckValue("serverList[5]", iter.GetValue(), 46UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 6)); - VerifyOrReturn(CheckValue("serverList[6]", iter.GetValue(), 49UL)); + VerifyOrReturn(CheckValue("serverList[6]", iter.GetValue(), 48UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 7)); - VerifyOrReturn(CheckValue("serverList[7]", iter.GetValue(), 50UL)); + VerifyOrReturn(CheckValue("serverList[7]", iter.GetValue(), 49UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 8)); - VerifyOrReturn(CheckValue("serverList[8]", iter.GetValue(), 51UL)); + VerifyOrReturn(CheckValue("serverList[8]", iter.GetValue(), 50UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 9)); - VerifyOrReturn(CheckValue("serverList[9]", iter.GetValue(), 52UL)); + VerifyOrReturn(CheckValue("serverList[9]", iter.GetValue(), 51UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 10)); - VerifyOrReturn(CheckValue("serverList[10]", iter.GetValue(), 53UL)); + VerifyOrReturn(CheckValue("serverList[10]", iter.GetValue(), 52UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 11)); - VerifyOrReturn(CheckValue("serverList[11]", iter.GetValue(), 54UL)); + VerifyOrReturn(CheckValue("serverList[11]", iter.GetValue(), 53UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 12)); - VerifyOrReturn(CheckValue("serverList[12]", iter.GetValue(), 55UL)); + VerifyOrReturn(CheckValue("serverList[12]", iter.GetValue(), 54UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 13)); - VerifyOrReturn(CheckValue("serverList[13]", iter.GetValue(), 60UL)); + VerifyOrReturn(CheckValue("serverList[13]", iter.GetValue(), 55UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 14)); - VerifyOrReturn(CheckValue("serverList[14]", iter.GetValue(), 62UL)); + VerifyOrReturn(CheckValue("serverList[14]", iter.GetValue(), 60UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 15)); - VerifyOrReturn(CheckValue("serverList[15]", iter.GetValue(), 1029UL)); + VerifyOrReturn(CheckValue("serverList[15]", iter.GetValue(), 62UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 16)); - VerifyOrReturn(CheckValue("serverList[16]", iter.GetValue(), 61440UL)); + VerifyOrReturn(CheckValue("serverList[16]", iter.GetValue(), 1029UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 17)); - VerifyOrReturn(CheckValue("serverList[17]", iter.GetValue(), 61444UL)); - VerifyOrReturn(CheckNoMoreListItems("serverList", iter, 18)); + VerifyOrReturn(CheckValue("serverList[17]", iter.GetValue(), 61440UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 18)); + VerifyOrReturn(CheckValue("serverList[18]", iter.GetValue(), 61444UL)); + VerifyOrReturn(CheckNoMoreListItems("serverList", iter, 19)); NextTest(); } diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 1f8ec3e13c0732..3b0bb2adbf2020 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -627,6 +627,27 @@ void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(TLV::TLVReader * t cb->mCall(cb->mContext, list); } +void PowerSourceConfigurationClusterSourcesListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index ea6fdad5b71e85..f30f8f1dfafdd4 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -260,6 +260,11 @@ void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(chip::TLV::TLVRead chip::Callback::Cancelable * onFailureCallback); typedef void (*PowerSourceActiveBatteryFaultsListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +void PowerSourceConfigurationClusterSourcesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceConfigurationSourcesListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); void SoftwareDiagnosticsClusterThreadMetricsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 0722875104f7ad..272c1a7db4265f 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -2645,409 +2645,6 @@ CHIP_ERROR BridgedActionsCluster::ReportAttributeClusterRevision(Callback::Cance // BridgedDeviceBasic Cluster Commands // BridgedDeviceBasic Cluster Attributes -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000001; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::VendorName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeVendorName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::VendorName::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeVendorID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000002; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeVendorID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::VendorID::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeVendorID(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::VendorID::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeProductName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000003; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeProductName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::ProductName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeProductName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::ProductName::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000005; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::WriteAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::NodeLabel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::NodeLabel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeNodeLabel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::NodeLabel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000007; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::HardwareVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeHardwareVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::HardwareVersion::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000008; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::HardwareVersionString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeHardwareVersionString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::HardwareVersionString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000009; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::SoftwareVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeSoftwareVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::SoftwareVersion::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000A; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::SoftwareVersionString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeSoftwareVersionString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000B; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::ManufacturingDate::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeManufacturingDate(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::ManufacturingDate::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributePartNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000C; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributePartNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::PartNumber::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributePartNumber(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::PartNumber::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeProductURL(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000D; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeProductURL(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::ProductURL::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeProductURL(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::ProductURL::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeProductLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000E; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeProductLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::ProductLabel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeProductLabel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::ProductLabel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x0000000F; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::SerialNumber::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeSerialNumber(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::SerialNumber::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeReachable(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = 0x00000011; - return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeReachable(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedDeviceBasic::Attributes::Reachable::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeReachable(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedDeviceBasic::Attributes::Reachable::Id, onReportCallback, - BasicAttributeFilter); -} - CHIP_ERROR BridgedDeviceBasicCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -13352,6 +12949,30 @@ CHIP_ERROR PowerSourceCluster::ReportAttributeClusterRevision(Callback::Cancelab BasicAttributeFilter); } +// PowerSourceConfiguration Cluster Commands +// PowerSourceConfiguration Cluster Attributes +CHIP_ERROR PowerSourceConfigurationCluster::ReadAttributeSources(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000000; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + PowerSourceConfigurationClusterSourcesListAttributeFilter); +} + +CHIP_ERROR PowerSourceConfigurationCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000FFFD; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + // PressureMeasurement Cluster Commands // PressureMeasurement Cluster Attributes CHIP_ERROR PressureMeasurementCluster::ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index eb50ebc5ad6f08..13e45a664ef1ba 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -441,69 +441,6 @@ class DLL_EXPORT BridgedDeviceBasicCluster : public ClusterBase ~BridgedDeviceBasicCluster() {} // Cluster Attributes - CHIP_ERROR ReadAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorName(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeVendorID(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeVendorID(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorID(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeProductName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeProductName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductName(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR WriteAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR SubscribeAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNodeLabel(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeHardwareVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeHardwareVersionString(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSoftwareVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeSoftwareVersionString(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeManufacturingDate(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributePartNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributePartNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePartNumber(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeProductURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeProductURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductURL(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeProductLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeProductLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductLabel(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSerialNumber(Callback::Cancelable * onReportCallback); - CHIP_ERROR ReadAttributeReachable(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR SubscribeAttributeReachable(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeReachable(Callback::Cancelable * onReportCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval); @@ -1874,6 +1811,17 @@ class DLL_EXPORT PowerSourceCluster : public ClusterBase CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT PowerSourceConfigurationCluster : public ClusterBase +{ +public: + PowerSourceConfigurationCluster() : ClusterBase(app::Clusters::PowerSourceConfiguration::Id) {} + ~PowerSourceConfigurationCluster() {} + + // Cluster Attributes + CHIP_ERROR ReadAttributeSources(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); +}; + class DLL_EXPORT PressureMeasurementCluster : public ClusterBase { public: diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index 541b221d76f3c9..3b0d93fc98c034 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -63,6 +63,7 @@ MatterOnOffSwitchConfigurationPluginClientInitCallback(); \ MatterOperationalCredentialsPluginClientInitCallback(); \ MatterPowerSourcePluginClientInitCallback(); \ + MatterPowerSourceConfigurationPluginClientInitCallback(); \ MatterPressureMeasurementPluginClientInitCallback(); \ MatterPumpConfigurationAndControlPluginClientInitCallback(); \ MatterRelativeHumidityMeasurementPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index 5066913f920360..7e315dec568069 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -152,6 +152,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_POWER_SOURCE_CLUSTER_ID: emberAfPowerSourceClusterInitCallback(endpoint); break; + case ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID: + emberAfPowerSourceConfigurationClusterInitCallback(endpoint); + break; case ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID: emberAfPressureMeasurementClusterInitCallback(endpoint); break; @@ -411,6 +414,11 @@ void __attribute__((weak)) emberAfPowerSourceClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfPowerSourceConfigurationClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfPressureMeasurementClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 4335bc7a4f9c25..d177bcc76d6f75 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -123,7 +123,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 62 +#define GENERATED_ATTRIBUTE_COUNT 63 #define GENERATED_ATTRIBUTES \ { \ \ @@ -162,6 +162,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: OTA Software Update Requestor (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Power Source Configuration (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (client) */ \ @@ -311,7 +314,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 57 +#define GENERATED_CLUSTER_COUNT 58 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -341,137 +344,140 @@ 0x002A, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: OTA Software Update Requestor (client) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Power Source Configuration (client) */ \ + { \ + 0x002F, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Power Source (client) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(13), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(14), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: General Commissioning (client) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(15), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(16), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Network Commissioning (client) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(17), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(18), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Diagnostic Logs (client) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(18), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: General Diagnostics (client) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(18), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(19), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Software Diagnostics (client) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(20), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(21), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thread Network Diagnostics (client) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(22), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(23), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: WiFi Network Diagnostics (client) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(23), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(24), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (client) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(25), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(26), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (client) */ \ - { 0x003B, ZAP_ATTRIBUTE_INDEX(26), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Switch (client) */ \ + { 0x003B, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Switch (client) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: AdministratorCommissioning (client) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (client) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (client) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(32), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (client) */ \ { \ - 0x0101, ZAP_ATTRIBUTE_INDEX(32), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0101, ZAP_ATTRIBUTE_INDEX(33), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Door Lock (client) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(33), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (client) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (client) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(35), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(36), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(37), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (client) */ \ { \ - 0x0204, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0204, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (client) */ \ { \ - 0x0300, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0300, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Color Control (client) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (client) */ \ { \ - 0x0406, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0406, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Occupancy Sensing (client) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (client) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (client) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Input (client) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Low Power (client) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(55), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(55), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(56), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(56), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(57), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(57), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(58), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(58), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(59), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(59), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(60), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(60), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(61), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(61), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(62), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -480,7 +486,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 57, 136 }, \ + { ZAP_CLUSTER_INDEX(0), 58, 138 }, \ } // Largest attribute size is needed for various buffers @@ -490,7 +496,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (4) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (136) +#define ATTRIBUTE_MAX_SIZE (138) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index 8fdc7ca51f1d1b..06c9a4166e52e1 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -70,6 +70,7 @@ #define EMBER_AF_ON_OFF_SWITCH_CONFIG_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_POWER_SOURCE_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_POWER_SOURCE_CONFIGURATION_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_PRESSURE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_PUMP_CONFIG_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -253,6 +254,10 @@ #define ZCL_USING_POWER_SOURCE_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_POWER_SOURCE_CLIENT +// Use this macro to check if the client side of the Power Source Configuration cluster is included +#define ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_POWER_SOURCE_CONFIGURATION_CLIENT + // Use this macro to check if the client side of the Pressure Measurement cluster is included #define ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_PRESSURE_MEASUREMENT_CLIENT diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp index b9da448f69285f..291dc2e11d2b0f 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp @@ -486,139 +486,6 @@ CHIP_ERROR BridgedActionsClusterTest::WriteAttributeClusterRevision(Callback::Ca return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::VendorName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeVendorID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::VendorID::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::ProductName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::HardwareVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::HardwareVersionString::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::SoftwareVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::SoftwareVersionString::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::ManufacturingDate::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributePartNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::PartNumber::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductURL(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::ProductURL::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeProductLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::ProductLabel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::SerialNumber::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeReachable(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::Reachable::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) { @@ -2161,6 +2028,18 @@ CHIP_ERROR PowerSourceClusterTest::WriteAttributeClusterRevision(Callback::Cance return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR PowerSourceConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSourceConfiguration::Attributes::ClusterRevision::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, int16_t value) { diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index 2d9fd597e4eb4a..99b33ce74d289a 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -206,32 +206,6 @@ class DLL_EXPORT BridgedDeviceBasicClusterTest : public BridgedDeviceBasicCluste BridgedDeviceBasicClusterTest() : BridgedDeviceBasicCluster() {} ~BridgedDeviceBasicClusterTest() {} - CHIP_ERROR WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeVendorID(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t value); - CHIP_ERROR WriteAttributeProductName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t value); - CHIP_ERROR WriteAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value); - CHIP_ERROR WriteAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint32_t value); - CHIP_ERROR WriteAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value); - CHIP_ERROR WriteAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributePartNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeProductURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeProductLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan value); - CHIP_ERROR WriteAttributeReachable(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - bool value); CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); }; @@ -762,6 +736,16 @@ class DLL_EXPORT PowerSourceClusterTest : public PowerSourceCluster uint16_t value); }; +class DLL_EXPORT PowerSourceConfigurationClusterTest : public PowerSourceConfigurationCluster +{ +public: + PowerSourceConfigurationClusterTest() : PowerSourceConfigurationCluster() {} + ~PowerSourceConfigurationClusterTest() {} + + CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); +}; + class DLL_EXPORT PressureMeasurementClusterTest : public PressureMeasurementCluster { public: diff --git a/zzz_generated/lock-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/lock-app/zap-generated/PluginApplicationCallbacks.h index c710b8c2b3a563..e3f429c3d98d83 100644 --- a/zzz_generated/lock-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/lock-app/zap-generated/PluginApplicationCallbacks.h @@ -32,6 +32,8 @@ MatterNetworkCommissioningPluginServerInitCallback(); \ MatterOnOffPluginServerInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ + MatterPowerSourcePluginServerInitCallback(); \ + MatterPowerSourceConfigurationPluginServerInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); diff --git a/zzz_generated/lock-app/zap-generated/attribute-size.cpp b/zzz_generated/lock-app/zap-generated/attribute-size.cpp index eefc399fb4e2f3..6e6e8f4466ee16 100644 --- a/zzz_generated/lock-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/lock-app/zap-generated/attribute-size.cpp @@ -323,6 +323,26 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x002E: // Power Source Configuration Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // Sources + { + entryLength = 1; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + copyListMember(dest, src, write, &entryOffset, entryLength); // INT8U + break; + } + } + break; + } case 0x0034: // Software Diagnostics Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -599,6 +619,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x002E: // Power Source Configuration Cluster + switch (attributeId) + { + case 0x0000: // Sources + // uint8_t + entryLength = 1; + break; + } + break; case 0x0034: // Software Diagnostics Cluster switch (attributeId) { diff --git a/zzz_generated/lock-app/zap-generated/callback-stub.cpp b/zzz_generated/lock-app/zap-generated/callback-stub.cpp index ce041d7c344857..5eb2564220b05e 100644 --- a/zzz_generated/lock-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/lock-app/zap-generated/callback-stub.cpp @@ -59,6 +59,12 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: emberAfOperationalCredentialsClusterInitCallback(endpoint); break; + case ZCL_POWER_SOURCE_CLUSTER_ID: + emberAfPowerSourceClusterInitCallback(endpoint); + break; + case ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID: + emberAfPowerSourceConfigurationClusterInitCallback(endpoint); + break; case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; @@ -124,6 +130,16 @@ void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfPowerSourceClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} +void __attribute__((weak)) emberAfPowerSourceConfigurationClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 1111dc163e11b9..778521b84d1fb1 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -32,12 +32,23 @@ /* 0 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Power Source (server), big-endian */ \ + \ + /* 4 - Description, */ \ + 3, 'U', 'S', 'B', \ + \ + /* 8 - WiredAssessedCurrent, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 12 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 4 - Breadcrumb, */ \ + /* 16 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 12 - BasicCommissioningInfoList, */ \ + /* 24 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -53,223 +64,231 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 266 - FeatureMap, */ \ + /* 278 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 270 - FeatureMap, */ \ + /* 282 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 274 - UpTime, */ \ + /* 286 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 282 - TotalOperationalHours, */ \ + /* 294 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 286 - CurrentHeapFree, */ \ + /* 298 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 294 - CurrentHeapUsed, */ \ + /* 306 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 302 - CurrentHeapHighWatermark, */ \ + /* 314 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 310 - FeatureMap, */ \ + /* 322 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 314 - NetworkName, */ \ + /* 326 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 316 - ExtendedPanId, */ \ + /* 328 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - OverrunCount, */ \ + /* 336 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 332 - PartitionId, */ \ + /* 344 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - TxTotalCount, */ \ + /* 348 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 340 - TxUnicastCount, */ \ + /* 352 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - TxBroadcastCount, */ \ + /* 356 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - TxAckRequestedCount, */ \ + /* 360 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - TxAckedCount, */ \ + /* 364 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - TxNoAckRequestedCount, */ \ + /* 368 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 360 - TxDataCount, */ \ + /* 372 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 364 - TxDataPollCount, */ \ + /* 376 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 368 - TxBeaconCount, */ \ + /* 380 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 372 - TxBeaconRequestCount, */ \ + /* 384 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 376 - TxOtherCount, */ \ + /* 388 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 380 - TxRetryCount, */ \ + /* 392 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 384 - TxDirectMaxRetryExpiryCount, */ \ + /* 396 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 388 - TxIndirectMaxRetryExpiryCount, */ \ + /* 400 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 392 - TxErrCcaCount, */ \ + /* 404 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 396 - TxErrAbortCount, */ \ + /* 408 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 400 - TxErrBusyChannelCount, */ \ + /* 412 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 404 - RxTotalCount, */ \ + /* 416 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 408 - RxUnicastCount, */ \ + /* 420 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 412 - RxBroadcastCount, */ \ + /* 424 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 416 - RxDataCount, */ \ + /* 428 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 420 - RxDataPollCount, */ \ + /* 432 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 424 - RxBeaconCount, */ \ + /* 436 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 428 - RxBeaconRequestCount, */ \ + /* 440 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 432 - RxOtherCount, */ \ + /* 444 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 436 - RxAddressFilteredCount, */ \ + /* 448 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 440 - RxDestAddrFilteredCount, */ \ + /* 452 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 444 - RxDuplicatedCount, */ \ + /* 456 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 448 - RxErrNoFrameCount, */ \ + /* 460 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 452 - RxErrUnknownNeighborCount, */ \ + /* 464 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 456 - RxErrInvalidSrcAddrCount, */ \ + /* 468 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 460 - RxErrSecCount, */ \ + /* 472 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 464 - RxErrFcsCount, */ \ + /* 476 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 468 - RxErrOtherCount, */ \ + /* 480 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 472 - ActiveTimestamp, */ \ + /* 484 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 480 - PendingTimestamp, */ \ + /* 492 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 488 - delay, */ \ + /* 500 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 492 - ChannelMask, */ \ + /* 504 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 499 - FeatureMap, */ \ + /* 511 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 503 - BeaconLostCount, */ \ + /* 515 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 507 - BeaconRxCount, */ \ + /* 519 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 511 - PacketMulticastRxCount, */ \ + /* 523 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 515 - PacketMulticastTxCount, */ \ + /* 527 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 519 - PacketUnicastRxCount, */ \ + /* 531 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 523 - PacketUnicastTxCount, */ \ + /* 535 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 527 - CurrentMaxRate, */ \ + /* 539 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 535 - OverrunCount, */ \ + /* 547 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - FeatureMap, */ \ + /* 555 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 547 - PacketRxCount, */ \ + /* 559 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 555 - PacketTxCount, */ \ + /* 567 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 563 - TxErrCount, */ \ + /* 575 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 571 - CollisionCount, */ \ + /* 583 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 579 - OverrunCount, */ \ + /* 591 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 587 - TimeSinceReset, */ \ + /* 599 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 595 - FeatureMap, */ \ + /* 607 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 599 - FeatureMap, */ \ + /* 611 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ + \ + /* 615 - Description, */ \ + 7, 'B', 'a', 't', 't', 'e', 'r', 'y', \ + \ + /* 623 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x0A, \ } #else // !BIGENDIAN_CPU @@ -281,12 +300,23 @@ /* 0 - SoftwareVersion, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Power Source (server), little-endian */ \ + \ + /* 4 - Description, */ \ + 3, 'U', 'S', 'B', \ + \ + /* 8 - WiredAssessedCurrent, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 12 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 4 - Breadcrumb, */ \ + /* 16 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 12 - BasicCommissioningInfoList, */ \ + /* 24 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -302,228 +332,236 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 266 - FeatureMap, */ \ + /* 278 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 270 - FeatureMap, */ \ + /* 282 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 274 - UpTime, */ \ + /* 286 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 282 - TotalOperationalHours, */ \ + /* 294 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 286 - CurrentHeapFree, */ \ + /* 298 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 294 - CurrentHeapUsed, */ \ + /* 306 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 302 - CurrentHeapHighWatermark, */ \ + /* 314 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 310 - FeatureMap, */ \ + /* 322 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 314 - NetworkName, */ \ + /* 326 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 316 - ExtendedPanId, */ \ + /* 328 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - OverrunCount, */ \ + /* 336 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 332 - PartitionId, */ \ + /* 344 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - TxTotalCount, */ \ + /* 348 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 340 - TxUnicastCount, */ \ + /* 352 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - TxBroadcastCount, */ \ + /* 356 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - TxAckRequestedCount, */ \ + /* 360 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - TxAckedCount, */ \ + /* 364 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - TxNoAckRequestedCount, */ \ + /* 368 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 360 - TxDataCount, */ \ + /* 372 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 364 - TxDataPollCount, */ \ + /* 376 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 368 - TxBeaconCount, */ \ + /* 380 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 372 - TxBeaconRequestCount, */ \ + /* 384 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 376 - TxOtherCount, */ \ + /* 388 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 380 - TxRetryCount, */ \ + /* 392 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 384 - TxDirectMaxRetryExpiryCount, */ \ + /* 396 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 388 - TxIndirectMaxRetryExpiryCount, */ \ + /* 400 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 392 - TxErrCcaCount, */ \ + /* 404 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 396 - TxErrAbortCount, */ \ + /* 408 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 400 - TxErrBusyChannelCount, */ \ + /* 412 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 404 - RxTotalCount, */ \ + /* 416 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 408 - RxUnicastCount, */ \ + /* 420 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 412 - RxBroadcastCount, */ \ + /* 424 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 416 - RxDataCount, */ \ + /* 428 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 420 - RxDataPollCount, */ \ + /* 432 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 424 - RxBeaconCount, */ \ + /* 436 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 428 - RxBeaconRequestCount, */ \ + /* 440 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 432 - RxOtherCount, */ \ + /* 444 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 436 - RxAddressFilteredCount, */ \ + /* 448 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 440 - RxDestAddrFilteredCount, */ \ + /* 452 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 444 - RxDuplicatedCount, */ \ + /* 456 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 448 - RxErrNoFrameCount, */ \ + /* 460 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 452 - RxErrUnknownNeighborCount, */ \ + /* 464 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 456 - RxErrInvalidSrcAddrCount, */ \ + /* 468 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 460 - RxErrSecCount, */ \ + /* 472 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 464 - RxErrFcsCount, */ \ + /* 476 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 468 - RxErrOtherCount, */ \ + /* 480 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 472 - ActiveTimestamp, */ \ + /* 484 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 480 - PendingTimestamp, */ \ + /* 492 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 488 - delay, */ \ + /* 500 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 492 - ChannelMask, */ \ + /* 504 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 499 - FeatureMap, */ \ + /* 511 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 503 - BeaconLostCount, */ \ + /* 515 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 507 - BeaconRxCount, */ \ + /* 519 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 511 - PacketMulticastRxCount, */ \ + /* 523 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 515 - PacketMulticastTxCount, */ \ + /* 527 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 519 - PacketUnicastRxCount, */ \ + /* 531 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 523 - PacketUnicastTxCount, */ \ + /* 535 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 527 - CurrentMaxRate, */ \ + /* 539 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 535 - OverrunCount, */ \ + /* 547 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 543 - FeatureMap, */ \ + /* 555 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 547 - PacketRxCount, */ \ + /* 559 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 555 - PacketTxCount, */ \ + /* 567 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 563 - TxErrCount, */ \ + /* 575 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 571 - CollisionCount, */ \ + /* 583 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 579 - OverrunCount, */ \ + /* 591 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 587 - TimeSinceReset, */ \ + /* 599 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 595 - FeatureMap, */ \ + /* 607 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 599 - FeatureMap, */ \ + /* 611 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ + \ + /* 615 - Description, */ \ + 7, 'B', 'a', 't', 't', 'e', 'r', 'y', \ + \ + /* 623 - FeatureMap, */ \ + 0x0A, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (71) +#define GENERATED_DEFAULTS_COUNT (76) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -551,7 +589,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 150 +#define GENERATED_ATTRIBUTE_COUNT 167 #define GENERATED_ATTRIBUTES \ { \ \ @@ -578,23 +616,35 @@ { 0x000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ + /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Sources */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Power Source (server) */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* Status */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* Order */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_LONG_DEFAULTS_INDEX(4) }, /* Description */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(8) }, /* WiredAssessedCurrent */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(12) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4) }, /* Breadcrumb */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(12) }, /* BasicCommissioningInfoList */ \ + { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(16) }, /* Breadcrumb */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(24) }, /* BasicCommissioningInfoList */ \ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x0003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(266) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(278) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(270) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(274) }, /* UpTime */ \ - { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* TotalOperationalHours */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* UpTime */ \ + { 0x0003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(294) }, /* TotalOperationalHours */ \ { 0x0004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x0005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ { 0x0006, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ActiveRadioFaults */ \ @@ -603,23 +653,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* CurrentHeapFree */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(294) }, /* CurrentHeapUsed */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(302) }, /* CurrentHeapHighWatermark */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(310) }, /* FeatureMap */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(298) }, /* CurrentHeapFree */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(306) }, /* CurrentHeapUsed */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* CurrentHeapHighWatermark */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(322) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(326) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* ExtendedPanId */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* ExtendedPanId */ \ { 0x0005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* OverrunCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x0008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* PartitionId */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* PartitionId */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -632,50 +682,50 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* TxTotalCount */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* TxUnicastCount */ \ - { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* TxBroadcastCount */ \ - { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* TxAckRequestedCount */ \ - { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* TxAckedCount */ \ - { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* TxNoAckRequestedCount */ \ - { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* TxDataCount */ \ - { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* TxDataPollCount */ \ - { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(368) }, /* TxBeaconCount */ \ - { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* TxBeaconRequestCount */ \ - { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(376) }, /* TxOtherCount */ \ - { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* TxRetryCount */ \ - { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(384) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(388) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(392) }, /* TxErrCcaCount */ \ - { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(396) }, /* TxErrAbortCount */ \ - { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(400) }, /* TxErrBusyChannelCount */ \ - { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(404) }, /* RxTotalCount */ \ - { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(408) }, /* RxUnicastCount */ \ - { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* RxBroadcastCount */ \ - { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* RxDataCount */ \ - { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(420) }, /* RxDataPollCount */ \ - { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(424) }, /* RxBeaconCount */ \ - { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(428) }, /* RxBeaconRequestCount */ \ - { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(432) }, /* RxOtherCount */ \ - { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(436) }, /* RxAddressFilteredCount */ \ - { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(440) }, /* RxDestAddrFilteredCount */ \ - { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(444) }, /* RxDuplicatedCount */ \ - { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(448) }, /* RxErrNoFrameCount */ \ - { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(452) }, /* RxErrUnknownNeighborCount */ \ - { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(456) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(460) }, /* RxErrSecCount */ \ - { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(464) }, /* RxErrFcsCount */ \ - { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(468) }, /* RxErrOtherCount */ \ - { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(472) }, /* ActiveTimestamp */ \ - { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(480) }, /* PendingTimestamp */ \ - { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(488) }, /* delay */ \ + { 0x0016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* TxTotalCount */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* TxUnicastCount */ \ + { 0x0018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* TxBroadcastCount */ \ + { 0x0019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* TxAckRequestedCount */ \ + { 0x001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* TxAckedCount */ \ + { 0x001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(368) }, /* TxNoAckRequestedCount */ \ + { 0x001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* TxDataCount */ \ + { 0x001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(376) }, /* TxDataPollCount */ \ + { 0x001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* TxBeaconCount */ \ + { 0x001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(384) }, /* TxBeaconRequestCount */ \ + { 0x0020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(388) }, /* TxOtherCount */ \ + { 0x0021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(392) }, /* TxRetryCount */ \ + { 0x0022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(396) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(400) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x0024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(404) }, /* TxErrCcaCount */ \ + { 0x0025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(408) }, /* TxErrAbortCount */ \ + { 0x0026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* TxErrBusyChannelCount */ \ + { 0x0027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* RxTotalCount */ \ + { 0x0028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(420) }, /* RxUnicastCount */ \ + { 0x0029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(424) }, /* RxBroadcastCount */ \ + { 0x002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(428) }, /* RxDataCount */ \ + { 0x002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(432) }, /* RxDataPollCount */ \ + { 0x002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(436) }, /* RxBeaconCount */ \ + { 0x002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(440) }, /* RxBeaconRequestCount */ \ + { 0x002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(444) }, /* RxOtherCount */ \ + { 0x002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(448) }, /* RxAddressFilteredCount */ \ + { 0x0030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(452) }, /* RxDestAddrFilteredCount */ \ + { 0x0031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(456) }, /* RxDuplicatedCount */ \ + { 0x0032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(460) }, /* RxErrNoFrameCount */ \ + { 0x0033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(464) }, /* RxErrUnknownNeighborCount */ \ + { 0x0034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(468) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x0035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(472) }, /* RxErrSecCount */ \ + { 0x0036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(476) }, /* RxErrFcsCount */ \ + { 0x0037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(480) }, /* RxErrOtherCount */ \ + { 0x0038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(484) }, /* ActiveTimestamp */ \ + { 0x0039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(492) }, /* PendingTimestamp */ \ + { 0x003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(500) }, /* delay */ \ { 0x003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(492) }, /* ChannelMask */ \ + { 0x003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(504) }, /* ChannelMask */ \ { 0x003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(499) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(511) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -684,28 +734,28 @@ { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(503) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(507) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(511) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(515) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(519) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(523) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(527) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* OverrunCount */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(543) }, /* FeatureMap */ \ + { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(515) }, /* BeaconLostCount */ \ + { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(519) }, /* BeaconRxCount */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(523) }, /* PacketMulticastRxCount */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(527) }, /* PacketMulticastTxCount */ \ + { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(531) }, /* PacketUnicastRxCount */ \ + { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* PacketUnicastTxCount */ \ + { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(539) }, /* CurrentMaxRate */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(547) }, /* OverrunCount */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(555) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(547) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(555) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(571) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(579) }, /* OverrunCount */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(559) }, /* PacketRxCount */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(567) }, /* PacketTxCount */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(575) }, /* TxErrCount */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(583) }, /* CollisionCount */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(591) }, /* OverrunCount */ \ { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(587) }, /* TimeSinceReset */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(595) }, /* FeatureMap */ \ + { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(599) }, /* TimeSinceReset */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(607) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -727,7 +777,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(599) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(611) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ @@ -736,6 +786,17 @@ { 0x0002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ { 0x0003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Power Source (server) */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* Status */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* Order */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_LONG_DEFAULTS_INDEX(615) }, /* Description */ \ + { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ + { 0x000F, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryReplacementNeeded */ \ + { 0x0010, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryReplaceability */ \ + { 0x0013, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryReplacementDescription */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(623) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ } // This is an array of EmberAfCluster structures. @@ -751,7 +812,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 14 +#define GENERATED_CLUSTER_COUNT 17 #define GENERATED_CLUSTERS \ { \ { 0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ @@ -762,44 +823,53 @@ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(17), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(17), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ + { \ + 0x002F, ZAP_ATTRIBUTE_INDEX(19), 6, 73, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Power Source (server) */ \ + { \ + 0x0030, ZAP_ATTRIBUTE_INDEX(25), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(23), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(31), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(25), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(33), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(25), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(33), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(34), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(42), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(40), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(48), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(105), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(113), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(120), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(128), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(131), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(139), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(132), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(140), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(138), \ + ZAP_ATTRIBUTE_INDEX(146), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(145), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(153), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ + { \ + 0x002F, ZAP_ATTRIBUTE_INDEX(158), 9, 133, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Power Source (server) */ \ } #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) @@ -807,7 +877,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 12, 937 }, { ZAP_CLUSTER_INDEX(12), 2, 13 }, \ + { ZAP_CLUSTER_INDEX(0), 14, 1012 }, { ZAP_CLUSTER_INDEX(14), 3, 146 }, \ } // Largest attribute size is needed for various buffers @@ -817,7 +887,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (950) +#define ATTRIBUTE_MAX_SIZE (1158) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/lock-app/zap-generated/gen_config.h b/zzz_generated/lock-app/zap-generated/gen_config.h index c15ef08ab8f19b..ed7b14a9aa39f9 100644 --- a/zzz_generated/lock-app/zap-generated/gen_config.h +++ b/zzz_generated/lock-app/zap-generated/gen_config.h @@ -39,6 +39,8 @@ #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -95,6 +97,16 @@ #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS +// Use this macro to check if the server side of the Power Source cluster is included +#define ZCL_USING_POWER_SOURCE_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE + +// Use this macro to check if the server side of the Power Source Configuration cluster is included +#define ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE_CONFIGURATION_SERVER +#define EMBER_AF_PLUGIN_POWER_SOURCE_CONFIGURATION + // Use this macro to check if the server side of the Software Diagnostics cluster is included #define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER From 3a339bc944e0e4d5059a1cd4bbb464942c8cd5ad Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 3 Dec 2021 14:48:02 -0500 Subject: [PATCH 11/11] SetUpCodePairer: don't use DeviceDiscoveryDelegate (#12320) * SetUpCodePairer: don't use DeviceDiscoveryDelegate This class replaces the device discovery delegate that gets passed in in the commissioning parameters which will cause the original delegate to stop receiving callbacks if this class is used. Instead, just have the commissioner notify this class directly. The commissioner owns this part, so it doesn't need to use a derived delegate because we know what we're talking to. Also adding a discovery filter. This wasn't as necessary before because the class would stop receiving notifications by setting the delegate to null. However, that is still a race because it is possible to get spurious mdns responses. * Address review comments. * Add back define guard on dns-sd function. --- src/controller/CHIPDeviceController.cpp | 10 ++++++--- src/controller/CHIPDeviceController.h | 16 ++++++++------ src/controller/SetUpCodePairer.cpp | 29 ++++++++++++++++++++----- src/controller/SetUpCodePairer.h | 18 ++++++++------- 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 6d4857e02ba217..18b6cffd2fe5e7 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1608,18 +1608,22 @@ void DeviceCommissioner::OnUserDirectedCommissioningRequest(UDCClientState state ChipLogDetail(Controller, "------To Accept Enter: discover udc-commission "); } +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY + +#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD void DeviceCommissioner::OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) { +#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY if (mUdcServer != nullptr) { mUdcServer->OnCommissionableNodeFound(nodeData); } - +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY AbstractDnssdDiscoveryController::OnNodeDiscoveryComplete(nodeData); + mSetUpCodePairer.NotifyCommissionableDeviceDiscovered(nodeData); } - -#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY +#endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD void BasicSuccess(void * context, uint16_t val) { diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 998bfd9b5ffa75..346a36a304518d 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -629,20 +629,22 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, /** * @brief - * Overrides method from AbstractDnssdDiscoveryController - * - * @param nodeData DNS-SD node information + * Return the UDC Server instance * */ - void OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) override; + UserDirectedCommissioningServer * GetUserDirectedCommissioningServer() { return mUdcServer; } +#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY +#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD /** * @brief - * Return the UDC Server instance + * Overrides method from AbstractDnssdDiscoveryController + * + * @param nodeData DNS-SD node information * */ - UserDirectedCommissioningServer * GetUserDirectedCommissioningServer() { return mUdcServer; } -#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY + void OnNodeDiscoveryComplete(const chip::Dnssd::DiscoveredNodeData & nodeData) override; +#endif void RegisterPairingDelegate(DevicePairingDelegate * pairingDelegate) { mPairingDelegate = pairingDelegate; } diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index 6763e7aa946075..22f425bac3fa08 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -108,9 +108,9 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverBle() CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(uint16_t discriminator, bool isShort) { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - mCommissioner->RegisterDeviceDiscoveryDelegate(this); - Dnssd::DiscoveryFilter filter(isShort ? Dnssd::DiscoveryFilterType::kShort : Dnssd::DiscoveryFilterType::kLong, discriminator); - return mCommissioner->DiscoverCommissionableNodes(filter); + currentFilter.type = isShort ? Dnssd::DiscoveryFilterType::kShort : Dnssd::DiscoveryFilterType::kLong; + currentFilter.code = discriminator; + return mCommissioner->DiscoverCommissionableNodes(currentFilter); #else return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; #endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD @@ -119,7 +119,7 @@ CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(uint16_t discriminator, bool isS CHIP_ERROR SetUpCodePairer::StopConnectOverIP() { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - mCommissioner->RegisterDeviceDiscoveryDelegate(nullptr); + currentFilter.type = Dnssd::DiscoveryFilterType::kNone; #endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD return CHIP_NO_ERROR; } @@ -162,8 +162,27 @@ void SetUpCodePairer::OnDiscoveredDeviceOverBleError(void * appState, CHIP_ERROR #endif // CONFIG_NETWORK_LAYER_BLE #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD -void SetUpCodePairer::OnDiscoveredDevice(const Dnssd::DiscoveredNodeData & nodeData) + +bool SetUpCodePairer::NodeMatchesCurrentFilter(const Dnssd::DiscoveredNodeData & nodeData) +{ + switch (currentFilter.type) + { + case Dnssd::DiscoveryFilterType::kShort: + return ((nodeData.longDiscriminator >> 8) & 0x0F) == currentFilter.code; + case Dnssd::DiscoveryFilterType::kLong: + return nodeData.longDiscriminator == currentFilter.code; + default: + return false; + } + return false; +} + +void SetUpCodePairer::NotifyCommissionableDeviceDiscovered(const Dnssd::DiscoveredNodeData & nodeData) { + if (!NodeMatchesCurrentFilter(nodeData)) + { + return; + } LogErrorOnFailure(StopConnectOverBle()); LogErrorOnFailure(StopConnectOverIP()); LogErrorOnFailure(StopConnectOverSoftAP()); diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index a55fe61ecb6b5f..3b72831a331164 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -48,9 +48,6 @@ namespace Controller { class DeviceCommissioner; class DLL_EXPORT SetUpCodePairer -#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - : public DeviceDiscoveryDelegate -#endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD { public: SetUpCodePairer(DeviceCommissioner * commissioner) : mCommissioner(commissioner) {} @@ -58,6 +55,11 @@ class DLL_EXPORT SetUpCodePairer CHIP_ERROR PairDevice(chip::NodeId remoteId, const char * setUpCode); +// Called by the DeviceCommissioner to notify that we have discovered a new device. +#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD + void NotifyCommissionableDeviceDiscovered(const chip::Dnssd::DiscoveredNodeData & nodeData); +#endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD + #if CONFIG_NETWORK_LAYER_BLE void SetBleLayer(Ble::BleLayer * bleLayer) { mBleLayer = bleLayer; }; #endif // CONFIG_NETWORK_LAYER_BLE @@ -73,11 +75,6 @@ class DLL_EXPORT SetUpCodePairer void OnDeviceDiscovered(RendezvousParameters & params); -#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - /////////// DeviceDiscoveryDelegate Interface ///////// - void OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData) override; -#endif // CHIP_DEVICE_CONFIG_ENABLE_DNSSD - #if CONFIG_NETWORK_LAYER_BLE Ble::BleLayer * mBleLayer = nullptr; void OnDiscoveredDeviceOverBle(BLE_CONNECTION_OBJECT connObj); @@ -86,6 +83,11 @@ class DLL_EXPORT SetUpCodePairer static void OnDiscoveredDeviceOverBleError(void * appState, CHIP_ERROR err); #endif // CONFIG_NETWORK_LAYER_BLE +#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD + bool NodeMatchesCurrentFilter(const Dnssd::DiscoveredNodeData & nodeData); + Dnssd::DiscoveryFilter currentFilter; +#endif + DeviceCommissioner * mCommissioner = nullptr; chip::NodeId mRemoteId; uint32_t mSetUpPINCode = 0;