Fix errors in doc comments

This commit is contained in:
Robert Sammelson 2023-05-31 21:23:54 -04:00
parent 13b9041511
commit db4b4d990d
No known key found for this signature in database
GPG key ID: 92F1F04EDB06B9E9
5 changed files with 12 additions and 12 deletions

View file

@ -19,21 +19,21 @@ use crate::{Obd2Device, Result};
func! {
/// Trait for devices that can retrieve data over OBD-II
///
/// Automatically implemented for implementors of [odb2::Obd2Device](crate::Obd2Device), and
/// Automatically implemented for implementers of [odb2::Obd2Device](crate::Obd2Device), and
/// currently cannot be otherwise implemented.
trait Obd2DataRetrieval;
{
/// Retreive the VIN (vehicle identification number)
/// Retrieve the VIN (vehicle identification number)
///
/// This should match the number printed on the vehicle, and is a good
/// command for checking that the OBD-II interface is working correctly.
/// This should match the number printed on the vehicle, and is a good command for checking
/// that the OBD-II interface is working correctly.
fn get_vin(self, 0x09, 0x02) -> Result<String> {
implementation::get_vin(self)
}
}
/// Get DTCs for each ECU
/// Get list of DTCs for each ECU
fn get_dtcs(0x03) -> Vec<Dtc>;
/// Get service 1 PID support for $01 to $20
@ -88,7 +88,7 @@ func! {
/// Get the fuel pressure in kPa
///
/// This measurement is gauge pressure (measured relative to the atmosphere)
/// This measurement is gauge pressure (measured relative to the atmosphere).
fn get_fuel_pressure<u8>(0x01, 0x0A, |v: i16| v * 3) -> i16;
/// Get the intake manifold pressure in kPa

View file

@ -59,7 +59,7 @@ impl fmt::Display for Dtc {
}
}
/// Data retreived when reading an oxygen sensor
/// Data retrieved when reading an oxygen sensor
pub struct OxygenSensorData {
/// The current voltage reading (V)
pub voltage: f32,

View file

@ -55,9 +55,9 @@ impl Obd2Reader for Elm327 {
/// Read data until the ELM327's prompt character is printed
///
/// This will recieve the entire OBD-II response. The prompt signifies that the ELM327 is ready
/// This will receive the entire OBD-II response. The prompt signifies that the ELM327 is ready
/// for another command. If this is not called after each OBD-II command is sent, the prompt
/// character will come out of the recieve queue later and because it is not valid hex this
/// character will come out of the receive queue later and because it is not valid hex this
/// could cause problems. If a timeout occurs, `Ok(None)` will be returned.
fn get_response(&mut self) -> Result<Option<Vec<u8>>> {
self.get_until(b'>', true)
@ -279,7 +279,7 @@ impl Elm327 {
.map(|o| o.and_then(|resp| String::from_utf8(resp).ok()))
}
/// Function for sendinga a raw string, without encoding into ASCII hex
/// Function for sending a raw string, without encoding into ASCII hex
fn send_serial_str(&mut self, data: &str) -> Result<()> {
trace!("send_serial_str: sending {:?}", data);

View file

@ -3,7 +3,7 @@ pub type Result<T> = std::result::Result<T, Error>;
/// An error with OBD-II communication
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// An error occured in the [Odb2BaseDevice](crate::device::Obd2BaseDevice)
/// An error occurred in the [Odb2BaseDevice](crate::device::Obd2BaseDevice)
#[error("Device error: `{0:?}`")]
Device(DeviceError),

View file

@ -4,7 +4,7 @@ use super::{device::Obd2BaseDevice, Error, Obd2Device, Result};
/// An OBD-II interface
///
/// Wraps an implementor of [Obd2BaseDevice] to allow for higher-level usage of the OBD-II
/// Wraps an implementer of [Obd2BaseDevice] to allow for higher-level usage of the OBD-II
/// interface.
#[derive(Default)]
pub struct Obd2<T: Obd2BaseDevice> {