Skip to content

Commit bfdb2c0

Browse files
committed
initial mdbook docs structure
1 parent 7fafbbd commit bfdb2c0

File tree

15 files changed

+225
-114
lines changed

15 files changed

+225
-114
lines changed

rustecal/docs/src/SUMMARY.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Summary
22

33
- [Introduction](introduction.md)
4-
- [Usage Guide](usage.md)
5-
- [Message Types](types.md)
6-
- [Architecture Overview](architecture.md)
4+
- [Getting Started](setup/prerequisites.md)
5+
- [Install eCAL](setup/ecal_installation.md)
6+
- [Project Structure](project_structure.md)
7+
- [Message Types](types/message_types.md)
8+
- [Examples](examples/index.md)
9+
- [Binary](examples/binary.md)
10+
- [String](examples/string.md)
11+
- [Protobuf](examples/protobuf.md)
12+
- [API Documentation](api/index.md)
13+
- [Project Status](project_status.md)
14+
- [About](about.md)

rustecal/docs/src/about.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# About
2+
3+
Created by Rex Schilasky
4+
🚗 Automotive | 🧠 SDV | 🛠️ Rust | 🚀 IPC
5+
6+
## License
7+
8+
Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)

rustecal/docs/src/architecture.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Binary Message Example
2+
3+
## Publisher
4+
5+
```rust
6+
use rustecal::{Ecal, EcalComponents, TypedPublisher};
7+
use rustecal_types_bytes::BytesMessage;
8+
9+
fn main() {
10+
Ecal::initialize(Some("blob publisher"), EcalComponents::DEFAULT).unwrap();
11+
let pub_ = TypedPublisher::<BytesMessage>::new("blob").unwrap();
12+
let mut counter = 0u8;
13+
loop {
14+
let buf = vec![counter; 1024];
15+
pub_.send(&BytesMessage(buf));
16+
counter = counter.wrapping_add(1);
17+
std::thread::sleep(std::time::Duration::from_millis(500));
18+
}
19+
}
20+
```
21+
22+
## Subscriber
23+
24+
```rust
25+
use rustecal::{Ecal, EcalComponents, TypedSubscriber};
26+
use rustecal_types_bytes::BytesMessage;
27+
28+
fn main() {
29+
Ecal::initialize(Some("blob subscriber"), EcalComponents::DEFAULT).unwrap();
30+
let mut sub = TypedSubscriber::<BytesMessage>::new("blob").unwrap();
31+
sub.set_callback(|msg| {
32+
println!("Received blob of {} bytes", msg.msg.0.len());
33+
});
34+
while Ecal::ok() {
35+
std::thread::sleep(std::time::Duration::from_millis(500));
36+
}
37+
}
38+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Examples
2+
3+
Code samples for using rustecal.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Protobuf Message Example
2+
3+
## Publisher
4+
5+
```rust
6+
use rustecal::{Ecal, EcalComponents, TypedPublisher};
7+
use rustecal_types_protobuf::{ProtobufMessage, IsProtobufType};
8+
mod person { include!(concat!(env!("OUT_DIR"), "/pb.people.rs")); }
9+
use person::Person;
10+
11+
impl IsProtobufType for Person {}
12+
13+
fn main() {
14+
Ecal::initialize(Some("protobuf publisher"), EcalComponents::DEFAULT).unwrap();
15+
let pub_ = TypedPublisher::<ProtobufMessage<Person>>::new("person").unwrap();
16+
loop {
17+
let person = Person { id: 1, name: "Alice".into(), ..Default::default() };
18+
pub_.send(&ProtobufMessage(person));
19+
std::thread::sleep(std::time::Duration::from_millis(500));
20+
}
21+
}
22+
```
23+
24+
## Subscriber
25+
26+
```rust
27+
use rustecal::{Ecal, EcalComponents, TypedSubscriber};
28+
use rustecal_types_protobuf::ProtobufMessage;
29+
mod person { include!(concat!(env!("OUT_DIR"), "/pb.people.rs")); }
30+
use person::Person;
31+
32+
fn main() {
33+
Ecal::initialize(Some("protobuf subscriber"), EcalComponents::DEFAULT).unwrap();
34+
let mut sub = TypedSubscriber::<ProtobufMessage<Person>>::new("person").unwrap();
35+
sub.set_callback(|msg| println!("Received person: {}", msg.msg.0.name));
36+
while Ecal::ok() {
37+
std::thread::sleep(std::time::Duration::from_millis(500));
38+
}
39+
}
40+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# String Message Example
2+
3+
## Publisher
4+
5+
```rust
6+
use rustecal::{Ecal, EcalComponents, TypedPublisher};
7+
use rustecal_types_string::StringMessage;
8+
9+
fn main() {
10+
Ecal::initialize(Some("string publisher"), EcalComponents::DEFAULT).unwrap();
11+
let publisher = TypedPublisher::<StringMessage>::new("hello").unwrap();
12+
loop {
13+
let msg = StringMessage(format!("Hello from Rust"));
14+
publisher.send(&msg);
15+
std::thread::sleep(std::time::Duration::from_millis(500));
16+
}
17+
}
18+
```
19+
20+
## Subscriber
21+
22+
```rust
23+
use rustecal::{Ecal, EcalComponents, TypedSubscriber};
24+
use rustecal_types_string::StringMessage;
25+
26+
fn main() {
27+
Ecal::initialize(Some("string subscriber"), EcalComponents::DEFAULT).unwrap();
28+
let mut sub = TypedSubscriber::<StringMessage>::new("hello").unwrap();
29+
sub.set_callback(|msg| println!("Received: {}", msg.msg.0));
30+
while Ecal::ok() {
31+
std::thread::sleep(std::time::Duration::from_millis(500));
32+
}
33+
}
34+
```

