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
117
118
119
//! # Simple SOME/IP
//!
//! [](https://github.com/luminartech/simple_someip/actions/workflows/ci.yml)
//! [](https://app.codecov.io/gh/luminartech/simple_someip)
//! [](https://crates.io/crates/simple-someip)
//!
//! A Rust implementation of the [SOME/IP](https://github.com/some-ip-com/open-someip-spec)
//! automotive communication protocol — remote procedure calls, event notifications, service
//! discovery, and wire-format serialization.
//!
//! The core protocol layer (`protocol`, `e2e`, and trait modules) is `no_std`-compatible with
//! zero heap allocation, making it suitable for embedded targets. Optional `client` and `server`
//! modules provide async tokio-based networking for `std` environments.
//!
//! ## Modules
//!
//! | Module | `no_std` | Description |
//! |--------|----------|-------------|
//! | [`protocol`] | Yes | Wire format: headers, messages, message types, return codes, and service discovery (SD) entries/options |
//! | [`e2e`] | Yes | End-to-End protection — Profile 4 (CRC-32) and Profile 5 (CRC-16) |
//! | [`WireFormat`] / [`PayloadWireFormat`] | Yes | Traits for serializing messages and defining custom payload types |
//! | [`client`] | No | Async tokio client — service discovery, subscriptions, and request/response (feature `client`) |
//! | [`server`] | No | Async tokio server — service offering, event publishing, and subscription management (feature `server`) |
//!
//! ## Feature Flags
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `client` | no | Async tokio client; implies `std` + tokio + socket2 |
//! | `server` | no | Async tokio server; implies `std` + tokio + socket2 |
//! | `std` | no | Enables std-dependent helpers |
//!
//! By default only the `protocol`, trait, and `e2e` modules are compiled, and the crate
//! builds in `no_std` mode with no allocator requirement.
//!
//! ## Examples
//!
//! ### Encoding a SOME/IP-SD header (`no_std`)
//!
//! ```rust
//! use simple_someip::WireFormat;
//! use simple_someip::protocol::sd::{self, Entry, RebootFlag, ServiceEntry};
//!
//! // Build an SD header with a FindService entry
//! let entries = [Entry::FindService(ServiceEntry::find(0x1234))];
//! // A fresh process should set RebootFlag::RecentlyRebooted until its
//! // session counter wraps past 0xFFFF for the first time.
//! let sd_header =
//! sd::Header::new(sd::Flags::new_sd(RebootFlag::RecentlyRebooted), &entries, &[]);
//!
//! // Encode to bytes
//! let mut buf = [0u8; 64];
//! let n = sd_header.encode(&mut buf.as_mut_slice()).unwrap();
//!
//! // Decode from bytes (zero-copy view)
//! let view = sd::SdHeaderView::parse(&buf[..n]).unwrap();
//! assert_eq!(view.entry_count(), 1);
//! ```
//!
//! ### Async client (requires `feature = "client"`)
//!
//! ```rust,no_run
//! # #[cfg(feature = "client")]
//! # fn wrapper() {
//! use simple_someip::{Client, ClientUpdate, RawPayload};
//!
//! #[tokio::main]
//! async fn main() {
//! // Client::new returns a Clone-able handle and an update stream.
//! let (client, mut updates) = Client::<RawPayload>::new([192, 168, 1, 100].into());
//! client.bind_discovery().await.unwrap();
//!
//! while let Some(update) = updates.recv().await {
//! match update {
//! ClientUpdate::DiscoveryUpdated(msg) => { /* SD message received */ }
//! ClientUpdate::Unicast { message, e2e_status } => { /* unicast reply */ }
//! ClientUpdate::SenderRebooted(addr) => { /* remote reboot */ }
//! ClientUpdate::Error(err) => { /* error */ }
//! }
//! }
//! }
//! # }
//! ```
//!
//! ## References
//!
//! - [Open SOME/IP Specification](https://github.com/some-ip-com/open-someip-spec)
extern crate std;
/// SOME/IP client for discovering services and exchanging messages.
/// End-to-end (E2E) protection utilities for SOME/IP payloads.
/// SOME/IP protocol primitives: headers, messages, return codes, and service discovery.
/// A general-purpose, heap-allocated [`PayloadWireFormat`] implementation.
/// SOME/IP server for offering services and handling incoming requests.
pub use ;
pub use OfferedEndpoint;
pub use ;
pub use ;
pub use ;
pub use Server;