namespace Mbproxy.Options;

public sealed class PlcOptions
{
    public string Name { get; init; } = "";
    public int ListenPort { get; init; }
    public string Host { get; init; } = "";

    /// <summary>
    /// Backend Modbus TCP port on the PLC. Defaults to 502 (standard Modbus TCP port).
    /// </summary>
    public int Port { get; init; } = 502;

    public PlcBcdOverrides? BcdTags { get; init; }

    /// <summary>
    /// Per-PLC default cache TTL applied to any tag whose explicit
    /// <see cref="BcdTagOptions.CacheTtlMs"/> is unset (null). 0 (the default) means
    /// "no caching by default at this PLC". Per-tag values always win over the per-PLC
    /// default when set; an explicit zero on a tag still disables caching for that tag.
    /// </summary>
    public int DefaultCacheTtlMs { get; init; } = 0;
}
