| /* |
| * |
| * Copyright (c) 2022 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 <app-common/zap-generated/cluster-objects.h> |
| |
| namespace chip { |
| namespace app { |
| namespace Clusters { |
| |
| namespace detail { |
| // Structs shared across multiple clusters. |
| namespace Structs { |
| namespace ApplicationStruct { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorID)), catalogVendorID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationID)), applicationID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| err = reader.EnterContainer(outer); |
| ReturnErrorOnFailure(err); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kCatalogVendorID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorID)); |
| break; |
| case to_underlying(Fields::kApplicationID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, applicationID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| |
| return CHIP_NO_ERROR; |
| } |
| |
| } // namespace ApplicationStruct |
| namespace LabelStruct { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| err = reader.EnterContainer(outer); |
| ReturnErrorOnFailure(err); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kLabel): |
| ReturnErrorOnFailure(DataModel::Decode(reader, label)); |
| break; |
| case to_underlying(Fields::kValue): |
| ReturnErrorOnFailure(DataModel::Decode(reader, value)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| |
| return CHIP_NO_ERROR; |
| } |
| |
| } // namespace LabelStruct |
| } // namespace Structs |
| } // namespace detail |
| |
| namespace Identify { |
| |
| namespace Commands { |
| namespace Identify { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIdentifyTime)), identifyTime)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kIdentifyTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, identifyTime)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Identify. |
| namespace TriggerEffect { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEffectIdentifier)), effectIdentifier)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEffectVariant)), effectVariant)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kEffectIdentifier): |
| ReturnErrorOnFailure(DataModel::Decode(reader, effectIdentifier)); |
| break; |
| case to_underlying(Fields::kEffectVariant): |
| ReturnErrorOnFailure(DataModel::Decode(reader, effectVariant)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace TriggerEffect. |
| } // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::IdentifyTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, identifyTime)); |
| break; |
| case Attributes::IdentifyType::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, identifyType)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace Identify |
| namespace Groups { |
| |
| namespace Commands { |
| namespace AddGroup { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupName)), groupName)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kGroupName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupName)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace AddGroup. |
| namespace AddGroupResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace AddGroupResponse. |
| namespace ViewGroup { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace ViewGroup. |
| namespace ViewGroupResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupName)), groupName)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kGroupName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupName)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace ViewGroupResponse. |
| namespace GetGroupMembership { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupList)), groupList)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupList): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupList)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace GetGroupMembership. |
| namespace GetGroupMembershipResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCapacity)), capacity)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupList)), groupList)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kCapacity): |
| ReturnErrorOnFailure(DataModel::Decode(reader, capacity)); |
| break; |
| case to_underlying(Fields::kGroupList): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupList)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace GetGroupMembershipResponse. |
| namespace RemoveGroup { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveGroup. |
| namespace RemoveGroupResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveGroupResponse. |
| namespace RemoveAllGroups { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveAllGroups. |
| namespace AddGroupIfIdentifying { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupName)), groupName)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kGroupName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupName)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace AddGroupIfIdentifying. |
| } // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::NameSupport::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, nameSupport)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace Groups |
| namespace Scenes { |
| namespace Structs { |
| namespace AttributeValuePair { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAttributeID)), attributeID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAttributeValue)), attributeValue)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| err = reader.EnterContainer(outer); |
| ReturnErrorOnFailure(err); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kAttributeID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeID)); |
| break; |
| case to_underlying(Fields::kAttributeValue): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeValue)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| |
| return CHIP_NO_ERROR; |
| } |
| |
| } // namespace AttributeValuePair |
| namespace ExtensionFieldSet { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClusterID)), clusterID)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAttributeValueList)), attributeValueList)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| err = reader.EnterContainer(outer); |
| ReturnErrorOnFailure(err); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kClusterID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterID)); |
| break; |
| case to_underlying(Fields::kAttributeValueList): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeValueList)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| |
| return CHIP_NO_ERROR; |
| } |
| |
| } // namespace ExtensionFieldSet |
| } // namespace Structs |
| |
| namespace Commands { |
| namespace AddScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneName)), sceneName)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtensionFieldSets)), extensionFieldSets)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kSceneName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneName)); |
| break; |
| case to_underlying(Fields::kExtensionFieldSets): |
| ReturnErrorOnFailure(DataModel::Decode(reader, extensionFieldSets)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace AddScene. |
| namespace AddSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace AddSceneResponse. |
| namespace ViewScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace ViewScene. |
| namespace ViewSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneName)), sceneName)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtensionFieldSets)), extensionFieldSets)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kSceneName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneName)); |
| break; |
| case to_underlying(Fields::kExtensionFieldSets): |
| ReturnErrorOnFailure(DataModel::Decode(reader, extensionFieldSets)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace ViewSceneResponse. |
| namespace RemoveScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveScene. |
| namespace RemoveSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveSceneResponse. |
| namespace RemoveAllScenes { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveAllScenes. |
| namespace RemoveAllScenesResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RemoveAllScenesResponse. |
| namespace StoreScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace StoreScene. |
| namespace StoreSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace StoreSceneResponse. |
| namespace RecallScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace RecallScene. |
| namespace GetSceneMembership { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace GetSceneMembership. |
| namespace GetSceneMembershipResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCapacity)), capacity)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneList)), sceneList)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kCapacity): |
| ReturnErrorOnFailure(DataModel::Decode(reader, capacity)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneList): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneList)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace GetSceneMembershipResponse. |
| namespace EnhancedAddScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneName)), sceneName)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtensionFieldSets)), extensionFieldSets)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kSceneName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneName)); |
| break; |
| case to_underlying(Fields::kExtensionFieldSets): |
| ReturnErrorOnFailure(DataModel::Decode(reader, extensionFieldSets)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace EnhancedAddScene. |
| namespace EnhancedAddSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace EnhancedAddSceneResponse. |
| namespace EnhancedViewScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace EnhancedViewScene. |
| namespace EnhancedViewSceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupID)), groupID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneID)), sceneID)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneName)), sceneName)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtensionFieldSets)), extensionFieldSets)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupID)); |
| break; |
| case to_underlying(Fields::kSceneID): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneID)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kSceneName): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneName)); |
| break; |
| case to_underlying(Fields::kExtensionFieldSets): |
| ReturnErrorOnFailure(DataModel::Decode(reader, extensionFieldSets)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace EnhancedViewSceneResponse. |
| namespace CopyScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMode)), mode)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupIdentifierFrom)), groupIdentifierFrom)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneIdentifierFrom)), sceneIdentifierFrom)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupIdentifierTo)), groupIdentifierTo)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneIdentifierTo)), sceneIdentifierTo)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kMode): |
| ReturnErrorOnFailure(DataModel::Decode(reader, mode)); |
| break; |
| case to_underlying(Fields::kGroupIdentifierFrom): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupIdentifierFrom)); |
| break; |
| case to_underlying(Fields::kSceneIdentifierFrom): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneIdentifierFrom)); |
| break; |
| case to_underlying(Fields::kGroupIdentifierTo): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupIdentifierTo)); |
| break; |
| case to_underlying(Fields::kSceneIdentifierTo): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneIdentifierTo)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace CopyScene. |
| namespace CopySceneResponse { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupIdentifierFrom)), groupIdentifierFrom)); |
| ReturnErrorOnFailure( |
| DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSceneIdentifierFrom)), sceneIdentifierFrom)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStatus): |
| ReturnErrorOnFailure(DataModel::Decode(reader, status)); |
| break; |
| case to_underlying(Fields::kGroupIdentifierFrom): |
| ReturnErrorOnFailure(DataModel::Decode(reader, groupIdentifierFrom)); |
| break; |
| case to_underlying(Fields::kSceneIdentifierFrom): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneIdentifierFrom)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace CopySceneResponse. |
| } // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::SceneCount::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneCount)); |
| break; |
| case Attributes::CurrentScene::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, currentScene)); |
| break; |
| case Attributes::CurrentGroup::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, currentGroup)); |
| break; |
| case Attributes::SceneValid::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, sceneValid)); |
| break; |
| case Attributes::NameSupport::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, nameSupport)); |
| break; |
| case Attributes::LastConfiguredBy::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, lastConfiguredBy)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace Scenes |
| namespace OnOff { |
| |
| namespace Commands { |
| namespace Off { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Off. |
| namespace On { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace On. |
| namespace Toggle { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Toggle. |
| namespace OffWithEffect { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEffectIdentifier)), effectIdentifier)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEffectVariant)), effectVariant)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kEffectIdentifier): |
| ReturnErrorOnFailure(DataModel::Decode(reader, effectIdentifier)); |
| break; |
| case to_underlying(Fields::kEffectVariant): |
| ReturnErrorOnFailure(DataModel::Decode(reader, effectVariant)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace OffWithEffect. |
| namespace OnWithRecallGlobalScene { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace OnWithRecallGlobalScene. |
| namespace OnWithTimedOff { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOnOffControl)), onOffControl)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOnTime)), onTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOffWaitTime)), offWaitTime)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kOnOffControl): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onOffControl)); |
| break; |
| case to_underlying(Fields::kOnTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onTime)); |
| break; |
| case to_underlying(Fields::kOffWaitTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, offWaitTime)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace OnWithTimedOff. |
| } // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::OnOff::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onOff)); |
| break; |
| case Attributes::GlobalSceneControl::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, globalSceneControl)); |
| break; |
| case Attributes::OnTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onTime)); |
| break; |
| case Attributes::OffWaitTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, offWaitTime)); |
| break; |
| case Attributes::StartUpOnOff::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, startUpOnOff)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace OnOff |
| namespace OnOffSwitchConfiguration { |
| |
| namespace Commands {} // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::SwitchType::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, switchType)); |
| break; |
| case Attributes::SwitchActions::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, switchActions)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace OnOffSwitchConfiguration |
| namespace LevelControl { |
| |
| namespace Commands { |
| namespace MoveToLevel { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLevel)), level)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kLevel): |
| ReturnErrorOnFailure(DataModel::Decode(reader, level)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace MoveToLevel. |
| namespace Move { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMoveMode)), moveMode)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kRate)), rate)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kMoveMode): |
| ReturnErrorOnFailure(DataModel::Decode(reader, moveMode)); |
| break; |
| case to_underlying(Fields::kRate): |
| ReturnErrorOnFailure(DataModel::Decode(reader, rate)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Move. |
| namespace Step { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStepMode)), stepMode)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStepSize)), stepSize)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStepMode): |
| ReturnErrorOnFailure(DataModel::Decode(reader, stepMode)); |
| break; |
| case to_underlying(Fields::kStepSize): |
| ReturnErrorOnFailure(DataModel::Decode(reader, stepSize)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Step. |
| namespace Stop { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Stop. |
| namespace MoveToLevelWithOnOff { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLevel)), level)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kLevel): |
| ReturnErrorOnFailure(DataModel::Decode(reader, level)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace MoveToLevelWithOnOff. |
| namespace MoveWithOnOff { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMoveMode)), moveMode)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kRate)), rate)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kMoveMode): |
| ReturnErrorOnFailure(DataModel::Decode(reader, moveMode)); |
| break; |
| case to_underlying(Fields::kRate): |
| ReturnErrorOnFailure(DataModel::Decode(reader, rate)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace MoveWithOnOff. |
| namespace StepWithOnOff { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStepMode)), stepMode)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStepSize)), stepSize)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTransitionTime)), transitionTime)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kStepMode): |
| ReturnErrorOnFailure(DataModel::Decode(reader, stepMode)); |
| break; |
| case to_underlying(Fields::kStepSize): |
| ReturnErrorOnFailure(DataModel::Decode(reader, stepSize)); |
| break; |
| case to_underlying(Fields::kTransitionTime): |
| ReturnErrorOnFailure(DataModel::Decode(reader, transitionTime)); |
| break; |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace StepWithOnOff. |
| namespace StopWithOnOff { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsMask)), optionsMask)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionsOverride)), optionsOverride)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kOptionsMask): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsMask)); |
| break; |
| case to_underlying(Fields::kOptionsOverride): |
| ReturnErrorOnFailure(DataModel::Decode(reader, optionsOverride)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace StopWithOnOff. |
| namespace MoveToClosestFrequency { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFrequency)), frequency)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| ReturnErrorOnFailure(reader.EnterContainer(outer)); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kFrequency): |
| ReturnErrorOnFailure(DataModel::Decode(reader, frequency)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| } // namespace MoveToClosestFrequency. |
| } // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::CurrentLevel::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, currentLevel)); |
| break; |
| case Attributes::RemainingTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, remainingTime)); |
| break; |
| case Attributes::MinLevel::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, minLevel)); |
| break; |
| case Attributes::MaxLevel::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, maxLevel)); |
| break; |
| case Attributes::CurrentFrequency::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, currentFrequency)); |
| break; |
| case Attributes::MinFrequency::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, minFrequency)); |
| break; |
| case Attributes::MaxFrequency::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, maxFrequency)); |
| break; |
| case Attributes::Options::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, options)); |
| break; |
| case Attributes::OnOffTransitionTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onOffTransitionTime)); |
| break; |
| case Attributes::OnLevel::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onLevel)); |
| break; |
| case Attributes::OnTransitionTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, onTransitionTime)); |
| break; |
| case Attributes::OffTransitionTime::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, offTransitionTime)); |
| break; |
| case Attributes::DefaultMoveRate::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, defaultMoveRate)); |
| break; |
| case Attributes::StartUpCurrentLevel::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, startUpCurrentLevel)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace LevelControl |
| namespace BinaryInputBasic { |
| |
| namespace Commands {} // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::ActiveText::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, activeText)); |
| break; |
| case Attributes::Description::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, description)); |
| break; |
| case Attributes::InactiveText::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, inactiveText)); |
| break; |
| case Attributes::OutOfService::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, outOfService)); |
| break; |
| case Attributes::Polarity::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, polarity)); |
| break; |
| case Attributes::PresentValue::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, presentValue)); |
| break; |
| case Attributes::Reliability::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, reliability)); |
| break; |
| case Attributes::StatusFlags::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, statusFlags)); |
| break; |
| case Attributes::ApplicationType::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, applicationType)); |
| break; |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace BinaryInputBasic |
| namespace PulseWidthModulation { |
| |
| namespace Commands {} // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); |
| break; |
| case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); |
| break; |
| case Attributes::AttributeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); |
| break; |
| case Attributes::FeatureMap::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); |
| break; |
| case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); |
| break; |
| default: |
| break; |
| } |
| |
| return CHIP_NO_ERROR; |
| } |
| } // namespace Attributes |
| |
| namespace Events {} // namespace Events |
| |
| } // namespace PulseWidthModulation |
| namespace Descriptor { |
| namespace Structs { |
| namespace DeviceTypeStruct { |
| CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const |
| { |
| TLV::TLVType outer; |
| ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDeviceType)), deviceType)); |
| ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kRevision)), revision)); |
| ReturnErrorOnFailure(writer.EndContainer(outer)); |
| return CHIP_NO_ERROR; |
| } |
| |
| CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
| { |
| CHIP_ERROR err = CHIP_NO_ERROR; |
| TLV::TLVType outer; |
| VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); |
| err = reader.EnterContainer(outer); |
| ReturnErrorOnFailure(err); |
| while ((err = reader.Next()) == CHIP_NO_ERROR) |
| { |
| if (!TLV::IsContextTag(reader.GetTag())) |
| { |
| continue; |
| } |
| switch (TLV::TagNumFromTag(reader.GetTag())) |
| { |
| case to_underlying(Fields::kDeviceType): |
| ReturnErrorOnFailure(DataModel::Decode(reader, deviceType)); |
| break; |
| case to_underlying(Fields::kRevision): |
| ReturnErrorOnFailure(DataModel::Decode(reader, revision)); |
| break; |
| default: |
| break; |
| } |
| } |
| |
| VerifyOrReturnError(err == CHIP_END_OF_TLV, err); |
| ReturnErrorOnFailure(reader.ExitContainer(outer)); |
| |
| return CHIP_NO_ERROR; |
| } |
| |
| } // namespace DeviceTypeStruct |
| } // namespace Structs |
| |
| namespace Commands {} // namespace Commands |
| |
| namespace Attributes { |
| CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) |
| { |
| switch (path.mAttributeId) |
| { |
| case Attributes::DeviceTypeList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, deviceTypeList)); |
| break; |
| case Attributes::ServerList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, serverList)); |
| break; |
| case Attributes::ClientList::TypeInfo::GetAttributeId(): |
| ReturnErrorOnFailure(DataModel::Decode(reader, clientList)); |
| break; |
|