8000 vector: join channels already active in other applications by tomrford · Pull Request #112 · tomrford/gocan · GitHub
[go: up one dir, main page]

Skip to content

vector: join channels already active in other applications - #112

Merged
tomrford merged 3 commits into
mainfrom
feat/vector-join
Nov 11, 2026
Merged

tomrford merged 3 commits into
mainfrom
feat/vector-join

Conversation

@tomrford
Copy link
Copy Markdown
Owner

Why

Allow BOOST to use gocan alongside an active CANoe or other test application, so automated flashing can share the existing Vector bus without changing its timing.

What changed

  • Discover active Vector channels and their current rates; reuse Config.External to join without requesting initialization access.
  • Cover classical and FD joins, traffic, both close orders, rejoining, and stale discovery; the public lifecycle test writes an ASC trace.
  • Correct the FD bus-off test: mismatched timing checks error reporting, while same-ID data collisions exercise bus-off. Accept the expected bus-off if it occurs during fault injection.
Lines
Code +129 / -22
Tests +406 / -24
Docs and config +5 / -1

Scope

Vector sharing only; existing configured opens remain strict about initialization access. No dependencies or BOOST application changes.

Risks

Discovery and the on-bus check cannot reserve another application's configuration. Its measurement and timing must remain stable while flashing.

Verification

  • Local go test -race ./..., go vet ./..., formatting and diff checks pass.
  • Windows amd64/arm64/386 cross-compilation passes; the affected hardware test also passes Windows amd64 vet.
  • Hardware success reported by the author. The test correction records both FD fault scenarios passing 10/10 on a VN1630A and a passing Vector hardware suite. The final five-line injection-race adjustment was reviewed and compiled here, without another hardware run.

Discover active Vector channels with their current rates and reuse Config.External to join without initialization access or timing changes. Recheck on-bus state before opening and keep ordinary configured opens strict when another port owns initialization access.

Share the classical and FD conformance setup between configured and joined ports. Exercise discovery, bidirectional traffic, both close orders, rejoining, and stale discovery through the public API, with an ASC trace artifact. Document that the owner must keep its measurement and timing stable while flashing.

Validated with go test -race ./..., go vet ./..., gofmt, and Windows amd64/arm64/386 cross-compilation. Vector hardware and CANoe/BOOST flashing have not been run.
Two nodes with mismatched FD data timing cannot drive the sender bus-off:
both reach error-passive after about 15 attempts, after which the sender
sees only missing acknowledgements and its error counter stays at 128.
The mismatched-timing test now asserts that both ends report FD errors and
the receiver keeps running.

The bus-off assertions move to a collision test: both channels queue
colliding frames with the same identifier behind a long blocker frame. The
node sending recessive at the first differing data bit takes a bit error on
every collision and goes bus-off; the other stays open.

Validated on a VN1630A with CH1 and CH2 back-to-back: both tests passed 10/10
and the Vector hardware suite passes.
Native retransmissions may reach bus-off before the test goroutine has queued every collision pair. Treat ErrBusOff from the losing sender as completion of fault injection, then retain the terminal error, event ordering, and surviving-peer assertions.

Portable race tests, vet, formatting, and affected Windows amd64 compilation and vet pass. Hardware validation of the collision setup preceded this adjustment; it was not rerun here.
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Nov 11, 2026 •
Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T13:23:31.460955Z fd68ad6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tomrford
tomrford merged commit 1afa979 into main Nov 11, 2026
1 check passed
@tomrford
tomrford deleted the feat/vector-join branch November 11, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0