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

Writes OSDP packet captures to .osdpcap file format. More...

Inheritance diagram for OSDP.Net.Tracing.OSDPCaptureFileWriter:

Public Member Functions

 OSDPCaptureFileWriter (string filePath, string source, bool append=true)
 Initializes a new instance of the OSDPCaptureFileWriter class.
void WritePacket (byte[] data, TraceDirection direction)
 Writes a packet to the capture file.
void WritePacket (byte[] data, TraceDirection direction, DateTime timestamp)
 Writes a packet to the capture file with a specific timestamp.
void WriteTrace (TraceEntry trace)
 Writes a trace entry to the capture file.
void Dispose ()
 Releases all resources used by the OSDPCaptureFileWriter.

Protected Member Functions

virtual void Dispose (bool disposing)
 Releases resources used by the OSDPCaptureFileWriter.

Detailed Description

Writes OSDP packet captures to .osdpcap file format.

This format is compatible with OSDP trace analyzers and can be used for debugging and analysis.

Definition at line 11 of file OSDPCaptureFileWriter.cs.

Constructor & Destructor Documentation

◆ OSDPCaptureFileWriter()

OSDP.Net.Tracing.OSDPCaptureFileWriter.OSDPCaptureFileWriter ( string filePath,
string source,
bool append = true )
inline

Initializes a new instance of the OSDPCaptureFileWriter class.

Parameters
filePathThe path to the output .osdpcap file.
sourceThe source identifier for the capture (e.g., "OSDP.Net", "PassiveMonitor").
appendIf true, appends to the existing file; otherwise creates a new file.
Exceptions
ArgumentNullExceptionThrown when filePath or source is null.

Definition at line 24 of file OSDPCaptureFileWriter.cs.

Referenced by WritePacket(), WritePacket(), and WriteTrace().

Member Function Documentation

◆ Dispose() [1/2]

void OSDP.Net.Tracing.OSDPCaptureFileWriter.Dispose ( )
inline

Releases all resources used by the OSDPCaptureFileWriter.

Definition at line 128 of file OSDPCaptureFileWriter.cs.

References Dispose().

Referenced by Dispose().

◆ Dispose() [2/2]

virtual void OSDP.Net.Tracing.OSDPCaptureFileWriter.Dispose ( bool disposing)
inlineprotectedvirtual

Releases resources used by the OSDPCaptureFileWriter.

Parameters
disposingTrue if disposing managed resources.

Definition at line 138 of file OSDPCaptureFileWriter.cs.

◆ WritePacket() [1/2]

void OSDP.Net.Tracing.OSDPCaptureFileWriter.WritePacket ( byte[] data,
TraceDirection direction )
inline

Writes a packet to the capture file.

Parameters
dataThe raw packet data.
directionThe direction of the packet (Input, Output, or Trace).
Exceptions
ArgumentNullExceptionThrown when data is null.
ObjectDisposedExceptionThrown when the writer has been disposed.

Definition at line 59 of file OSDPCaptureFileWriter.cs.

References OSDPCaptureFileWriter().

◆ WritePacket() [2/2]

void OSDP.Net.Tracing.OSDPCaptureFileWriter.WritePacket ( byte[] data,
TraceDirection direction,
DateTime timestamp )
inline

Writes a packet to the capture file with a specific timestamp.

Parameters
dataThe raw packet data.
directionThe direction of the packet (Input, Output, or Trace).
timestampThe timestamp for the packet (in UTC).
Exceptions
ArgumentNullExceptionThrown when data is null.
ObjectDisposedExceptionThrown when the writer has been disposed.

Definition at line 75 of file OSDPCaptureFileWriter.cs.

References OSDPCaptureFileWriter().

◆ WriteTrace()

void OSDP.Net.Tracing.OSDPCaptureFileWriter.WriteTrace ( TraceEntry trace)
inline

Writes a trace entry to the capture file.

This method is compatible with Action<TraceEntry> callbacks used in the library.

Parameters
traceThe trace entry to write.
Exceptions
ObjectDisposedExceptionThrown when the writer has been disposed.

Definition at line 89 of file OSDPCaptureFileWriter.cs.

References OSDP.Net.Tracing.TraceEntry.Data, OSDP.Net.Tracing.TraceEntry.Direction, and OSDPCaptureFileWriter().


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