Phase15 bare metal example updates#93
Draft
JustinKovacich wants to merge 2 commits into
Draft
Conversation
…tion Replace the phase-8 trait-surface canary (raw socket send/recv demo) with a real Client::new_with_deps + define_static_channels! integration that mirrors tests/bare_metal_client.rs. - examples/bare_metal/Cargo.toml: add client + bare_metal features, tokio executor, and critical-section/std (host impl for embassy-sync). - examples/bare_metal/src/main.rs: BareMetalChannels via define_static_channels!, MockFactory/MockSocket/MockTimer, TokioBackedSpawner, #[tokio::main] driver. Docblock is phase-reference free; teardown uses abort+await instead of a sleep; port allocation uses saturating_add; _updates has an explanatory comment. `cargo build -p bare_metal` and `cargo run -p bare_metal` both pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…al_client - Rename examples/bare_metal/ → examples/bare_metal_client/ (package name bare_metal_client) for symmetry with the new server example. - Add examples/bare_metal_server/: demonstrates Server::new_with_deps with a hand-rolled MockSubscriptions (SubscriptionHandle impl), MockFactory/MockSocket/MockTimer, and a current_thread tokio executor. Spawns the announcement loop, yields twice, asserts at least one SD OfferService packet was multicast, then tears down cleanly. Features: server + bare_metal only — no tokio / socket2 from the crate. - Register bare_metal_server in the workspace members list. - Update src/lib.rs doc references from bare_metal to bare_metal_client / bare_metal_server. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s bare-metal verification story by replacing the single bare_metal workspace canary with two runnable, host-executed examples that demonstrate the new *_with_deps constructors for both client and server under default-features = false bare-metal-oriented feature sets.
Changes:
- Replace the prior
examples/bare_metalcanary withexamples/bare_metal_clientandexamples/bare_metal_serverworkspace members. - Add new runnable examples showcasing
Client::new_with_deps+ static channel pools andServer::new_with_deps+ custom subscription handle. - Update crate docs and workspace membership to point at the new examples.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Updates feature-flag docs to reference the new bare-metal examples (but still contains a stale examples/bare_metal/ reference). |
examples/bare_metal_client/src/main.rs |
New client bare-metal integration example using Client::new_with_deps and define_static_channels!. |
examples/bare_metal_client/Cargo.toml |
New workspace member manifest for the bare-metal client example. |
examples/bare_metal_server/src/main.rs |
New server bare-metal integration example using Server::new_with_deps and a mock SubscriptionHandle. |
examples/bare_metal_server/Cargo.toml |
New workspace member manifest for the bare-metal server example. |
examples/bare_metal/src/main.rs |
Removes the previous single bare-metal trait-surface canary example. |
examples/bare_metal/Cargo.toml |
Removes the previous bare-metal example manifest. |
Cargo.toml |
Replaces the examples/bare_metal workspace member with bare_metal_client and bare_metal_server. |
Cargo.lock |
Updates lockfile for the new workspace members. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
40
to
+44
| //! trait-surface canary at `examples/bare_metal/` depends on the crate | ||
| //! with `default-features = false, features = ["bare_metal"]` and | ||
| //! validates that configuration when the `bare_metal` workspace member | ||
| //! is built in isolation (`cargo build -p bare_metal` or | ||
| //! `cargo run -p bare_metal`), rather than as part of a workspace-wide | ||
| //! validates that configuration when the bare-metal workspace members are | ||
| //! built in isolation (`cargo build -p bare_metal_client` / | ||
| //! `cargo build -p bare_metal_server`), rather than as part of a workspace-wide |
Comment on lines
+18
to
+19
| //! cargo build -p bare_metal | ||
| //! cargo run -p bare_metal |
Comment on lines
+167
to
+171
| // impl registers the waker on the network driver's RX-ready | ||
| // interrupt instead of busy-waking. | ||
| None => { | ||
| cx.waker().wake_by_ref(); | ||
| Poll::Pending |
Comment on lines
+138
to
+144
| // No datagram — wake immediately and yield. A real bare-metal | ||
| // impl registers the waker on the network driver's RX-ready | ||
| // interrupt instead of busy-waking. | ||
| None => { | ||
| cx.waker().wake_by_ref(); | ||
| Poll::Pending | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrite the bare_metal_client example to include the new_with_deps integration and add a bare_metal_server example.