reconnect — functions
Connection status, and having the SDK re-open a camera by itself.
Two axes, deliberately separate.
The link. CONNECTION_CONNECTED and the five states beside
it say whether frames are arriving. Read it through
camera.connection_status, or subscribe with
camera.on_connection_status.
Whether the temperatures can be believed. A camera whose
calibration files could not be found opens anyway, streams anyway and
reports temperatures anyway -- and they are wrong. The link is fine,
and that is all the link reports; camera.calibration_status is the
other axis.
Recovery is the SDK's job if you ask for it::
camera.enable_auto_reconnect(ReconnectConfig(max_attempts=0))
camera.on_reconnect(lambda event: print(event))
A background thread then watches the link and re-opens the camera on
the backoff schedule. Attempt n waits initial_delay_s * backoff_multiplier ** (n - 1), capped at max_delay_s. The waits
are not politeness: a host resume re-enumerates USB over a second or
two, and retrying as fast as possible in that window is how a
recoverable drop becomes one that needs a real replug.
camera.is_auto_reconnect_enabled reports the state, not the
request. It goes False once the SDK has given up, because after
RECONNECT_GAVE_UP nothing is watching the camera and a flag
still reading "in force" described a request nobody was acting on.
connection_status_name(status)
A connection status, spelled out rather than as an ordinal.
calibration_status_name(status)
A calibration status, spelled out.
reconnect_phase_name(phase)
A reconnect phase, spelled out.