OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
KeepReaderActive.cs
1using System;
4
6
11{
13 public KeepReaderActive(ushort keepAliveTimeInMilliseconds)
14 {
15 KeepAliveTimeInMilliseconds = keepAliveTimeInMilliseconds;
16 }
17
25 public ushort KeepAliveTimeInMilliseconds { get; }
26
28 public override CommandType CommandType => CommandType.KeepActive;
29
31 public override byte Code => (byte)CommandType;
32
34 public override ReadOnlySpan<byte> SecurityControlBlock() => SecurityBlock.CommandMessageWithDataSecurity;
35
37 public override byte[] BuildData()
38 {
39 return Message.ConvertShortToBytes(KeepAliveTimeInMilliseconds);
40 }
41
45 public static KeepReaderActive ParseData(ReadOnlySpan<byte> data)
46 {
47 return new KeepReaderActive(Message.ConvertBytesToUnsignedShort(data));
48 }
49}
A base message class for sending or replying.
Definition Message.cs:12
Contains standard Security Control Block data that can be used when building messages.
Base class representing a payload of a PD command message.
static KeepReaderActive ParseData(ReadOnlySpan< byte > data)
Parses the message payload bytes.
ushort KeepAliveTimeInMilliseconds
Gets the keep alive time in milliseconds.
KeepReaderActive(ushort keepAliveTimeInMilliseconds)
override ReadOnlySpan< byte > SecurityControlBlock()