OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
OSDP.Net.Tracing.OSDPPacketTextFormatter Class Reference

Default implementation of IPacketTextFormatter for formatting OSDP packets as human-readable text. More...

Inheritance diagram for OSDP.Net.Tracing.OSDPPacketTextFormatter:
OSDP.Net.Tracing.IPacketTextFormatter

Public Member Functions

string FormatPacket (Packet packet, DateTime timestamp, TimeSpan? timeDelta=null)
 Formats a successfully parsed packet as text.
Parameters
packetThe parsed OSDP packet.
timestampThe timestamp when the packet was captured.
timeDeltaOptional time difference from the previous packet.
Returns
Formatted text representation of the packet.
Exceptions
ArgumentNullExceptionThrown when packet is null.

Exceptions
ArgumentNullExceptionThrown when packet is null.

string FormatError (byte[] rawData, DateTime timestamp, TimeSpan? timeDelta, string errorMessage)
 Formats a packet that failed to parse due to an error.
Parameters
rawDataThe raw packet bytes.
timestampThe timestamp when the packet was captured.
timeDeltaOptional time difference from the previous packet.
errorMessageThe error message describing why parsing failed.
Returns
Formatted text with error information and raw data.
Exceptions
ArgumentNullExceptionThrown when rawData is null.

Exceptions
ArgumentNullExceptionThrown when rawData is null.

Detailed Description

Default implementation of IPacketTextFormatter for formatting OSDP packets as human-readable text.

Definition at line 12 of file OSDPPacketTextFormatter.cs.

Member Function Documentation

◆ FormatError()

string OSDP.Net.Tracing.OSDPPacketTextFormatter.FormatError ( byte[] rawData,
DateTime timestamp,
TimeSpan? timeDelta,
string errorMessage )
inline

Formats a packet that failed to parse due to an error.

Parameters
rawDataThe raw packet bytes.
timestampThe timestamp when the packet was captured.
timeDeltaOptional time difference from the previous packet.
errorMessageThe error message describing why parsing failed.
Returns
Formatted text with error information and raw data.
Exceptions
ArgumentNullExceptionThrown when rawData is null.

Exceptions
ArgumentNullExceptionThrown when rawData is null.

Implements OSDP.Net.Tracing.IPacketTextFormatter.

Definition at line 214 of file OSDPPacketTextFormatter.cs.

◆ FormatPacket()

string OSDP.Net.Tracing.OSDPPacketTextFormatter.FormatPacket ( Packet packet,
DateTime timestamp,
TimeSpan? timeDelta = null )
inline

Formats a successfully parsed packet as text.

Parameters
packetThe parsed OSDP packet.
timestampThe timestamp when the packet was captured.
timeDeltaOptional time difference from the previous packet.
Returns
Formatted text representation of the packet.
Exceptions
ArgumentNullExceptionThrown when packet is null.

Exceptions
ArgumentNullExceptionThrown when packet is null.

Implements OSDP.Net.Tracing.IPacketTextFormatter.

Definition at line 16 of file OSDPPacketTextFormatter.cs.

References OSDP.Net.Model.Packet.CommandType, OSDP.Net.Model.Packet.IsPayloadDecrypted, OSDP.Net.Model.Packet.IsSecureMessage, OSDP.Net.Model.Packet.IsUsingDefaultKey, OSDP.Net.Model.Packet.ParsePayloadData(), and OSDP.Net.Model.Packet.ReplyType.


The documentation for this class was generated from the following file: