Add more doc comments
This commit is contained in:
parent
fb35987b28
commit
5b20ac0ab9
6 changed files with 29 additions and 4 deletions
|
@ -13,6 +13,9 @@ use super::{Error, Obd2BaseDevice, Obd2Reader, Result};
|
|||
/// Commands to the device itself are indicated by sending "AT" followed by the command, while
|
||||
/// plain strings of hex data indicate OBD-II requests to be sent to the vehicle. The responses of
|
||||
/// the vehicle are echoed back as hex characters. Capitalization and spaces are always ignored.
|
||||
///
|
||||
/// [Datasheet for v1.4b](https://github.com/rsammelson/obd2/blob/master/docs/ELM327DSH.pdf), and
|
||||
/// the [source](https://www.elmelectronics.com/products/dsheets/).
|
||||
pub struct Elm327 {
|
||||
device: ftdi::Device,
|
||||
buffer: VecDeque<u8>,
|
||||
|
|
|
@ -50,10 +50,15 @@ pub trait Obd2Reader {
|
|||
/// Error type for low-level ODB-II communication issues
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
/// An error with the underlying [FTDI device](ftdi::Device)
|
||||
#[error("FTDI error: `{0:?}`")]
|
||||
Ftdi(ftdi::Error),
|
||||
|
||||
/// An I/O error in a low-level [std::io] stream operation
|
||||
#[error("IO error: `{0:?}`")]
|
||||
IO(std::io::Error),
|
||||
|
||||
/// An OBD-II or interface device protocol error
|
||||
#[error("Communication error: `{0}`")]
|
||||
Communication(String),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue