1+ // MatterDotNet Copyright (C) 2024
2+ //
3+ // This program is free software: you can redistribute it and/or modify
4+ // it under the terms of the GNU Affero General Public License as published by
5+ // the Free Software Foundation, either version 3 of the License, or any later version.
6+ // This program is distributed in the hope that it will be useful,
7+ // but WITHOUT ANY WARRANTY, without even the implied warranty of
8+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9+ // See the GNU Affero General Public License for more details.
10+ // You should have received a copy of the GNU Affero General Public License
11+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
12+ //
13+ // WARNING: This file was auto-generated. Do not edit.
14+
15+ using MatterDotNet . Protocol . Parsers ;
16+ using MatterDotNet . Protocol . Payloads ;
17+ using System . Diagnostics . CodeAnalysis ;
18+
19+ namespace MatterDotNet . Messages
20+ {
21+ public record SemanticTag : TLVPayload
22+ {
23+ /// <inheritdoc />
24+ public SemanticTag ( ) { }
25+
26+ /// <inheritdoc />
27+ [ SetsRequiredMembers ]
28+ public SemanticTag ( Memory < byte > data ) : this ( new TLVReader ( data ) ) { }
29+
30+ public ushort ? MfgCode { get ; set ; }
31+ public required byte NamespaceID { get ; set ; }
32+ public required byte Tag { get ; set ; }
33+ public string ? Label { get ; set ; }
34+
35+ /// <inheritdoc />
36+ [ SetsRequiredMembers ]
37+ public SemanticTag ( TLVReader reader , long structNumber = - 1 ) {
38+ reader . StartStructure ( structNumber ) ;
39+ if ( reader . IsTag ( 0 ) )
40+ MfgCode = reader . GetUShort ( 0 , true ) ;
41+ NamespaceID = reader . GetByte ( 1 ) ! . Value ;
42+ Tag = reader . GetByte ( 2 ) ! . Value ;
43+ if ( reader . IsTag ( 3 ) )
44+ Label = reader . GetString ( 3 ) ;
45+ reader . EndContainer ( ) ;
46+ }
47+
48+ /// <inheritdoc />
49+ public override void Serialize ( TLVWriter writer , long structNumber = - 1 ) {
50+ writer . StartStructure ( structNumber ) ;
51+ if ( MfgCode != null )
52+ writer . WriteUShort ( 0 , MfgCode ) ;
53+ writer . WriteByte ( 1 , NamespaceID ) ;
54+ writer . WriteByte ( 2 , Tag ) ;
55+ if ( Label != null )
56+ writer . WriteString ( 3 , Label ) ;
57+ writer . EndContainer ( ) ;
58+ }
59+ }
60+ }
0 commit comments