Expand description
zerodds-opcua-bridge — the OMG DDS-OPCUA Gateway 1.0 as a daemon on
zerodds-dcps.
Crate zerodds-opcua-bridge. Safety classification: STANDARD.
The four no_std + alloc OPC-UA crates
(zerodds_opcua_gateway, zerodds_opcua_uacp, zerodds_opcua_server,
zerodds_opcua_pubsub) implement the OMG DDS-OPCUA Gateway 1.0 type
system and AddressSpace mapping, the Part 6 opc.tcp framing and
SecureChannel, the Part 4 Client/Server service set, and the Part 14
(UADP) PubSub wire stack — as libraries, with no DDS runtime, no
network listener loop and no configuration file. This crate is the
part that was missing: a running process.
§What the daemon does
- DDS → OPC UA (Gateway 1.0 §9): DDS topics — named in
daemon::config’sopcua.gateway_config(the Spec §10 XML this daemon reads viazerodds_opcua_gateway::xml::parse_gateway_config) — appear in this daemon’s ownopc.tcpzerodds_opcua_server::ServerAddressSpace: oneObjectNodeper DDS domain, one per topic, and oneVariableper sample field, kept live by a DDS reader pump (address_space_build). A write to aua_to_dds_connectionnode from any OPC-UA client goes back into DDS. - OPC UA → DDS (Gateway 1.0 §8): the servers named in
opcua.client.serversare browsed and subscribed as an OPC-UA client (ua_client); their monitored nodes are written into the configured DDS topics. - Part 14 PubSub: the
opcua.pubsub.connectionsnamed in the config run azerodds_opcua_pubsub::daemon::Publisher/zerodds_opcua_pubsub::daemon::Subscriberpair per connection over UDP multicast (pubsub_glue), publishing DataSets built from DDS topics and writing received DataSets back into DDS.
Types are resolved through the reflective layer
([zerodds-dcps::serialized_type::SerializedTypeSupport], fed by a
CompleteTypeObject this daemon builds from an operator-supplied .idl
file — idl) rather than a compiled Rust type, the same primitive
crates/xrce-agent’s daemon and crates/routing-service use for a topic
whose Rust type is not linked in.
§Module map
dynamic_type/dynamic_value—zerodds_types::dynamic↔ the OPC-UA gateway’s own symbolic type/value model (zerodds_opcua_gateway::dds_to_ua::walker::DdsType/zerodds_opcua_gateway::data_value::Variant).idl— compiles an operator-supplied.idlfile and builds the [zerodds-dcps::serialized_type::SerializedTypeSupport] for a named type in it.dds_bridge— the DDS-side port: participant/topic/reader/writer registration against a real [zerodds-dcps::runtime::DcpsRuntime], plus SEDP-discovered topic enumeration.address_space_build— Gateway 1.0 §9.3 AddressSpace materialization (DomainNode/TopicNode/instance nodes) over a live DDS reader.ua_client— the OPC-UA client side of Gateway 1.0 §8.pubsub_glue— the Part 14 UADP Publisher/Subscriber wiring.daemon— the process itself: CLI, YAML config, SIGHUP/SIGTERM, systemdType=notify, observability.
Feature daemon (default-on) gates the whole crate: the reflective
type layer, the DDS port, the AddressSpace/PubSub glue and the process
itself. Without it the crate is empty — there is no other consumer of
these modules; unlike the four library crates it wires together, this
one is the product, not a component.
Modules§
- address_
space_ build - Gateway 1.0 §9.3 AddressSpace materialization: DDS
Domain→Objectnode, DDSTopic→Objectnode, DDS sample → theVariablehierarchyzerodds_opcua_gateway::address_space::build_sample_instancealready computes symbolically, turned into realzerodds_opcua_server::address_space::NodeMetas +HasComponentreferences and kept live bycrate::dynamic_value::flatten. - daemon
- The
zerodds-opcua-bridgedprocess: CLI, YAML config, SIGHUP/SIGTERM, systemdType=notify, observability. - dds_
bridge - The DDS side of the daemon: one
DcpsRuntimeper configured domain, raw-byte reader/writer registration viaDcpsRuntime::register_user_ reader_kind/register_user_writer_kind— the same primitivecrates/xrce-agent’s daemon andcrates/routing-serviceuse for a topic with no compiled Rust type — and aSerializedTypeSupportper topic, built bycrate::idlfrom the operator’s own.idlfile. - dynamic_
type zerodds_types::dynamic::DynamicType→DdsType, the lightweight type treezerodds_opcua_gateway::dds_to_ua::walkerwalks (Gateway 1.0 §9.2).- dynamic_
value zerodds_types::dynamic::DynamicData↔ a flat, path-named list ofVariants.- idl
- Compiles an operator-supplied
.idlfile into a model this daemon can resolve DDS types from, and builds the [zerodds-dcps::serialized_type::SerializedTypeSupport] a topic named in the config needs to decode/encode its samples without a compiled Rust type. - pubsub_
glue - Part 14 UADP wiring: a
Publisherper configured DDS-topic-to-DataSet mapping (DDS → PubSub) and aSubscriberper DataSet-to-DDS-topic mapping (PubSub → DDS), both driven by the samecrate::dynamic_value::flatten/crate::dynamic_value::unflattenpair the AddressSpace side uses. - ua_
client - Gateway 1.0 §8 (OPC UA → DDS): browses and subscribes a configured
foreign OPC-UA server as a client
(
zerodds_opcua_server::client::Clientoverzerodds_opcua_server::client::tcp::TcpTransport) and writes the monitored nodes’ values into DDS.