OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
TraceEntry.cs
1using System;
2
3namespace OSDP.Net.Tracing;
4
17
21public struct TraceEntry
22{
26 public TraceDirection Direction { get; }
27
31 public Guid ConnectionId { get; }
32
36 public byte[] Data { get; }
37
45 public byte? Address { get; }
46
53 public TraceEntry(TraceDirection direction, Guid connectionId, byte[] data)
54 {
55 Direction = direction;
56 ConnectionId = connectionId;
57 Data = data;
58 // The trace data begins at the SOM byte (0x53); the address byte is at index 1.
59 // Mask off the reply bit (0x80) so commands and replies report the same address.
60 Address = data is { Length: > 1 } ? (byte)(data[1] & 0x7F) : null;
61 }
62}
TraceDirection
Direction of trace.
Definition TraceEntry.cs:9
@ Output
Data is sent from the device.
Definition TraceEntry.cs:13
@ Input
Data is sent to the device.
Definition TraceEntry.cs:11
@ Trace
Data is being monitored.
Definition TraceEntry.cs:15
Guid ConnectionId
The connection sending/receiving the data.
Definition TraceEntry.cs:31
byte[] Data
The data that is sent/received.
Definition TraceEntry.cs:36
TraceEntry(TraceDirection direction, Guid connectionId, byte[] data)
Initializes a new instance of the TraceEntry struct.
Definition TraceEntry.cs:53
byte? Address
The OSDP device address extracted from the packet data.
Definition TraceEntry.cs:45
TraceDirection Direction
The direction in which the data is sent.
Definition TraceEntry.cs:26