Add more doc comments

This commit is contained in:
Robert Sammelson 2023-05-17 22:42:45 -04:00
parent fb35987b28
commit 5b20ac0ab9
No known key found for this signature in database
GPG key ID: 92F1F04EDB06B9E9
6 changed files with 29 additions and 4 deletions

View file

@ -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>,

View file

@ -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),
}