rustecal/docs/src/introduction.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
# Introduction
22

3-
Welcome to **rustecal**, a safe and idiomatic Rust binding for [Eclipse eCAL](https://github.com/eclipse-ecal/ecal).
4-
5-
This project is designed to bring fast and reliable pub-sub and service-based IPC to Rust-based applications in domains such as robotics, automotive, embedded, and distributed systems.
6-
7-
rustecal wraps the low-level `ecal_c` C API and builds ergonomic, type-safe abstractions for working with:
8-
9-
- Publishers and Subscribers
10-
- Strongly typed message serialization (e.g., Strings, Bytes, Protobuf)
11-
- Cross-platform interprocess communication
12-
13-
This documentation will guide you through usage, architecture, and message type support.
3+
`rustecal` is a safe and idiomatic Rust wrapper for [Eclipse eCAL](https://github.com/eclipse-ecal/ecal), designed for high-performance interprocess communication (IPC) in robotics, automotive, and embedded systems.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Roadmap
2+
3+
- [x] Cross-platform support (Windows, Linux)
4+
- [x] Safe API for initialization, shutdown, and pub/sub
5+
- [x] Typed pub/sub APIs
6+
- [x] Modular type crates (string, bytes, protobuf)
7+
- [x] Examples for all supported types
8+
- [ ] Protobuf descriptor introspection
9+
- [ ] eCAL Services (RPC-style)
10+
- [ ] Monitoring and logging support
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Project Structure
2+
3+
| Crate | Description |
4+
|-------|-------------|
5+
| `rustecal-sys` | Low-level unsafe bindings (via `bindgen`) |
6+
| `rustecal` | Safe and idiomatic high-level wrapper |
7+
| `rustecal-types-bytes` | Support for raw byte messages |
8+
| `rustecal-types-string` | UTF-8 string message support |
9+
| `rustecal-types-protobuf` | Protobuf support using `prost` |
10+
| `rustecal-samples` | Working binary examples |
11+
12+
## Workspace Layout
13+
14+
```
15+
your_workspace/
16+
├── rustecal/
17+
├── rustecal-sys/
18+
├── rustecal-types-bytes/
19+
├── rustecal-types-string/
20+
├── rustecal-types-protobuf/
21+
└── rustecal-samples/
22+
└── pubsub/
23+
├── blob_send/
24+
├── blob_receive/
25+
├── hello_send/
26+
├── hello_receive/
27+
├── person_send/
28+
└── person_receive/
29+
```

0 commit comments

Comments
 (0)