Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ tokio = { version = "1", default-features = false, features = [
tracing = { version = "0.1", default-features = false }

[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread"] }
# `critical-section/std` provides a host-platform impl so integration
# tests that exercise `EmbassySyncChannels` (which depends on
# `embassy-sync`'s critical-section calls) can link on host. This is
# test-only; firmware builds supply their own platform impl.
critical-section = { version = "1", features = ["std"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
tracing-subscriber = "0.3"

[features]
Expand Down Expand Up @@ -92,3 +97,7 @@ bare_metal = ["dep:embassy-sync"]
[[test]]
name = "client_server"
required-features = ["client-tokio", "server"]

[[test]]
name = "bare_metal_client"
required-features = ["client", "bare_metal"]
47 changes: 31 additions & 16 deletions examples/bare_metal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,41 @@
//! - Phase 12: `TransportSocket` GATs — `SendFuture` / `RecvFuture`
//! express `Send` bounds without RTN; `Socket = TokioSocket` pin
//! removed from `bind_*` functions
//! - Phase 13 (partial): client-side feature-flag split. `client` no
//! longer pulls tokio + socket2; the tokio convenience defaults
//! - Phase 13a: client-side feature-flag split. `client` no longer
//! pulls tokio + socket2; the tokio convenience defaults
//! (`Client::new`, `TokioSpawner`, etc.) live behind a new
//! `client-tokio` feature.
//! - Phase 13.5: `Client` is now constructible without
//! `client-tokio`. `Inner` carries `F: TransportFactory` and
//! `T: Timer` generics, and the new
//! `Client::new_with_factory_spawner_timer_and_loopback`
//! constructor takes everything explicitly. Witness:
//! `tests/bare_metal_client.rs` (gated on `client + bare_metal`).
Comment on lines +65 to +70
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This docstring references a Client::new_with_factory_spawner_timer_and_loopback constructor, but the client’s no-tokio entry point in this PR is Client::new_with_deps (and the other constructors are behind client-tokio). Update the example documentation to reflect the actual API name.

Copilot uses AI. Check for mistakes.
//! `service_registry` swapped its `HashMap` for `heapless::FnvIndexMap`.
//! `EmbassySyncChannels` extracted from `tokio_transport` to
//! `crate::embassy_channels` so it is reachable from no-tokio builds.
//!
//! **Remaining gaps:**
//! 1. **Server-side feature-flag split** (Phase 13 server half,
//! deferred to Phase 14): `feature = "server"` still pulls in
//! tokio + socket2 because `server::sd_state` and
//! `server::subscription_manager` reference `tokio::net::UdpSocket`
//! / `tokio::sync::RwLock` / `socket2::Socket` directly. Phase 14
//! (server parallel) is the phase that retargets the server to the
//! trait surface; once that lands, `server` will gain the same
//! 1. **Server-side feature-flag split** (deferred to Phase 14):
//! `feature = "server"` still pulls in tokio + socket2 because
//! `server::sd_state` and `server::subscription_manager` reference
//! `tokio::net::UdpSocket` / `tokio::sync::RwLock` /
//! `socket2::Socket` directly. Phase 14 retargets the server to
//! the trait surface; once that lands, `server` will gain the same
//! `server` + `server-tokio` split.
//! 2. **No-alloc Client**: `Client` / `Inner` still depend on
//! `alloc` (heapless internals are fine, but `EmbassySyncChannels`
//! uses `Arc`, and `e2e_registry` uses `Arc<Mutex<_>>`). Phase 16
//! is the verification phase that lights up an alloc-panicking
//! harness; the no-alloc port itself is its own follow-on phase.
//!
//! # Recommendation for `no_alloc` consumers today
//!
//! Do NOT route through `Client::new_with_spawner_and_loopback`.
//! Instead, depend on `simple-someip` with `default-features = false,
//! features = ["bare_metal"]` and consume the already-portable layers
//! directly:
//! Do NOT route through `Client::new_with_factory_spawner_timer_and_loopback`
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The no_alloc recommendation section names Client::new_with_factory_spawner_timer_and_loopback, which doesn’t exist. Update this to the current constructor (Client::new_with_deps) or otherwise align it with the actual API to avoid confusing readers.

Suggested change
//! Do NOT route through `Client::new_with_factory_spawner_timer_and_loopback`
//! Do NOT route through `Client::new_with_deps`

Copilot uses AI. Check for mistakes.
//! on a strict `no_alloc` target — the run-loop still uses `Arc` for
//! the embassy channel state. For now, depend on `simple-someip` with
//! `default-features = false, features = ["bare_metal"]` and consume
//! the already-portable layers directly:
//!
//! - `simple_someip::protocol` — wire format (headers, messages, SD
//! entries/options); zero-copy views for parsing.
Expand Down Expand Up @@ -413,8 +427,9 @@ fn main() {
println!(
"note: trait layer (TransportSocket + TransportFactory + Timer + \
Spawner + ChannelFactory) exercised end-to-end. Phases 9-12 \
complete; phase 13 (client half) complete. Remaining: phase 14 \
server-trait retargeting + server-side `server-tokio` split. \
See top-of-file docblock."
complete; phases 13a + 13.5 (client + Client engine generic) \
complete. Remaining: phase 14 server-trait retargeting + \
server-side `server-tokio` split, then phase 16 no-alloc \
verification. See top-of-file docblock."
);
}
3 changes: 0 additions & 3 deletions src/client/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ pub enum Error {
/// A SOME/IP protocol-level error.
#[error(transparent)]
Protocol(#[from] crate::protocol::Error),
/// An I/O error from the underlying network transport.
#[error(transparent)]
Io(#[from] std::io::Error),
/// Received a discovery message that was not expected.
#[error("Unexpected discovery message: {0:?}")]
UnexpectedDiscoveryMessage(crate::protocol::Header),
Expand Down
Loading