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_0139veDo3XyavMuVhdnHcN16
Target-driven moves of deviceNodePTZCamControl (AbsoluteMove) and
deviceNodePresetCamControl (preset for the ROI) both end in
CAM_WS_WAIT_ONPOS, which waits for the end of the move and then
broadcasts EVT_CAMERA_ON_POSITION (EVT_CLASS_CAMERA_CTRL).
- AbsoluteMove: with video output enabled (m_bSkeepPositioningWait) the
event was broadcast right after the command, before the camera moved.
It now always goes through CAM_WS_WAIT_ONPOS, like the preset path.
- New m_bNoMoveDoneReport: set when the protocol cannot report the end
of a move (waitMoveIsDone() returns false). Then a fixed
CAM_MOVE_FIXED_WAIT_MS (3 s) wait is used before the event. Before, the
same failure set m_bSkeepPositioningWait, which made every later
AbsoluteMove broadcast the event immediately. Reset when the protocol
is (re)created.
- protocolPTZ_ONVIF::goPreset: forget the last AbsoluteMove target so
waitMoveIsDone() cannot end early by comparing with it.
Homing, init go-home and web/IR/wiper presets are unchanged (no event).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16