Skip to content

Commit

Permalink
Clear ingress on serial read error (FactbirdHQ#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmja authored May 18, 2023
1 parent c26fb5c commit 46d4916
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atat/src/ingress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ pub trait AtatIngress {
}
Err(e) => {
error!("Got serial read error {:?}", e.kind());
self.clear();
}
}
}
}

fn clear(&mut self);
}

pub struct Ingress<
Expand Down Expand Up @@ -292,6 +295,10 @@ impl<
self.pos -= swallowed;
}
}

fn clear(&mut self) {
self.pos = 0;
}
}

#[cfg(test)]
Expand Down

0 comments on commit 46d4916

Please sign in to comment.