atMETEO
An ATmega based weather station
|
Sensors::Sensor is the base class for sensor specific data decoding. More...
Files | |
file | sensor.h |
Sensors::Sensor is the base class for sensor specific data decoding. | |
Classes | |
class | Sensors::Sensor< TSensor > |
Base class for sensor implementations. More... | |
Enumerations | |
enum | Sensors::SensorStatus : uint8_t { Sensors::SensorStatus::Complete = 0, Sensors::SensorStatus::Incomplete, Sensors::SensorStatus::TooMuchData, Sensors::SensorStatus::InvalidData } |
Sensor status returned from Sensor::setData() and Sensor::addByte(). More... | |
Sensors::Sensor is the base class for sensor specific data decoding.
class Sensors::Sensor |
Base class for sensor implementations.
Usage:
Accessing sensor data is specific to the sensor therefore there is no generic API defined.
The Sensor API has to be implemented by specific sensor decoders:
TSensor | The specific sensor decoder. |
Public Member Functions | |
SensorStatus | setData (uint8_t *data, size_t length) |
Sets the sensor state to the given data buffer. More... | |
SensorStatus | addByte (uint8_t byte) |
Adds the byte to the sensor state. More... | |
void | reset () |
Resets the state of the sensor decoder for receiving a new data set. More... | |
|
inline |
|
inline |
Adds the byte
to the sensor state.
byte | Byte to add. |
byte
.
|
inline |
Resets the state of the sensor decoder for receiving a new data set.
|
strong |
Sensor status returned from Sensor::setData() and Sensor::addByte().
Enumerator | |
---|---|
Complete | The Sensor data is complete. The decoded data can be accessed using sensor specific methods. |
Incomplete | The Sensor data is incomplete. More bytes have to be added using Sensor::addByte() before the data can be accessed. |
TooMuchData | The Sensor data is invalid. Too many bytes have been added. Typically Sensor::reset() needs to be called to start a fresh decoder run. |
InvalidData | The Sensor data is invalid. The parsing failed. Typically Sensor::reset() needs to be called to start a fresh decoder run. |