2using System.Collections.Generic;
51 var data =
new List<byte> {
Type};
52 data.AddRange(
Fragment.BuildData().ToArray());
53 return data.ToArray();
59 var build =
new StringBuilder();
60 build.AppendLine($
" Transfer Type: 0x{Type:X2} ({DescribeType(Type)})");
61 build.AppendLine($
" Total Size: {Fragment.TotalSize}");
62 build.AppendLine($
" Offset: {Fragment.Offset}");
63 build.AppendLine($
" Fragment Size: {Fragment.FragmentSize}");
64 return build.ToString();
70 private static string DescribeType(
byte type) => type
switch
72 0x01 =>
"Opaque file contents",
73 0x02 =>
"Template for the next osdp_BIOMATCH",
74 0x03 =>
"PD-specific opaque data for display",
75 <= 0x7F =>
"Reserved for future use",
76 _ =>
"Reserved for private use"
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload of a PD command message.
override byte[] BuildData()
override string ToString()
FileTransferFragment(byte type, MessageDataFragment fragment)
Initializes a new instance of the FileTransferFragment class.
override ReadOnlySpan< byte > SecurityControlBlock()
MessageDataFragment Fragment
Get the message data fragment.
byte Type
Get the file transfer type.
static FileTransferFragment ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
override CommandType CommandType
Represents a fragment of data for a multipart message.
static MessageDataFragment ParseData(ReadOnlySpan< byte > data, MessageDataFragmentFieldSize sizeAndOffsetFieldSize)
Parses the message payload bytes.
MessageDataFragmentFieldSize
Defines the field size used for the MessageDataFragment.TotalSize and MessageDataFragment....