Skip to content

Releases: otfabric/go-s7comm

go-s7comm v0.7.5

Choose a tag to compare

@github-actions github-actions released this 30 Jul 20:42

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-cotpv1.0.3v1.0.4
  • go-tpkt (indirect) — v1.0.0v1.0.1

Unchanged

  • No API, wire, or behavioural changes. Import path remains github.com/otfabric/go-s7comm.

go-s7comm v0.7.4

Choose a tag to compare

@github-actions github-actions released this 30 Jul 00:09

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 — adapts slog.Handler to the existing printf-style Logger (nil handler → 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 at client, model, and wire.
  • 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; WithTimeout bounds Connect, not later PDUs; document UploadBlock cleanup context.
  • Logger / WithLogger godoc — nil default, printf-style args, synchronous request-path cost.
  • Connect loggingError("Connect failed: %v", err) so the error is formatted correctly.
  • READMEProject structure tree (packages + docs); replaces the late bullet-only package list.
  • README badges — Added pkg.go.dev; normalized Go 1.23%2B and Codecov link to codecov.io/gh/....

Dependencies

  • go-cotpv1.0.2v1.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: MIT to all first-party .go files (build tags preserved on interop/).
  • README — License section pointing at LICENSE.

Build / tooling

  • Makefile — exports GOWORK=off.
  • Testsclient package 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

Choose a tag to compare

@github-actions github-actions released this 20 Jul 22:01

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, …), wire S7Error / 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.1 to v1.0.2 (stable). No public API changes in go-s7comm.

Breaking changes

  • None (docs + dependency bump).

go-s7comm v0.7.2

Choose a tag to compare

@github-actions github-actions released this 18 Jul 09:37

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 0x00 remain 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-0x00 rejection handling is preserved; only rejected items with a meaningful declared payload become stricter.

go-s7comm v0.7.1

Choose a tag to compare

@github-actions github-actions released this 17 Jul 14:50

Date: 2026-07-17
Previous release: v0.7.0

Summary

  • Native bit API: Public model.BitAddress plus client.ReadBit / WriteBit / ReadDBBit / WriteDBBit using S7 BIT transport (not byte read-modify-write). Wire helpers: S7AnyBitAddress, EncodeS7AnyBit, EncodeReadVarBitRequest, EncodeWriteVarBitRequest, DecodeAsBit. Existing byte EncodeS7Any / ReadArea / WriteArea APIs unchanged. Interop HasBit steps use the public bit API.

Breaking changes

  • None (additive).

go-s7comm v0.7.0

Choose a tag to compare

@github-actions github-actions released this 17 Jul 13:58
0a1d38c

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 transport package: Deleted the local TCP/TPKT wrapper. The client dials TCP and completes the TP0 handshake via go-cotp directly (dial helpers live in client).
  • Dependencies: Direct module dependency is github.com/otfabric/go-cotp only. github.com/otfabric/go-tpkt is transitive via go-cotp (no production or test imports of go-tpkt in this module).
  • wire: Replaced InspectFrame with InspectTPDU (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 size 0x00 (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 under interop/testdata/fixtures/. make interop / CI workflow .github/workflows/interop.yml on 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/transport removed. Use go-cotp directly for custom TP0 sessions; the high-level client package already does.
  • wire.InspectFrame replaced by wire.InspectTPDU (input is a COTP TPDU, not a full TPKT frame). FrameSummary.TPKTLength renamed to TPDULength.

go-s7comm v0.6.3

Choose a tag to compare

@github-actions github-actions released this 24 Mar 08:47

Date: 2026-03-24
Previous release: v0.6.2

Summary

  • Module rename: Module path changed from github.com/otfabric/s7comm to github.com/otfabric/go-s7comm to align with the go- 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.yml with dedicated ci.yml that calls the shared reusable workflow otfabric/.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.yml calls the shared reusable workflow otfabric/.github/.github/workflows/go-package-release.yml@v2 with workflow_dispatch for manual patch/minor/major bumps.

Breaking changes

  • Import path: All consumers must update their imports from github.com/otfabric/s7comm/... to github.com/otfabric/go-s7comm/....

v0.6.2

Choose a tag to compare

@boeboe boeboe released this 14 Mar 20:45

Release v0.6.2

Date: 2026-03-13
Previous release: v0.6.1

Summary

  • Parameter-level error codes: wire.ParamErrorFromParam and wire.ParamErrorCodeString for 16-bit S7 parameter error codes; wire.NewS7ErrorWithParam uses 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). NormalizeResponseDataLength handles all; ResponseTransportSize constants and String() for diagnostics.
  • Memory areas: AreaDataRecord (0x01), AreaS7200AO (0x07), AreaIECCounter200 (30), AreaIECTimer200 (31); ValidateArea accepts 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 expanded szlIDNames for 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

Choose a tag to compare

@boeboe boeboe released this 14 Mar 17:24

Go 1.22

v0.6.0

Choose a tag to compare

@boeboe boeboe released this 14 Mar 15:58

Release v0.6.0

Date: 2026-03-13
Previous release: v0.5.1

Summary

  • ReadResult API: Field Error renamed to Message (human-readable only; not stable API). Added Success() (same as OK()). Documented Status as canonical outcome, Err() as convenience adapter, and Cause as optional/non-stable.
  • Package docs: Outcome models (Strict / Structured / Best-effort) and canonical read pattern (err then res.Err() then res.Data). Stable sentinels: ErrNotConnected, ErrRequestExceedsPDU, PDURefMismatchError, ValidationError, ReadStatus; ErrProtocolFailure documented 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). Use errors.As(err, &ValidationError{}) to detect.
  • Handshake protocol errors: COTP/S7 decode and shape failures in performCOTPConnect and performS7Setup wrap ErrProtocolFailure; setup PDU ref mismatch returns PDURefMismatchError.
  • 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 → partial BlockInfo (Type, Number) plus err.
  • 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. /24 or 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.Size is 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 for CompareRead.

Breaking changes

  • ReadResult: Field Error renamed to Message. Callers that read or set result.Error must switch to result.Message.