namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions;
///
/// Driver capability for on-demand writes. Optional — read-only drivers (a hypothetical
/// historian-only adapter, for example) can omit this.
///
///
/// Per docs/v2/plan.md decisions #44 + #45 — writes are NOT auto-retried by default.
/// A timeout may fire after the device already accepted the command; replaying non-idempotent
/// field actions (pulses, alarm acks, recipe steps, counter increments) can cause duplicate
/// operations. Per-tag opt-in via Tag.WriteIdempotent = true in the central config DB
/// enables retry; otherwise the OPC UA client decides whether to re-issue.
///
public interface IWritable
{
///
/// Write a batch of values to the driver. Returns one status per requested write,
/// in the same order.
///
/// Pairs of full reference + value to write.
/// Cancellation token; the driver should abort the batch if cancelled.
Task> WriteAsync(
IReadOnlyList writes,
CancellationToken cancellationToken);
}
/// One write request in a batch.
/// Driver-side full reference (matches ).
/// Value to write; type must be compatible with the attribute's .
public sealed record WriteRequest(string FullReference, object? Value);
/// Result of one write in a batch.
/// OPC UA status code (numeric value matches the OPC UA spec).
public sealed record WriteResult(uint StatusCode);