upkie 6.1.0
Open-source wheeled biped robots
|
Sensor for CPU temperature readings. More...
#include <CpuTemperature.h>
Public Member Functions | |
CpuTemperature (const char *temp_path="/sys/class/thermal/thermal_zone0/temp") | |
Open file to query temperature from the kernel. More... | |
~CpuTemperature () override | |
Close file. | |
std::string | prefix () const noexcept final |
Prefix of output in the observation dictionary. More... | |
void | write (Dictionary &observation) final |
Write output to a dictionary. More... | |
bool | is_disabled () const |
Check if temperature observations are disabled. | |
Public Member Functions inherited from upkie::cpp::sensors::Sensor | |
virtual | ~Sensor () |
Destructor is virtual to deallocate lists of observers properly. | |
virtual std::string | prefix () const noexcept |
Prefix of output in the observation dictionary. More... | |
virtual void | write (Dictionary &observation) |
Write output to a dictionary. More... | |
Sensor for CPU temperature readings.
upkie::cpp::sensors::CpuTemperature::CpuTemperature | ( | const char * | temp_path = "/sys/class/thermal/thermal_zone0/temp" | ) |
Open file to query temperature from the kernel.
[in] | temp_path | Path to thermal-zone special file from the Linux kernel. |
|
inlinefinalvirtualnoexcept |
Prefix of output in the observation dictionary.
Reimplemented from upkie::cpp::sensors::Sensor.
|
finalvirtual |
Write output to a dictionary.
[out] | observation | Dictionary to write observations to. |
Reimplemented from upkie::cpp::sensors::Sensor.