pub struct DhtLogger { /* private fields */ }
Expand description

DHT Logger client.

This is for reading data over serial and logging it using various means.

Supported logging methods:

  • verbose: Log incoming data using log::info!

Implementations

Create a DHT logger from an existing serial port.

Args:

  • port: An interface to use as a serial port.
  • logger_config: Configure how data is logged. See the DhtLoggerConfig documentation.

Create a DHT logger from a DhtLoggerConfig.

Get the name of the serial port.

Read sensor data over serial and return it. This blocks until data is readable over the serial interface or a timeout occurs.

Wait for the sensor to return data for a specified amount of retries. If the number of attempts to read data exceed the allowed number of retries, the last error message is returned. If an error occurs, this function sleeps for 100s. All sensor read errors are logged to log::trace! as they arrive.

Log a measurement to the all of the logging channels configured in the logger config for the DHT Logger.

Read data from the DHT sensor serial interface and log data to all logging channels.

Args:

  • retries: Number of sensor read retries (see `wait_for_sensor docs) before giving up.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.