using System.Threading;
using System.Threading.Tasks;
using ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Shared.Contracts;

namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Host.Backend;

/// <summary>
///     The Host's view of a FOCAS session. One implementation wraps the real
///     <c>Fwlib32.dll</c> via P/Invoke (lands with the real Fwlib32 integration follow-up,
///     since no hardware is available today); a second implementation —
///     <see cref="FakeFocasBackend"/> — is used by tests.
///     Both live on .NET 4.8 x86 so the Host can be deployed in either mode without
///     changing the pipe server.
///     Invoked via <c>FwlibFrameHandler</c> in the Ipc namespace.
/// </summary>
public interface IFocasBackend
{
    Task<OpenSessionResponse> OpenSessionAsync(OpenSessionRequest request, CancellationToken ct);
    Task CloseSessionAsync(CloseSessionRequest request, CancellationToken ct);
    Task<ReadResponse> ReadAsync(ReadRequest request, CancellationToken ct);
    Task<WriteResponse> WriteAsync(WriteRequest request, CancellationToken ct);
    Task<PmcBitWriteResponse> PmcBitWriteAsync(PmcBitWriteRequest request, CancellationToken ct);
    Task<ProbeResponse> ProbeAsync(ProbeRequest request, CancellationToken ct);
}
