Browse Source
la_mojo cameras: track PTZ health and re-initialise a failed PTZ protocol
la_mojo cameras: track PTZ health and re-initialise a failed PTZ protocol
PTZ health per camera (deviceNodeCamera): - PTZ_HEALTH_INFO: state (NONE / INIT / OK / FAILED), failure and recovery counters, consecutive failed initialisations, time of the last state change / failure, next retry and the last error text. getPtzHealth() returns a copy (mutex-protected, any thread). - getPtzStatus() - already sent to the remote server as CAMERA_STATUS_PTZ_OK - now reflects it: 1 for OK (or no PTZ protocol), 0 while PTZ is initialising or failed. Before it was 1 as soon as the state machine left CAM_WS_INIT, whatever the protocol did. Failure detection and re-initialisation: - While idle (CAM_WS_READY) the camera checks the protocol's validate() every loop and calls the new protocolPTZ::probe() every 30 s (ONVIF: GetStatus; a SOAP Fault still means "reachable", only a communication error marks the camera lost). Default probe() is the protocol's validate(), so serial protocols are unchanged. - On failure the PTZ protocol is recreated through CAM_WS_INIT: first attempt at once, then 5, 10, 20, 40, 60 s (capped) between attempts; recoveries are logged and counted. - A failed target-driven goAbsolute/goPreset no longer ends the camera thread (CAM_WS_END rebuilt the whole node): for ONVIF a command the camera rejected (connection OK) only drops that ROI, anything else re-initialises the PTZ protocol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16pull/14/head
Failed to extract signature
5 changed files with 246 additions and 7 deletions
-
181lib/App/common/deviceNodeCamera.cpp
-
39lib/App/common/deviceNodeCamera.h
-
7lib/data/protocol/protocolPTZ.h
-
25lib/data/protocol/protocolPTZ_ONVIF.cpp
-
1lib/data/protocol/protocolPTZ_ONVIF.h
Write
Preview
Loading…
Cancel
Save
Reference in new issue