/src/connectedhomeip/zzz_generated/app-common/clusters/GeneralDiagnostics/Structs.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-Structs.ipp.zapt |
20 | | |
21 | | #include <clusters/GeneralDiagnostics/Structs.h> |
22 | | |
23 | | #include <app/data-model/StructDecodeIterator.h> |
24 | | #include <app/data-model/WrappedStructEncoder.h> |
25 | | |
26 | | namespace chip { |
27 | | namespace app { |
28 | | namespace Clusters { |
29 | | namespace GeneralDiagnostics { |
30 | | namespace Structs { |
31 | | |
32 | | namespace DeviceLoadStruct { |
33 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
34 | 0 | { |
35 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
36 | 0 | encoder.Encode(to_underlying(Fields::kCurrentSubscriptions), currentSubscriptions); |
37 | 0 | encoder.Encode(to_underlying(Fields::kCurrentSubscriptionsForFabric), currentSubscriptionsForFabric); |
38 | 0 | encoder.Encode(to_underlying(Fields::kTotalSubscriptionsEstablished), totalSubscriptionsEstablished); |
39 | 0 | encoder.Encode(to_underlying(Fields::kTotalInteractionModelMessagesSent), totalInteractionModelMessagesSent); |
40 | 0 | encoder.Encode(to_underlying(Fields::kTotalInteractionModelMessagesReceived), totalInteractionModelMessagesReceived); |
41 | 0 | return encoder.Finalize(); |
42 | 0 | } |
43 | | |
44 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
45 | 0 | { |
46 | 0 | detail::StructDecodeIterator __iterator(reader); |
47 | 0 | while (true) |
48 | 0 | { |
49 | 0 | uint8_t __context_tag = 0; |
50 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
51 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
52 | 0 | ReturnErrorOnFailure(err); |
53 | | |
54 | 0 | if (__context_tag == to_underlying(Fields::kCurrentSubscriptions)) |
55 | 0 | { |
56 | 0 | err = DataModel::Decode(reader, currentSubscriptions); |
57 | 0 | } |
58 | 0 | else if (__context_tag == to_underlying(Fields::kCurrentSubscriptionsForFabric)) |
59 | 0 | { |
60 | 0 | err = DataModel::Decode(reader, currentSubscriptionsForFabric); |
61 | 0 | } |
62 | 0 | else if (__context_tag == to_underlying(Fields::kTotalSubscriptionsEstablished)) |
63 | 0 | { |
64 | 0 | err = DataModel::Decode(reader, totalSubscriptionsEstablished); |
65 | 0 | } |
66 | 0 | else if (__context_tag == to_underlying(Fields::kTotalInteractionModelMessagesSent)) |
67 | 0 | { |
68 | 0 | err = DataModel::Decode(reader, totalInteractionModelMessagesSent); |
69 | 0 | } |
70 | 0 | else if (__context_tag == to_underlying(Fields::kTotalInteractionModelMessagesReceived)) |
71 | 0 | { |
72 | 0 | err = DataModel::Decode(reader, totalInteractionModelMessagesReceived); |
73 | 0 | } |
74 | |
|
75 | 0 | ReturnErrorOnFailure(err); |
76 | 0 | } |
77 | 0 | } |
78 | | |
79 | | } // namespace DeviceLoadStruct |
80 | | |
81 | | namespace NetworkInterface { |
82 | | CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const |
83 | 0 | { |
84 | 0 | DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; |
85 | 0 | encoder.Encode(to_underlying(Fields::kName), name); |
86 | 0 | encoder.Encode(to_underlying(Fields::kIsOperational), isOperational); |
87 | 0 | encoder.Encode(to_underlying(Fields::kOffPremiseServicesReachableIPv4), offPremiseServicesReachableIPv4); |
88 | 0 | encoder.Encode(to_underlying(Fields::kOffPremiseServicesReachableIPv6), offPremiseServicesReachableIPv6); |
89 | 0 | encoder.Encode(to_underlying(Fields::kHardwareAddress), hardwareAddress); |
90 | 0 | encoder.Encode(to_underlying(Fields::kIPv4Addresses), IPv4Addresses); |
91 | 0 | encoder.Encode(to_underlying(Fields::kIPv6Addresses), IPv6Addresses); |
92 | 0 | encoder.Encode(to_underlying(Fields::kType), type); |
93 | 0 | return encoder.Finalize(); |
94 | 0 | } |
95 | | |
96 | | CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) |
97 | 0 | { |
98 | 0 | detail::StructDecodeIterator __iterator(reader); |
99 | 0 | while (true) |
100 | 0 | { |
101 | 0 | uint8_t __context_tag = 0; |
102 | 0 | CHIP_ERROR err = __iterator.Next(__context_tag); |
103 | 0 | VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); |
104 | 0 | ReturnErrorOnFailure(err); |
105 | | |
106 | 0 | if (__context_tag == to_underlying(Fields::kName)) |
107 | 0 | { |
108 | 0 | err = DataModel::Decode(reader, name); |
109 | 0 | } |
110 | 0 | else if (__context_tag == to_underlying(Fields::kIsOperational)) |
111 | 0 | { |
112 | 0 | err = DataModel::Decode(reader, isOperational); |
113 | 0 | } |
114 | 0 | else if (__context_tag == to_underlying(Fields::kOffPremiseServicesReachableIPv4)) |
115 | 0 | { |
116 | 0 | err = DataModel::Decode(reader, offPremiseServicesReachableIPv4); |
117 | 0 | } |
118 | 0 | else if (__context_tag == to_underlying(Fields::kOffPremiseServicesReachableIPv6)) |
119 | 0 | { |
120 | 0 | err = DataModel::Decode(reader, offPremiseServicesReachableIPv6); |
121 | 0 | } |
122 | 0 | else if (__context_tag == to_underlying(Fields::kHardwareAddress)) |
123 | 0 | { |
124 | 0 | err = DataModel::Decode(reader, hardwareAddress); |
125 | 0 | } |
126 | 0 | else if (__context_tag == to_underlying(Fields::kIPv4Addresses)) |
127 | 0 | { |
128 | 0 | err = DataModel::Decode(reader, IPv4Addresses); |
129 | 0 | } |
130 | 0 | else if (__context_tag == to_underlying(Fields::kIPv6Addresses)) |
131 | 0 | { |
132 | 0 | err = DataModel::Decode(reader, IPv6Addresses); |
133 | 0 | } |
134 | 0 | else if (__context_tag == to_underlying(Fields::kType)) |
135 | 0 | { |
136 | 0 | err = DataModel::Decode(reader, type); |
137 | 0 | } |
138 | |
|
139 | 0 | ReturnErrorOnFailure(err); |
140 | 0 | } |
141 | 0 | } |
142 | | |
143 | | } // namespace NetworkInterface |
144 | | } // namespace Structs |
145 | | } // namespace GeneralDiagnostics |
146 | | } // namespace Clusters |
147 | | } // namespace app |
148 | | } // namespace chip |