summaryrefslogtreecommitdiff
path: root/src/isotp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/isotp.rs')
-rw-r--r--src/isotp.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/isotp.rs b/src/isotp.rs
index 91394bc..c7d3d9c 100644
--- a/src/isotp.rs
+++ b/src/isotp.rs
@@ -12,6 +12,7 @@ use tokio;
use tokio::prelude::*;
use futures::sync::mpsc;
+use futures::stream::SplitStream;
const DEFAULT_BLOCKS: u8 = 16;
@@ -138,7 +139,7 @@ impl OutgoingPacket {
}
pub struct ISOTP {
- canstream: CANStream,
+ canstream: SplitStream<CANStream>,
cansink: mpsc::Sender<CANFrame>,
incoming: HashMap<u16, IncomingPacket>,
outgoing: HashMap<u16, OutgoingPacket>,
@@ -147,8 +148,7 @@ pub struct ISOTP {
impl ISOTP {
pub fn new(interface: &str) -> ISOTP {
- let stream = CANStream::from_name(interface).unwrap();
- let sink = CANStream::from_name(interface).unwrap();
+ let (sink, stream) = CANStream::from_name(interface).unwrap().split();
let (sender, receiver) = mpsc::channel(100);