Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NrTransducerChannels.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
7
9{
14 {
19 : base()
20 {
21 }
22
27 : base(1, 13, new byte[]
28 {
29 (byte)(NrChannels >> 8),
30 (byte)NrChannels
31 })
32 {
33 if (NrChannels < 0 || NrChannels > ushort.MaxValue)
34 throw new ArgumentOutOfRangeException(nameof(NrChannels));
35
36 this.NrChannels = NrChannels;
37 }
38
42 public int NrChannels { get; set; }
43
49 public override Grade Supports(ClassTypePair RecordTypeId)
50 {
51 return RecordTypeId.Class == 1 && RecordTypeId.Type == 13 ? Grade.Perfect : Grade.NotAtAll;
52 }
53
61 public override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
62 {
63 return new NrTransducerChannels()
64 {
65 Class = RecordTypeId.Class,
66 Type = RecordTypeId.Type,
67 RawValue = RawValue.Body,
68 NrChannels = RawValue.NextUInt16(nameof(NrTransducerChannels))
69 };
70 }
71
79 public override void AddFields(ThingReference Thing, DateTime Timestamp, List<Field> Fields, Teds Teds)
80 {
81 Fields.Add(new Int32Field(Thing, Timestamp, "#Channels", this.NrChannels,
82 FieldType.Identity, FieldQoS.AutomaticReadout));
83 }
84
89 public override void AppendDetails(StringBuilder SnifferOutput)
90 {
91 SnifferOutput.Append("#Channels=");
92 SnifferOutput.AppendLine(this.NrChannels.ToString());
93 }
94 }
95}
override Grade Supports(ClassTypePair RecordTypeId)
How well the class supports a specific TEDS field type.
NrTransducerChannels(int NrChannels)
TEDS Number of implemented TransducerChannels (§6.4.2.7)
override void AppendDetails(StringBuilder SnifferOutput)
Appends record details to sniffer output.
override void AddFields(ThingReference Thing, DateTime Timestamp, List< Field > Fields, Teds Teds)
Adds fields to a collection of fields.
int NrChannels
This field contains the number of TransducerChannels implemented in this TIM.
override TedsRecord Parse(ClassTypePair RecordTypeId, Binary RawValue, ParsingState State)
Parses a TEDS record.
NrTransducerChannels()
TEDS Number of implemented TransducerChannels (§6.4.2.7)
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
Represents a 32-bit integer value.
Definition: Int32Field.cs:10
Contains a reference to a thing
Grade
Grade enumeration
Definition: Grade.cs:7
FieldQoS
Field Quality of Service flags
Definition: FieldQoS.cs:10
FieldType
Field Type flags
Definition: FieldType.cs:10