ReconnectEvent
public sealed record ReconnectEvent : IEquatable<ReconnectEvent>
One step of an automatic reconnect, as it happens.
Delivered to the handler registered with ThermalCamera.OnReconnect(…). Worth watching as well as ThermalCamera.OnConnectionStatus(…), which on its own cannot distinguish a recovery in progress from a camera that is simply gone.
ReconnectEvent: constructors
public ReconnectEvent(ReconnectPhase Phase, int Attempt, int MaxAttempts, TimeSpan Waited, string Message, string Serial, string Model)
One step of an automatic reconnect, as it happens.
Phase: Where the attempt got to.Attempt: 1-based attempt number;0forReconnectPhase.Started.MaxAttempts: The configured budget, or0when attempts are unlimited.Waited: How long the SDK waited before this attempt.Message: Human-readable detail, nevernullbut possibly empty. The failure reason onReconnectPhase.AttemptFailedandReconnectPhase.GaveUp.Serial: Which camera this event is about. Nevernull, and empty only for a camera that never had a serial at all. A host watching several cameras at once got one stream of events with nothing in them to say which camera each belonged to, so a two-camera application could not label its own reconnect banner. The serial is captured before the first attempt, which is what makes it still correct onReconnectPhase.GaveUp: by then the camera is closed andThermalCamera.Serialreports no serial at all.Model: The marketing name of that camera, for example"PI 640i". Nevernull, captured withSerialand just as durable, because an operator reads the model long before they read a serial number.
Delivered to the handler registered with ThermalCamera.OnReconnect(…). Worth watching as well as ThermalCamera.OnConnectionStatus(…), which on its own cannot distinguish a recovery in progress from a camera that is simply gone.
ReconnectEvent: properties
public int Attempt { get; init; }
1-based attempt number; 0 for ReconnectPhase.Started.
public int MaxAttempts { get; init; }
The configured budget, or 0 when attempts are unlimited.
public string Message { get; init; }
Human-readable detail, never null but possibly empty. The failure reason on ReconnectPhase.AttemptFailed and ReconnectPhase.GaveUp.
public string Model { get; init; }
The marketing name of that camera, for example "PI 640i". Never null, captured with Serial and just as durable, because an operator reads the model long before they read a serial number.
public ReconnectPhase Phase { get; init; }
Where the attempt got to.
public string Serial { get; init; }
Which camera this event is about. Never null, and empty only for a camera that never had a serial at all.
A host watching several cameras at once got one stream of events with nothing in them to say which camera each belonged to, so a two-camera application could not label its own reconnect banner. The serial is captured before the first attempt, which is what makes it still correct on ReconnectPhase.GaveUp: by then the camera is closed and ThermalCamera.Serial reports no serial at all.
public TimeSpan Waited { get; init; }
How long the SDK waited before this attempt.