Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Format.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
7
9{
13 public class Format : TedsRecord
14 {
18 public Format()
19 : base()
20 {
21 }
22
27 public Format(bool Text)
28 : base(12, 4, new byte[] { Text ? (byte)1 : (byte)0 })
29 {
30 }
31
35 public bool Text { get; set; }
36
42 public override Grade Supports(ClassTypePair RecordTypeId)
43 {
44 return RecordTypeId.Class == 12 && RecordTypeId.Type == 4 ? Grade.Perfect : Grade.NotAtAll;
45 }
46
54 public override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
55 {
56 State.NameFormatText = RawValue.NextBoolean(nameof(Format));
57
58 return new Format()
59 {
60 Class = RecordTypeId.Class,
61 Type = RecordTypeId.Type,
62 RawValue = RawValue.Body,
63 Text = State.NameFormatText
64 };
65 }
66
74 public override void AddFields(ThingReference Thing, DateTime Timestamp, List<Field> Fields, Teds Teds)
75 {
76 }
77
82 public override void AppendDetails(StringBuilder SnifferOutput)
83 {
84 SnifferOutput.Append("TextFormat=");
85 SnifferOutput.AppendLine(this.Text.ToString());
86 }
87 }
88}
override void AddFields(ThingReference Thing, DateTime Timestamp, List< Field > Fields, Teds Teds)
Adds fields to a collection of fields.
Definition: Format.cs:74
override void AppendDetails(StringBuilder SnifferOutput)
Appends record details to sniffer output.
Definition: Format.cs:82
override Grade Supports(ClassTypePair RecordTypeId)
How well the class supports a specific TEDS field type.
Definition: Format.cs:42
override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
Parses a TEDS record.
Definition: Format.cs:54
Represents one record in a TEDS
Definition: TedsRecord.cs:16
byte Class
This field identifies the TEDS being accessed. The value is the TEDS access code found in Table 72.
Definition: TedsRecord.cs:42
Contains a reference to a thing
Grade
Grade enumeration
Definition: Grade.cs:7