| Crates.io | doip_rw_tokio |
| lib.rs | doip_rw_tokio |
| version | 0.1.0 |
| created_at | 2024-12-19 07:58:46.856267+00 |
| updated_at | 2024-12-19 07:58:46.856267+00 |
| description | Diagnostic over IP asynchronous API to implement a DoIP tester or entity |
| homepage | |
| repository | https://github.com/rjarzmik/doip_rw_tokio.git |
| max_upload_size | |
| id | 1488896 |
| size | 75,420 |
The doip_rw_tokio crate provides an API on top of doip_rw crate to handle connections and message forDiagnostics Over Internet Protocol (DoIP) messages.
It enables implementing a DoIP tester with :
It enables implementing a DoIP entity with :
This API is oriented for asynchronous IO, and is an API super-set of doip_rw crate, providing methods to send and receive DoIP messages.
allocate_uds method
parameters as well as using as much as possible read_replace() methods in
doip_rw crateDiagnosticMessage both owned and borrowed buffer are availableAdd the following to your Cargo.toml:
[dependencies]
doip_rw_tokio = "0.1.0"
doip_rw = "0.1.0"
A simple asynchronous server example is provided in server It can be run against a DoIP server on localhost, tcp port 13400, by invoking:
cargo run --example server
A simple diagnostic read of DID 0xf012 would look like :
use doip_rw_tokio::*;
let mut tcp = connect_doip_tcp(
"0.0.0.0:13400".parse().unwrap(),
"192.168.11.57:13400".parse().unwrap(),
0x00ed,
Timings {
tcp_connect: Duration::from_secs(1),
routing_activation_rsp: Duration::from_secs(1),
},
)
.await
.unwrap();
send_uds(
&mut tcp,
0x0010,
UdsBuffer::Owned(vec![0x22, 0xf1, 0x80]),
|_, _| vec![],
Duration::from_secs(1),
)
.await
.unwrap();
let msg = tcp.receive_message(|_, _| vec![]).await.unwrap();
if let DoIpTcpMessage::DiagnosticMessage(m) = msg {
println!("Answer: {:2x?}", m.user_data.get_ref())
}
Comprehensive API documentation is available on docs.rs.
Contributions are welcome! Feel free to open issues, submit pull requests, or suggest features. Please follow the Rust Code of Conduct when contributing.
This project is licensed under the MIT License. See the LICENSE file for details.