-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
116 lines (107 loc) · 4.63 KB
/
Copy pathCargo.toml
File metadata and controls
116 lines (107 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[workspace]
members = [
".",
"examples/bare_metal_client",
"examples/bare_metal_server",
"examples/client_server",
"examples/discovery_client",
]
[package]
name = "simple-someip"
version = "0.7.0"
edition = "2024"
license = "MIT OR Apache-2.0"
description = "A lightweight SOME/IP serialization and communication library"
repository = "https://github.com/luminartech/simple_someip"
[dependencies]
crc = "3.4"
# embassy-sync provides no_std-compatible bounded channels used as the
# channel backend when the `bare_metal` feature is active. The
# `critical-section` and `portable-atomic` deps ship with embassy-sync and
# are satisfiable on the Infineon AURIX TriCore target (HighTec toolchain)
# per the bare_metal_plan_v2 TriCore delta.
embassy-sync = { version = "0.6", optional = true }
embedded-io = { version = "0.7" }
# `futures` pulls in `futures-util` which provides the executor-agnostic
# `select!` macro and `FutureExt::fuse` / `pin_mut!` helpers — used by
# the client/server event loops in place of `tokio::select!`. Default
# features disabled so we only pull in the parts we use.
futures = { version = "0.3", default-features = false, features = [
"async-await",
"std",
], optional = true }
heapless = "0.9"
socket2 = { version = "0.5", optional = true, features = ["all"] }
thiserror = { version = "2", default-features = false }
tokio = { version = "1", default-features = false, features = [
"macros",
"net",
"rt",
"sync",
"time",
], optional = true }
tracing = { version = "0.1", default-features = false }
[dev-dependencies]
# `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]
default = ["std"]
std = ["embedded-io/std", "thiserror/std", "tracing/std"]
# Phase 13a split: `client` exposes the protocol/trait-surface client
# (no tokio, no socket2); `client-tokio` layers the tokio + socket2
# convenience defaults on top. Consumers of the bare-metal trait surface
# enable `client` only (and supply their own `Spawner` / `Timer` /
# `ChannelFactory` / `TransportFactory` impls). Consumers who want the
# `Client::new` shortcut (defaulting to `TokioSpawner` / `TokioTimer` /
# `TokioChannels` / `TokioTransport`) enable `client-tokio`.
client = ["std", "dep:futures"]
client-tokio = ["client", "dep:tokio", "dep:socket2"]
# Phase 14b split (matches phase 13a on the client side): `server`
# exposes the trait-surface server (no tokio, no socket2). The engine
# itself uses `futures::select!` so `dep:futures` lives here.
# `server-tokio` adds the tokio + socket2 convenience defaults
# (`Server::new`, `Server::new_with_loopback`, `Server::new_passive`),
# bringing `Arc<Mutex<E2ERegistry>>` / `Arc<RwLock<SubscriptionManager>>`
# / `TokioTransport` / `TokioTimer` defaults into scope.
server = ["std", "dep:futures"]
server-tokio = ["server", "dep:tokio", "dep:socket2"]
# Marks a build as intended for bare-metal / no_std consumption.
# Currently a pure marker — enables no crate code on its own. Reserved
# for future phases to gate no_std-specific helper types.
#
# **To demonstrate the bare-metal trait surface, use the
# `examples/bare_metal` workspace member directly:** `cargo run -p
# bare_metal`. That workspace member depends on `simple-someip` with
# `default-features = false, features = ["bare_metal"]`, so it
# exercises the actual bare-metal configuration.
#
# Enabling `bare_metal` on its own does NOT make the crate
# bare-metal-complete: the `client` and `server` feature paths still
# spawn per-socket I/O loops on `tokio::spawn`, and a fully tokio-free
# build additionally needs a user-provided `Spawner` impl (phase 9).
# `bare_metal` activates embassy-sync as the channel backend. The feature
# is a prerequisite for the Phase 11 channel-handle abstraction: with
# `bare_metal` enabled, `EmbassySyncChannels` is available as the
# `ChannelFactory` impl that does not depend on tokio.
bare_metal = ["dep:embassy-sync"]
[[test]]
name = "client_server"
required-features = ["client-tokio", "server-tokio"]
[[test]]
name = "bare_metal_client"
required-features = ["client", "bare_metal"]
[[test]]
name = "static_channels_alloc_witness"
required-features = ["client", "bare_metal"]
[[test]]
name = "no_alloc_witness"
required-features = ["client", "bare_metal"]
harness = false
[[test]]
name = "bare_metal_server"
required-features = ["server", "bare_metal"]