23 private const int DataLength = 7;
118 ushort requestedDelay = 0, ushort updateMessageMaximum = 0)
147 var data =
new byte[DataLength];
156 var detail =
Message.ConvertShortToBytes(unchecked((ushort)(
short)
Detail));
161 data[5] = messageMaximum[0];
162 data[6] = messageMaximum[1];
172 var dataArray = data.ToArray();
173 if (dataArray.Length != DataLength)
175 throw new Exception(
"Invalid size for the data");
178 return new FileTransferStatus
182 Detail = SetStatusDetailDefault(
Message.ConvertBytesToShort(dataArray.Skip(3).Take(2).ToArray(),
true)),
190 var build =
new StringBuilder();
191 build.AppendLine($
" Action: {Action:G}");
192 build.AppendLine($
" Requested Delay: {RequestedDelay}");
193 build.AppendLine($
" Status Detail: {Detail}");
194 build.AppendLine($
" Update Message Max: {UpdateMessageMaximum}");
196 return build.ToString();
199 private static StatusDetail SetStatusDetailDefault(
short value)
A base message class for sending or replying.
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload an OSDP message.
The PD file transfer status sent as a reply.
StatusDetail Detail
Gets the file transfer status.
FileTransferStatus(StatusDetail detail, ControlFlags action=ControlFlags.None, ushort requestedDelay=0, ushort updateMessageMaximum=0)
Initializes a new instance of the FileTransferStatus class to be sent by a PD in reply to an osdp_FIL...
ControlFlags
Control Flags.
@ None
No control flags set; the PD is dedicated to the file transfer, stays in the secure channel,...
@ Interleave
The ACU may interleave other messages with the file transfer.
@ PollResponseAvailable
A separate poll response is available.
@ LeaveSecureChannel
The ACU shall leave the secure channel for the duration of the file transfer.
ushort RequestedDelay
Gets the request ACU time delay in milliseconds before next osdp_FILETRANSFER command.
override string ToString()
override ReadOnlySpan< byte > SecurityControlBlock()
StatusDetail
Status Detail.
@ FileContentsProcessed
The File contents processed.
@ UnknownStatus
The status is unknown.
@ OkToProceed
OK to proceed.
@ UnrecognizedFileContents
Unrecognized file contents.
@ UnknownError
The error is unknown.
@ FileDataUnacceptable
The file data unacceptable (malformed).
@ AbortFileTransfer
Abort file transfer.
@ RebootingNow
Rebooting now, expect full communications reset.
@ FinishingFileTransfer
PD is finishing file transfer.
ushort UpdateMessageMaximum
Gets the alternative maximum message size.
override byte[] BuildData()
ControlFlags Action
Gets the control flags.
ReplyType
Identifies the type of OSDP protocol reply (PD -> ACU) message.