2using System.Collections.Generic;
21 if (controls ==
null)
throw new ArgumentNullException(nameof(controls));
27 throw new Exception(
"Requires at least one output control");
34 public IEnumerable<ReaderLedControl>
Controls {
get; }
51 var data =
new List<byte>();
52 foreach (var readerLedControl
in Controls)
54 data.AddRange(readerLedControl.BuildData());
57 return data.ToArray();
71 var sb =
new StringBuilder();
72 sb.AppendLine($
"LED Count: {Controls.Count()}");
75 sb.AppendLine($
" Reader #: {control.ReaderNumber}");
76 sb.AppendLine($
" LED #: {control.LedNumber}");
77 sb.AppendLine($
"Temp Mode: {control.TemporaryMode}");
78 sb.AppendLine($
" On Time: {control.TemporaryOnTime} (100ms)");
79 sb.AppendLine($
" Off Time: {control.TemporaryOffTime} (100ms)");
80 sb.AppendLine($
" On Color: {control.TemporaryOnColor}");
81 sb.AppendLine($
"Off Color: {control.TemporaryOffColor}");
82 sb.AppendLine($
" Timer: {control.TemporaryTimer} (100ms)");
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload of a PD command message.
Contains data to control the color of a single LED on a PD.
static ReaderLedControl ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
override string ToString()
static ReaderLedControls ParseData(ReadOnlySpan< byte > payloadData)
Parses the message payload bytes.
IEnumerable< ReaderLedControl > Controls
One or more commands to control the LEDs of a PD.
override CommandType CommandType
override byte[] BuildData()
ReaderLedControls(IEnumerable< ReaderLedControl > controls)
Initializes a new instance of the ReaderLedControls class.
override ReadOnlySpan< byte > SecurityControlBlock()