-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerialMonitorOptions.cs
More file actions
27 lines (24 loc) · 1.13 KB
/
Copy pathSerialMonitorOptions.cs
File metadata and controls
27 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace WinSerialMon;
public sealed class SerialMonitorOptions
{
public string SessionName { get; init; } = $"WinSerialMon-{Guid.NewGuid():N}";
public int BufferSizeMB { get; init; } = 64;
public int MinimumBuffers { get; init; } = 32;
public int MaximumBuffers { get; init; } = 128;
public bool EnableKernelFileIoProvider { get; init; } = true;
public bool EnableKernelIoTraceProvider { get; init; } = true;
public bool IncludeEventsWithoutKnownIrpMajor { get; init; } = false;
public SynchronizationContext? CallbackSynchronizationContext { get; init; }
public bool PostCallbacksToSynchronizationContext { get; init; } = true;
public Func<string?, bool> SerialPathFilter { get; init; } = static path =>
{
if (string.IsNullOrWhiteSpace(path))
{
return false;
}
return path.Contains("serial", StringComparison.OrdinalIgnoreCase)
|| path.Contains("usbser", StringComparison.OrdinalIgnoreCase)
|| path.Contains("\\\\.\\\\COM", StringComparison.OrdinalIgnoreCase)
|| path.Contains("COM", StringComparison.OrdinalIgnoreCase);
};
}