Repository navigation
feat(simple_doip): build an entity as a static, its discovery started later - #92
Conversation
JustinKovacich
left a comment
There was a problem hiding this comment.
Stack review of #92–#96, this PR's part: 2 Required, 1 Optional.
Gate: fmt clean; clippy --workspace --all-targets --all-features -W clippy::pedantic 0 hits, and clean for simple_doip on thumbv7em-none-eabihf; cargo test --workspace --all-features passes; cargo hack powerset clean (workspace at depth 2, simple_doip on thumbv7em); cargo doc with -D missing_docs clean; just embedded and the size check match the baseline.
This PR is only usable together with #93: until entity_mut exists, nothing can call start_discovery on an entity inside a DoIpTransport.
Skills run for this review: rust-quality-gate, rust-principles, rust-api-design, rust-embedded, rust-design-review (change-scoped), /code-review, writing-for-customers.
JustinKovacich
left a comment
There was a problem hiding this comment.
Every point from the first round is fixed: a second start_discovery is refused with AlreadyStarted and tested, new_discovery_later's doc states the flash cost and that the acceptor must be a const-built static, and replace_discovery leaves one field list beside assemble.
No comments.
Gates at this head, run locally: cargo fmt --check, clippy pedantic on the workspace (0 hits), cargo test --workspace --all-features, the cargo hack powerset (depth 2), cargo doc with -D missing_docs and broken links denied, and just embedded with both size baselines. All clean.
Skills: rust-quality-gate, rust-principles, rust-api-design, rust-embedded, rust-design-review (change-scoped) and writing-for-customers. /code-review not run: the fixups are small, and I read each line by hand.
Security Audit is red on main too (RUSTSEC-2026-0110 and RUSTSEC-2026-0386), so its failure here is not this PR's.
… later Entity::new_discovery_later is a const fn, so a target whose stack cannot hold an entity builds it as a static's initializer, and start_discovery starts its discovery once the interface has an address and the identity is known. Both constructors share one private const fn. Entity::new keeps its run-time slot table: built from a constant, the table is an image of every buffer in flash, 7 KB more text on the embedded probe. EntityAddress::new becomes a const fn.
91c9800 to
7edaa1e
Compare
…tween events (#93) A server's transport can be reached mutably between events (`Server::transport_mut`, `None` while a response awaits its confirmation), and `DoIpTransport::start_discovery` starts the discovery of an entity built as a static, so an application can start discovery on the server it already owns. `start_discovery` sits behind `uds_on_ip`'s new off-by-default `connection` feature. The embedded probe also measures a server built at run time, against its own size baseline. Depends on #92. ## Issue URL Towards luminartech/halo#5100 ## Testing Run on this branch with the commits of the PRs below it, each commit alone and on the stack's top: - tool self-tests, `validate`, `governance`, the Sphinx needs build, and prose (plain and CI's `--strict crates/uds_c`) - `cargo test --workspace --all-features`; clippy on the host and for `thumbv7em-none-eabihf` - `just embedded` builds on 1.91 for both targets and the size check (matches the baseline) - `cargo doc` with `-D warnings`; `pre-commit run --all-files` - On the stack's top also the uds_c Miri job from `ci.yml` and `cargo package -p uds_c --no-verify`
An entity can now be built as a static, with its vehicle discovery started once the sockets exist, so an embedded image keeps the entity out of a task's stack. Discovery starts once (
AlreadyStartedon a second call); such an entity is a.dataimage, and its constructor isconstonly with aconst-built static acceptor.Issue URL
Towards https://github.com/luminartech/halo/issues/5100
Testing
Run on this branch with the commits of the PRs below it, each commit alone and on the stack's top:
validate,governance, the Sphinx needs build, and prose (plain and CI's--strict crates/uds_c)cargo test --workspace --all-features; clippy on the host and forthumbv7em-none-eabihfjust embeddedbuilds on 1.91 for both targets and the size check (matches the baseline)cargo docwith-D warnings;pre-commit run --all-filesci.ymlandcargo package -p uds_c --no-verify