Coverage Report

Created: 2025-06-20 06:55

/src/connectedhomeip/zzz_generated/app-common/clusters/CameraAvSettingsUserLevelManagement/Structs.ipp
Line
Count
Source (jump to first uncovered line)
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/CameraAvSettingsUserLevelManagement/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 CameraAvSettingsUserLevelManagement {
30
namespace Structs {
31
32
namespace MPTZStruct {
33
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
34
3
{
35
3
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
36
3
    encoder.Encode(to_underlying(Fields::kPan), pan);
37
3
    encoder.Encode(to_underlying(Fields::kTilt), tilt);
38
3
    encoder.Encode(to_underlying(Fields::kZoom), zoom);
39
3
    return encoder.Finalize();
40
3
}
41
42
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
43
1
{
44
1
    detail::StructDecodeIterator __iterator(reader);
45
4
    while (true)
46
4
    {
47
4
        uint8_t __context_tag = 0;
48
4
        CHIP_ERROR err        = __iterator.Next(__context_tag);
49
4
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
50
3
        ReturnErrorOnFailure(err);
51
52
3
        if (__context_tag == to_underlying(Fields::kPan))
53
1
        {
54
1
            err = DataModel::Decode(reader, pan);
55
1
        }
56
2
        else if (__context_tag == to_underlying(Fields::kTilt))
57
1
        {
58
1
            err = DataModel::Decode(reader, tilt);
59
1
        }
60
1
        else if (__context_tag == to_underlying(Fields::kZoom))
61
1
        {
62
1
            err = DataModel::Decode(reader, zoom);
63
1
        }
64
65
3
        ReturnErrorOnFailure(err);
66
3
    }
67
1
}
68
69
} // namespace MPTZStruct
70
71
namespace MPTZPresetStruct {
72
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
73
0
{
74
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
75
0
    encoder.Encode(to_underlying(Fields::kPresetID), presetID);
76
0
    encoder.Encode(to_underlying(Fields::kName), name);
77
0
    encoder.Encode(to_underlying(Fields::kSettings), settings);
78
0
    return encoder.Finalize();
79
0
}
80
81
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
82
0
{
83
0
    detail::StructDecodeIterator __iterator(reader);
84
0
    while (true)
85
0
    {
86
0
        uint8_t __context_tag = 0;
87
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
88
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
89
0
        ReturnErrorOnFailure(err);
90
91
0
        if (__context_tag == to_underlying(Fields::kPresetID))
92
0
        {
93
0
            err = DataModel::Decode(reader, presetID);
94
0
        }
95
0
        else if (__context_tag == to_underlying(Fields::kName))
96
0
        {
97
0
            err = DataModel::Decode(reader, name);
98
0
        }
99
0
        else if (__context_tag == to_underlying(Fields::kSettings))
100
0
        {
101
0
            err = DataModel::Decode(reader, settings);
102
0
        }
103
104
0
        ReturnErrorOnFailure(err);
105
0
    }
106
0
}
107
108
} // namespace MPTZPresetStruct
109
110
namespace DPTZStruct {
111
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
112
0
{
113
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
114
0
    encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID);
115
0
    encoder.Encode(to_underlying(Fields::kViewport), viewport);
116
0
    return encoder.Finalize();
117
0
}
118
119
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
120
0
{
121
0
    detail::StructDecodeIterator __iterator(reader);
122
0
    while (true)
123
0
    {
124
0
        uint8_t __context_tag = 0;
125
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
126
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
127
0
        ReturnErrorOnFailure(err);
128
129
0
        if (__context_tag == to_underlying(Fields::kVideoStreamID))
130
0
        {
131
0
            err = DataModel::Decode(reader, videoStreamID);
132
0
        }
133
0
        else if (__context_tag == to_underlying(Fields::kViewport))
134
0
        {
135
0
            err = DataModel::Decode(reader, viewport);
136
0
        }
137
138
0
        ReturnErrorOnFailure(err);
139
0
    }
140
0
}
141
142
} // namespace DPTZStruct
143
} // namespace Structs
144
} // namespace CameraAvSettingsUserLevelManagement
145
} // namespace Clusters
146
} // namespace app
147
} // namespace chip