Skip to content

Phase15 bare metal example updates#93

Draft
JustinKovacich wants to merge 2 commits into
feature/phase14_server_trait_surfacefrom
feature/phase15_bare_metal_example
Draft

Phase15 bare metal example updates#93
JustinKovacich wants to merge 2 commits into
feature/phase14_server_trait_surfacefrom
feature/phase15_bare_metal_example

Conversation

@JustinKovacich
Copy link
Copy Markdown
Contributor

Rewrite the bare_metal_client example to include the new_with_deps integration and add a bare_metal_server example.

JustinKovacich and others added 2 commits April 28, 2026 10:17
…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>
@JustinKovacich JustinKovacich requested a review from Copilot April 28, 2026 14:27
@JustinKovacich JustinKovacich changed the title Feature/phase15 bare metal example Phase15 bare metal example Apr 28, 2026
@JustinKovacich JustinKovacich changed the title Phase15 bare metal example Phase15 bare metal example updates Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_metal canary with examples/bare_metal_client and examples/bare_metal_server workspace members.
  • Add new runnable examples showcasing Client::new_with_deps + static channel pools and Server::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 thread src/lib.rs
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
}
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.

2 participants