ICommAdapter
ifw::fnd::defs::ICommAdapter is the protocol-agnostic
communication-adapter contract that every protocol-specific client
library implements. It models the value-oriented control plane:
read / write / call / browse / subscribe / configure / connect over
arbitrary transports (OPC UA, Modbus, REST, MQTT, GenICam control plane,
…).
Bulk media streaming (e.g. GenICam image acquisition) is
out of scope and belongs to a peer interface composed alongside
ICommAdapter, not derived from it.
Implementations
eso::uatools::Client(inuatools/ualib) – OPC UA over open62541. This is the reference implementation and exercises every surface op of the contract.Other adapters (Modbus, REST, …) are downstream of ifw-fnd; ifw-fnd itself only owns the contract.
Core types
The contract is defined in
<ifw/fnd/defs/iCommAdapter.hpp>. Key types:
Type |
Purpose |
|---|---|
|
String identifier of a remote item (e.g.
|
|
A |
|
Order-preserving string-keyed dictionary used both as a
configuration escape hatch and as a structured |
|
Protocol-agnostic outcome classification: |
|
Per-call options bundle. Carries |
|
Cooperative cancellation. The token is cheap to copy; the source is held by the issuing thread and used to abort an in-flight call. |
|
RAII handle for observer registration (connection-state handler). Move-only; destruction unregisters. |
Operations
The contract is built by addition – new methods carry default
implementations returning Status::Unsupported so existing
implementers keep compiling. The current surface:
Method |
Purpose |
|---|---|
|
Apply connection / behavioural options (endpoint, credentials,
transport-specific knobs). Must not run concurrently with
|
|
Open / close the underlying transport. State transitions are observable via a connection-state handler. |
|
Batched read / write of node values. |
|
Invoke a remote method / RPC with typed arguments and outputs. |
|
List the address space (children of a starting node). |
|
Register a per-node |
|
Drop subscriptions individually or globally. |
|
Endpoint / device discovery. Deferred in current implementations
(returns |
Thread-safety contract
The contract specifies the threading guarantees consumers can rely on:
Const query methods (
Is*,Get*) are callable from any thread at any time.Read/Write/Call/Browse/Discovermay be called concurrently with each other and with active subscriptions; implementations serialise as needed.Configure/Connect/Disconnectmust NOT run concurrently with each other or with data operations; the caller owns lifecycle ordering.SubscriptionHandlerand connection-state handlers run on the adapter’s internal thread(s). Each handler’s specific contract is documented at the registration point.
Versioning
kCommAdapterContractVersion is the integer version stamp on the
contract. Bumps on additive evolution are silent for callers (they
keep compiling because new methods carry default implementations).
Breaking bumps require a coordinated migration across all implementers
and consumers; before the first adapter shipped, breaking changes were
free.
For the full type definitions, read
<ifw/fnd/defs/iCommAdapter.hpp> – it’s the source of truth.