You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+24-21
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ smip aims to make SOME/IP development in Rust feel as natural as building regula
3
3
4
4
Why is it better than something like vsomeip-rs?
5
5
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:
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.
91
89
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.
93
93
All of these need to be in a special impl block marked with a `methods_impl` attribute for the framework to recognize them.
94
94
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.
95
98
# Aim
96
99
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.
98
101
99
102
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.
104
107
105
108
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**
107
110
108
111
# Run
109
112
For a working demo see `examples/simple.rs` and `examples/simple_client.rs`:
@@ -117,4 +120,4 @@ In another terminal,
117
120
cargo run --example simple_client
118
121
```
119
122
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