Struct PowerSensor::Sensor
Defined in File PowerSensor.hpp
Nested Relationships
This struct is a nested type of Class PowerSensor.
Nested Types
Struct Documentation
-
struct Sensor
Public Functions
- struct PowerSensor3::PowerSensor::Sensor::EEPROM __attribute__ ((packed))
-
void setType(const std::string type)
Set type of sensor.
- Parameters:
type –
-
void setPairName(const std::string pairName)
Set name of sensor pair.
- Parameters:
pairName –
-
void setVref(const float vref)
Set reference voltage of sensor.
- Parameters:
vref –
-
void setSensitivity(const float slope)
Set sensitivity of sensor.
- Parameters:
sensitivity –
-
void setInUse(const bool inUse)
Set whether or not the sensor is in use.
- Parameters:
inUse –
-
void setPolarity(const int polarity)
Set polarity of sensor.
- Parameters:
polarity – (-1 or 1)
-
double getValue() const
Get current calibrated sensor value.
- Returns:
double
-
void readFromEEPROM(int fd)
Read configuration of single sensor from device EEPROM.
- Parameters:
fd – file descriptor to device
-
void writeToEEPROM(int fd) const
Write configuration of single sensor to device EEPROM.
- Parameters:
fd – file descriptor to device
-
void updateLevel(uint16_t level)
Update calibrated sensor value based on raw level.
- Parameters:
level –
-
void reset()
Reset the sensor value to 0.