Skip to content

Commit 6d66729

Browse files
committed
Minor README fixes according to review
1 parent 30b392a commit 6d66729

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

README.md

+24-21
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ smip aims to make SOME/IP development in Rust feel as natural as building regula
33

44
Why is it better than something like vsomeip-rs?
55

6-
vsomeip-rs is a Rust binding for the vsomeip C++ library. It exposes the C++ API directly to Rust developers, potentially leading to less Rust-idiomatic code.
7-
Also vsomeip is a very low level someip implementation and is heavily callback oriented.
8-
For example a service definition in vsomeip may look like this:
6+
vsomeip-rs is a Rust binding for the vSomeIP C++ library. It exposes the C++ API directly to Rust developers, potentially leading to less Rust-idiomatic code.
7+
Also vSomeIP is a very low level SOME/IP implementation and is heavily callback oriented.
8+
For example a service definition in vSomeIP may look like this:
99

1010
```rust
1111
use vsomeip_rs::*;
@@ -76,34 +76,37 @@ impl MyService {
7676
}
7777

7878
fn main() {
79-
let config: RuntimeConfig = smip::RuntimeConfig::new(
80-
"Simple",
81-
0xABCD,
82-
instance_id: 0x1,
83-
service: Some(MyService { x: 0 })
84-
);
85-
86-
let application: Runtime = smip::Runtime::new(config);
87-
application.run();
79+
let config = smip::RuntimeConfig::new("Simple", 0xABCD, 0x1);
80+
81+
let application = Runtime::new(config).service(
82+
MyService {
83+
x: 0
84+
}, 30509);
85+
86+
let _ = application.run();
8887
}
8988
```
90-
A service is represented by a struct with a `service` attribute for providing its `id` and other metadata. This struct will also hold all of the service's state.
9189

92-
SOME/IP methods are just rust methods with a special `smip_method` attribute attribute to indicate its id. Whatever you pass as an argument to your method is parsed automatically from the payload, and whatever you return from it serialized into a response and sent back.
90+
A service is represented by a struct with a `service` attribute for providing its `id` and other metadata like the `major_version` (optional) and `minor_version` (optional). This struct will also hold all of the service's state.
91+
92+
SOME/IP methods are just rust methods with a special `smip_method` attribute to indicate its id. Whatever you pass as an argument to your method is parsed automatically from the payload, and whatever you return from it serialized into a response and sent back.
9393
All of these need to be in a special impl block marked with a `methods_impl` attribute for the framework to recognize them.
9494

95+
A `Runtime` needs to be created using a `RuntimeConfig` which which take care of creating and running all of your services.
96+
97+
After adding all your services to the `Runtime`, call `runtime.run()` to start all the services.
9598
# Aim
9699

97-
Smip aims to be a SOME/IP framework and not an implementation of SOME/IP, so its not competing with vsomeip or sommar. Currently vsomeip is used as the underlying implementation but this can be swapped with any compliant implementation in the future.
100+
Smip aims to be a SOME/IP framework and not an implementation of SOME/IP, so its not competing with [vSomeIP](https://github.com/COVESA/vsomeip) or [SommR](https://projects.eclipse.org/projects/automotive.sommr). Currently vSomeIP is used as the underlying implementation but this can be swapped with any compliant implementation in the future.
98101

99102
Key Benefits:
100-
* Macro-Based Definition: The smip macro simplifies the definition of services and methods, reducing the amount of code needed.
101-
* Automatic Serialization/Deserialization: smip handles the serialization and deserialization of your service's data types, so you don't have to write it yourself.
102-
* Rust-Idiomatic API: The framework's API is designed to be Rust-friendly, with a focus on clarity and simplicity.
103-
* Improved Developer Experience: smip streamlines the development process, making it easier to create and manage SOME/IP services in Rust.
103+
* **Macro-Based Definition**: The smip macro simplifies the definition of services and methods, reducing the amount of code needed.
104+
* **Automatic Serialization/Deserialization**: smip handles the serialization and deserialization of your service's data types, so you don't have to write it yourself.
105+
* **Rust-Idiomatic API**: The framework's API is designed to be Rust-friendly, with a focus on clarity and simplicity.
106+
* **Improved Developer Experience**: smip streamlines the development process, making it easier to create and manage SOME/IP services in Rust.
104107

105108

106-
⚠️ **This is a highly experimental framework and doesn't support all features in SOME/IP.**
109+
⚠️ **This is a highly experimental framework and doesn't support all of the features in SOME/IP**
107110

108111
# Run
109112
For a working demo see `examples/simple.rs` and `examples/simple_client.rs`:
@@ -117,4 +120,4 @@ In another terminal,
117120
cargo run --example simple_client
118121
```
119122

120-
- You may need to set the `LD_LIBRARY_PATH` environment to a path that contains the vsomeip library as this is dynamically loaded `LD_LIBRARY_PATH=/usr/local/lib`
123+
- You may need to set the `LD_LIBRARY_PATH` environment to a path that contains the vSomeIP library as this is dynamically loaded `LD_LIBRARY_PATH=/usr/local/lib`

0 commit comments

Comments
 (0)