feat(s7): STRING/WSTRING/CHAR/WCHAR and DTL/DATE/TOD/TIME/S5TIME codecs, TSAP/connection-type override, negotiated PDU surfaced (#632 #288 #289 #294 #295)

New S7DataType members WString/Char/WChar/Dtl/Date/Tod/Time/S5Time mapped onto existing
DriverDataType (String / DateTime / Int32 ms); writes refuse out-of-range with BadOutOfRange.
Optional localTsap/remoteTsap/connectionType through options, factory JSON, probe and AdminUI form.
NegotiatedPduSize snapshotted at connect and exposed via GetDiagnostics (DriverHealth has no bag).

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-08 14:31:44 -04:00
parent d898262c4a
commit 34c52defb3
18 changed files with 1430 additions and 31 deletions
@@ -145,4 +145,17 @@ public sealed class WriteCommandParseValueTests
{
ReadCommand.SynthesiseTagName(address, type).ShouldBe(expected);
}
/// <summary>The #288/#289 types parse to the CLR shape the codecs accept.</summary>
[Fact]
public void ParseValue_handles_the_string_and_date_time_codec_types()
{
WriteCommand.ParseValue("héllo", S7DataType.WString).ShouldBe("héllo");
WriteCommand.ParseValue("A", S7DataType.Char).ShouldBe("A");
WriteCommand.ParseValue("2008-12-16T20:30:20", S7DataType.Dtl).ShouldBeOfType<DateTime>();
WriteCommand.ParseValue("2009-12-01", S7DataType.Date).ShouldBeOfType<DateTime>();
WriteCommand.ParseValue("86399999", S7DataType.Tod).ShouldBe(86399999L);
WriteCommand.ParseValue("-1000", S7DataType.Time).ShouldBe(-1000L);
WriteCommand.ParseValue("127000", S7DataType.S5Time).ShouldBe(127000L);
}
}