/src/connectedhomeip/zzz_generated/app-common/clusters/UnitTesting/Events.ipp
Line | Count | Source |
1 | | /* |
2 | | * |
3 | | * Copyright (c) 2022 Project CHIP Authors |
4 | | * |
5 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | * you may not use this file except in compliance with the License. |
7 | | * You may obtain a copy of the License at |
8 | | * |
9 | | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | * |
11 | | * Unless required by applicable law or agreed to in writing, software |
12 | | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | * See the License for the specific language governing permissions and |
15 | | * limitations under the License. |
16 | | */ |
17 | | |
18 | | // THIS FILE IS GENERATED BY ZAP |
19 | | // This file is generated from clusters-Events.ipp.zapt |
20 | | |
21 | | #include <clusters/UnitTesting/Events.h> |
22 | | |
23 | | #include <app/data-model/Decode.h> |
24 | | #include <app/data-model/Encode.h> |
25 | | #include <app/data-model/StructDecodeIterator.h> |
26 | | #include <app/data-model/WrappedStructEncoder.h> |
27 | | |
28 | | namespace chip { |
29 | | namespace app { |
30 | | namespace Clusters { |
31 | | namespace UnitTesting { |
32 | | namespace Events { |
33 | | namespace TestEvent { |
34 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
35 | 0 | { |
36 | 0 | TLV::TLVType outer; |
37 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
38 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg1), arg1)); |
39 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg2), arg2)); |
40 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg3), arg3)); |
41 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg4), arg4)); |
42 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg5), arg5)); |
43 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg6), arg6)); |
44 | 0 | return aWriter.EndContainer(outer); |
45 | 0 | } |
46 | | |
47 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
48 | 0 | { |
49 | 0 | detail::StructDecodeIterator __iterator(reader); |
50 | 0 | while (true) |
51 | 0 | { |
52 | 0 | uint8_t __context_tag = 0; |
53 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
54 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
55 | 0 | ReturnErrorOnFailure(err); |
56 | | |
57 | 0 | if (__context_tag == to_underlying(Fields::kArg1)) |
58 | 0 | { |
59 | 0 | err = DataModel::Decode(reader, arg1); |
60 | 0 | } |
61 | 0 | else if (__context_tag == to_underlying(Fields::kArg2)) |
62 | 0 | { |
63 | 0 | err = DataModel::Decode(reader, arg2); |
64 | 0 | } |
65 | 0 | else if (__context_tag == to_underlying(Fields::kArg3)) |
66 | 0 | { |
67 | 0 | err = DataModel::Decode(reader, arg3); |
68 | 0 | } |
69 | 0 | else if (__context_tag == to_underlying(Fields::kArg4)) |
70 | 0 | { |
71 | 0 | err = DataModel::Decode(reader, arg4); |
72 | 0 | } |
73 | 0 | else if (__context_tag == to_underlying(Fields::kArg5)) |
74 | 0 | { |
75 | 0 | err = DataModel::Decode(reader, arg5); |
76 | 0 | } |
77 | 0 | else if (__context_tag == to_underlying(Fields::kArg6)) |
78 | 0 | { |
79 | 0 | err = DataModel::Decode(reader, arg6); |
80 | 0 | } |
81 | 0 | else |
82 | 0 | { |
83 | 0 | } |
84 | |
|
85 | 0 | ReturnErrorOnFailure(err); |
86 | 0 | } |
87 | 0 | } |
88 | | } // namespace TestEvent |
89 | | namespace TestFabricScopedEvent { |
90 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
91 | 0 | { |
92 | 0 | TLV::TLVType outer; |
93 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
94 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFabricIndex), fabricIndex)); |
95 | 0 | return aWriter.EndContainer(outer); |
96 | 0 | } |
97 | | |
98 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
99 | 0 | { |
100 | 0 | detail::StructDecodeIterator __iterator(reader); |
101 | 0 | while (true) |
102 | 0 | { |
103 | 0 | uint8_t __context_tag = 0; |
104 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
105 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
106 | 0 | ReturnErrorOnFailure(err); |
107 | | |
108 | 0 | if (__context_tag == to_underlying(Fields::kFabricIndex)) |
109 | 0 | { |
110 | 0 | err = DataModel::Decode(reader, fabricIndex); |
111 | 0 | } |
112 | 0 | else |
113 | 0 | { |
114 | 0 | } |
115 | |
|
116 | 0 | ReturnErrorOnFailure(err); |
117 | 0 | } |
118 | 0 | } |
119 | | } // namespace TestFabricScopedEvent |
120 | | namespace TestDifferentVendorMeiEvent { |
121 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
122 | 0 | { |
123 | 0 | TLV::TLVType outer; |
124 | 0 | ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); |
125 | 0 | ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg1), arg1)); |
126 | 0 | return aWriter.EndContainer(outer); |
127 | 0 | } |
128 | | |
129 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
130 | 0 | { |
131 | 0 | detail::StructDecodeIterator __iterator(reader); |
132 | 0 | while (true) |
133 | 0 | { |
134 | 0 | uint8_t __context_tag = 0; |
135 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
136 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
137 | 0 | ReturnErrorOnFailure(err); |
138 | | |
139 | 0 | if (__context_tag == to_underlying(Fields::kArg1)) |
140 | 0 | { |
141 | 0 | err = DataModel::Decode(reader, arg1); |
142 | 0 | } |
143 | 0 | else |
144 | 0 | { |
145 | 0 | } |
146 | |
|
147 | 0 | ReturnErrorOnFailure(err); |
148 | 0 | } |
149 | 0 | } |
150 | | } // namespace TestDifferentVendorMeiEvent |
151 | | } // namespace Events |
152 | | } // namespace UnitTesting |
153 | | } // namespace Clusters |
154 | | } // namespace app |
155 | | } // namespace chip |