Skip to main content

Crate dahua_camera_discovery

Crate dahua_camera_discovery 

Source
Expand description

Finding cameras on the LAN: WS-Discovery, Dahua discovery, IP-range scan.

Three mechanisms, because no single one finds everything:

MechanismFindsMisses
ws_discoveryAnything speaking ONVIFCameras with ONVIF disabled; anything across a router
dahuaDahua devices, including ONVIF-disabled onesOther vendors; anything across a router
scanAnything with an open port, across subnetsNothing — but it is slow and noisy

Both multicast mechanisms are link-local: they do not cross a router, which on a vehicle LAN is usually fine and occasionally the whole problem. The range scan is the fallback for when it is not.

§Discovery finds addresses, not access

A discovered camera is a candidate. Nothing here authenticates, and nothing here fills in a working CameraConfig — credentials come from the environment or the keyring, never from the network. A Discovered is something to show an operator, who then says which of them to configure.

Modules§

dahua
Dahua’s own UDP discovery broadcast.
scan
IP-range scan: the fallback that crosses routers.
ws_discovery
WS-Discovery: the ONVIF multicast probe.

Structs§

Discovered
A candidate camera found on the network.

Enums§

DiscoveryMethod
How a device was found.

Constants§

DEFAULT_TIMEOUT
How long to listen for replies before giving up.

Functions§

local_ipv4_interfaces
Every usable local IPv4 address, one per interface.
merge
Merge results from several mechanisms, preferring the richest entry per address.
subnet_broadcast
The subnet-directed broadcast address for an interface.