Skip to main content

Crate dahua_camera_opcua

Crate dahua_camera_opcua 

Source
Expand description

OPC UA address space for the camera stack.

§⚠ READ THIS BEFORE EXPOSING ANY NODE

OPC UA is how this data reaches a PLC. A PLC is how machinery moves. That combination is exactly the mistake this crate is built to make hard.

Camera IVS/SMD detection is an OPERATOR AID. It is not safety-rated: no SIL level, no EN 50128 / EN 50129 assessment. It degrades in fog, rain, backlight and at range. It MUST NOT be used as an interlock, a permissive, or a condition for machine motion. Absence of a detection means nothing.

So the node naming here is deliberately unambiguous, and deliberately ugly:

  Camera_front_Detection_Motion_NotSafetyRated
  Camera_front_Health_NotSafetyRated

An integrator browsing the address space cannot reach one of these values without reading NotSafetyRated in the identifier itself. A comfortable name like Camera1.MotionDetected invites exactly the wiring this notice forbids, and a description field does not help — nobody reads descriptions while dragging a tag into a ladder rung.

Every node also carries the full notice in its description, and NodeSpec::is_safe_for_interlock returns false for all of them.

§Scope

This crate models the address space: node ids, browse names, descriptions, data types and the mapping from workspace types to OPC UA values. The transport is supplied by an OpcUaBackend implementation, so the model — which is where the safety-critical naming decisions live — is testable without standing up a server.

Structs§

NodeSpec
One node in the address space.

Enums§

NodeType
The OPC UA data type of a node’s value.
NodeValue
A value published to a node.

Constants§

NOT_SAFETY_RATED
The suffix every detection and health node carries.
SAFETY_NOTICE
The notice attached to every node’s description.

Traits§

OpcUaBackend
The transport under the address space.

Functions§

capability_node
A node reporting whether a capability was confirmed.
capability_updates
Map a capability profile onto its nodes and values.
clock_offset_node
A node carrying a camera’s clock offset in seconds.
declare_camera
Declare every node for a camera on a backend.
detection_node
A node carrying a detection, named so it cannot be mistaken for safe.
event_update
Map an event onto its node and value.
health_node
A node carrying a camera’s health verdict.
health_update
Map a health report onto its node and value.
nodes_for_camera
Every node for one camera, given the event kinds it may report.
severity_code
Severity as an OPC UA-friendly integer, matching the enum’s ordering.