13 private readonly CommandType[] _validCommandTypes =
16 CommandType.InputStatus,
17 CommandType.LocalStatus,
18 CommandType.OutputStatus,
20 CommandType.ReaderStatus
23 public NoPayloadCommandData(CommandType commandType)
25 if (Array.IndexOf(_validCommandTypes, commandType) < 0)
27 throw new ArgumentException(
"Invalid command type for a sending a payload with no data.");
30 CommandType = commandType;
34 public override byte Code => (byte)CommandType;
37 public override CommandType CommandType {
get; }
40 public override ReadOnlySpan<byte>
SecurityControlBlock() => SecurityBlock.CommandMessageWithNoDataSecurity;
45 return Array.Empty<
byte>();
49 public override string ToString()
51 var sb =
new StringBuilder();
52 sb.AppendLine($
"Command Type: {CommandType}");
53 sb.AppendLine($
" Payload: (none)");
Base class representing a payload of a PD command message.
ReadOnlySpan< byte > SecurityControlBlock()
Retrieves the security control block for a specific command data type.
byte[] BuildData()
Converts the payload into a byte array to be sent over the wire.