Releases: otfabric/go-s7comm
Releases · otfabric/go-s7comm
Release list
go-s7comm v0.7.5
Date: 2026-07-30
Previous release: v0.7.4
Summary
Patch release: bump go-cotp to v1.0.4 (pulls go-tpkt v1.0.1). No S7 protocol
or result-model changes.
Changes
Dependencies
- go-cotp —
v1.0.3→ v1.0.4 - go-tpkt (indirect) —
v1.0.0→ v1.0.1
Unchanged
- No API, wire, or behavioural changes. Import path remains
github.com/otfabric/go-s7comm.
go-s7comm v0.7.4
Date: 2026-07-30
Previous release: v0.7.3
Summary
Patch release: document logger and accurate context-cancel behaviour, add a thin
slog adapter, bump go-cotp to v1.0.3, root/model package docs, and raise
client test coverage. No S7 protocol or result-model changes.
Changes
Added
client.NewSlogLogger— adaptsslog.Handlerto the existing printf-styleLogger(nilhandler → no-op).- OBSERVABILITY.md — silent-by-default logging, sync callback cost, slog adapter; no metrics surface.
doc.go(module root,package s7comm) — points pkg.go.dev / importers atclient,model, andwire.model/doc.go— package overview for areas, addresses, device/connection info, and codec wrappers.
Changed
- Context docs (README, ERRORS.md, API.md) — cancel without deadline is effective on dial/TSDU via go-cotp but typically aborts the session;
WithTimeoutbounds Connect, not later PDUs; document UploadBlock cleanup context. Logger/WithLoggergodoc — nil default, printf-style args, synchronous request-path cost.- Connect logging —
Error("Connect failed: %v", err)so the error is formatted correctly. - README — Project structure tree (packages + docs); replaces the late bullet-only package list.
- README badges — Added pkg.go.dev; normalized Go
1.23%2Band Codecov link tocodecov.io/gh/....
Dependencies
- go-cotp —
v1.0.2→ v1.0.3 (docs-only upstream release).
License & open-source hygiene
- LICENSE — Added root MIT license (
Copyright (c) 2026 OT Fabric). - SPDX headers — Added
// SPDX-License-Identifier: MITto all first-party.gofiles (build tags preserved oninterop/). - README — License section pointing at LICENSE.
Build / tooling
- Makefile — exports
GOWORK=off. - Tests —
clientpackage coverage raised above 85% (ListBlocks/GetBlockInfo, probeS7, autoConnect, SZL edges, PDU-ref mismatch, range-probe mixed results).
Unchanged
- No change to
ReadResult/ReadStatus, wire codecs, or cancel implementation (docs corrected to match go-cotp behaviour).
go-s7comm v0.7.3
Date: 2026-07-20
Previous release: v0.7.2
Summary
- Docs: New ERRORS.md as the canonical guide for outcome models (
ReadResult/ReadStatus), client sentinels (ErrNotConnected,ValidationError, …), wireS7Error/ framing errors, detection patterns, and the CLI exit-code contract. API.md refreshed for v0.7.2+ (bit API,UnsupportedSyntaxError, wire sentinels) and points to ERRORS.md for semantics. README.md links API / ERRORS / RELEASE and keeps a short error summary. - Dependencies: Upgrade go-cotp from
v1.0.0-rc.1to v1.0.2 (stable). No public API changes in go-s7comm.
Breaking changes
- None (docs + dependency bump).
go-s7comm v0.7.2
Date: 2026-07-18
Previous release: v0.7.1
Summary
- wire: Harden Read Var parsing for non-success items that declare a meaningful nonzero transport and payload. Snap7-style rejects with transport size
0x00remain header-only (rawLength is preserved but not interpreted as payload length), so address-out-of-range replies keep surfacing as item return codes. Rejected items with a nonzero known/unknown transport and nonzero length strictly validate/skip the declared payload so multi-item responses stay aligned.
Breaking changes
- None. Snap7 out-of-range / transport-
0x00rejection handling is preserved; only rejected items with a meaningful declared payload become stricter.
go-s7comm v0.7.1
Date: 2026-07-17
Previous release: v0.7.0
Summary
- Native bit API: Public
model.BitAddressplusclient.ReadBit/WriteBit/ReadDBBit/WriteDBBitusing S7 BIT transport (not byte read-modify-write). Wire helpers:S7AnyBitAddress,EncodeS7AnyBit,EncodeReadVarBitRequest,EncodeWriteVarBitRequest,DecodeAsBit. Existing byteEncodeS7Any/ ReadArea / WriteArea APIs unchanged. InteropHasBitsteps use the public bit API.
Breaking changes
- None (additive).
go-s7comm v0.7.0
Date: 2026-07-17
Previous release: v0.6.3
Summary
- go-cotp TP0 service: Live client paths use go-cotp
v1.0.0-rc.1(cotp.Connect/ReadTSDU/WriteTSDU). S7 PDUs are exchanged as complete TSDUs; TPKT framing and COTP CR/CC/DT segmentation are owned by go-cotp. - Removed
transportpackage: Deleted the local TCP/TPKT wrapper. The client dials TCP and completes the TP0 handshake via go-cotp directly (dial helpers live inclient). - Dependencies: Direct module dependency is
github.com/otfabric/go-cotponly.github.com/otfabric/go-tpktis transitive via go-cotp (no production or test imports of go-tpkt in this module). - wire: Replaced
InspectFramewithInspectTPDU(COTP TPDU payload, no TPKT header). Removed obsolete COTP encode helpers from the wire surface/docs (EncodeCOTPCR/EncodeCOTPDT); COTP framing is owned by go-cotp. Non-success Read Var items with transport size0x00(Snap7 address faults) parse without error so callers see the item return code. - Interop: New
interop/suite (//go:build interop) runs the full snap7-interop v0.1.0 canonical fixture matrix (15 fixtures) against both published servers (native Snap7 and pure-Python) on host ports 1102/2102, rack/slot 0/2. Vendored compiled fixtures underinterop/testdata/fixtures/.make interop/ CI workflow.github/workflows/interop.ymlon every push and PR (pinned GHCR image digests). - Docs: README and API.md aligned with the TSDU-based stack, package layout (no
transport), tables of contents, interop usage, and v0.7.0.
Breaking changes
- Package
github.com/otfabric/go-s7comm/transportremoved. Use go-cotp directly for custom TP0 sessions; the high-levelclientpackage already does. wire.InspectFramereplaced bywire.InspectTPDU(input is a COTP TPDU, not a full TPKT frame).FrameSummary.TPKTLengthrenamed toTPDULength.
go-s7comm v0.6.3
Date: 2026-03-24
Previous release: v0.6.2
Summary
- Module rename: Module path changed from
github.com/otfabric/s7commtogithub.com/otfabric/go-s7commto align with thego-prefix naming convention used across otfabric Go libraries (e.g. go-tpkt, go-cotp). - Minimum Go version: Raised from 1.22 to 1.23 in
go.mod. - CI workflow: Replaced single
test.ymlwith dedicatedci.ymlthat calls the shared reusable workflowotfabric/.github/.github/workflows/go-ci.yml@v2. Test matrix covers Go 1.23–1.26 on ubuntu and Windows; coverage uploads to Codecov. - Release workflow: New
release.ymlcalls the shared reusable workflowotfabric/.github/.github/workflows/go-package-release.yml@v2withworkflow_dispatchfor manual patch/minor/major bumps.
Breaking changes
- Import path: All consumers must update their imports from
github.com/otfabric/s7comm/...togithub.com/otfabric/go-s7comm/....
v0.6.2
Release v0.6.2
Date: 2026-03-13
Previous release: v0.6.1
Summary
- Parameter-level error codes:
wire.ParamErrorFromParamandwire.ParamErrorCodeStringfor 16-bit S7 parameter error codes;wire.NewS7ErrorWithParamuses the param section when present so responses report clearer messages (e.g. "block not found", "invalid request length"). Client and handshake use it when header error and param are available. - Response transport sizes: Extended to DATE, TOD, TIME, S5TIME, DT (9–12, 15), COUNTER/TIMER (28, 29), and IEC counter/timer (30, 31), HS counter (32).
NormalizeResponseDataLengthhandles all;ResponseTransportSizeconstants andString()for diagnostics. - Memory areas:
AreaDataRecord(0x01),AreaS7200AO(0x07),AreaIECCounter200(30),AreaIECTimer200(31);ValidateAreaaccepts them. - Diagnostic string helpers:
wire.FunctionCodeString(code)(e.g. "Read Var", "Upload"),wire.AreaString(area)(e.g. "I", "DB", "M"),wire.SyntaxIDString(syntax)(e.g. "S7ANY", "DBREAD"),wire.ErrClassString(class)(e.g. "Access error");ResponseTransportSize.String()for item-level logging. - SZL ID catalog:
wire.SZLIDString(id)and expandedszlIDNamesfor diagnostics and logging. - Param error and SZL maps: More 16-bit parameter error codes (D003–D00B, D016–D017, D043–D04A, D061–D063, D081–D082, D0A1–D0AE, D0C1–D0C2, D250–D252, D2A1–D2A4, D401–D402, D601–D602) and additional SZL IDs in the name maps.
Breaking changes
- None.
v0.6.1
v0.6.0
Release v0.6.0
Date: 2026-03-13
Previous release: v0.5.1
Summary
- ReadResult API: Field
Errorrenamed toMessage(human-readable only; not stable API). AddedSuccess()(same asOK()). DocumentedStatusas canonical outcome,Err()as convenience adapter, andCauseas optional/non-stable. - Package docs: Outcome models (Strict / Structured / Best-effort) and canonical read pattern (
errthenres.Err()thenres.Data). Stable sentinels:ErrNotConnected,ErrRequestExceedsPDU,PDURefMismatchError,ValidationError,ReadStatus;ErrProtocolFailuredocumented as advanced/diagnostic. - Connect reconnect: Dial and handshake the new connection first; existing session is replaced only after the new handshake succeeds. Failed reconnect no longer drops a healthy session.
- ValidationError everywhere: All caller-input validation now returns
*ValidationError:Connect(port, timeout, max PDU, rack/slot),UploadBlock,GetBlockInfo,Discover(rack/slot, jitter, maxAttempts),streamCIDR/expandCIDR(CIDR validation). Useerrors.As(err, &ValidationError{})to detect. - Handshake protocol errors: COTP/S7 decode and shape failures in
performCOTPConnectandperformS7SetupwrapErrProtocolFailure; setup PDU ref mismatch returnsPDURefMismatchError. - Request validation:
CompareReadRequest: timeout ≥ 0, each candidate rack/slot validated; zero candidates allowed.RackSlotProbeRequest: non-empty address, port 0..65535, rack 0..7, slot 0..31 (and min ≤ max). - GetBlockInfo: Documented contract: transport/protocol failure →
(nil, err); parse failure after transport success → partialBlockInfo(Type, Number) pluserr. - Context cancellation: README and transport docs note that cancellation is strongly effective only when the context has a deadline.
- Discover: README recommends conservative CIDR ranges (e.g.
/24or smaller) in OT environments. - UploadBlock: End-upload cleanup timeout reduced from 2s to 500ms. Documented: best-effort cleanup before return may add a short delay; cleanup errors not returned.
- WriteArea: Documented that the number of bytes written is
len(data);addr.Sizeis ignored. - UploadBlock tests: Empty payload error, protocol failure on chunk (no retry), cleanup failure does not change result, context deadline returns promptly.
- Method docs: Best-effort first sentence for
Identify,GetBlockInfo,ListAllBlocks,ReadDiagBuffer; use-case sentence forCompareRead.
Breaking changes
- ReadResult: Field
Errorrenamed toMessage. Callers that read or setresult.Errormust switch toresult.Message.