|
HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
|
Abstract base class for all temperature sensor implementations. More...
#include <BaseTemperature.h>
Public Member Functions | |
| BaseTemperature (const BaseTemperature &)=delete | |
| Copy constructor is deleted to avoid copying instances. | |
| BaseTemperature & | operator= (const BaseTemperature &)=delete |
| Assignment operator is deleted to avoid copying instances. | |
| virtual | ~BaseTemperature () noexcept=default |
| Virtual destructor for proper cleanup of derived classes. | |
| bool | IsInitialized () const noexcept |
| Check if the temperature sensor is initialized. | |
| bool | EnsureInitialized () noexcept |
| Ensures the sensor is initialized (lazy initialization). | |
| bool | EnsureDeinitialized () noexcept |
| Ensures the sensor is deinitialized (lazy deinitialization). | |
| hf_temp_state_t | GetState () const noexcept |
| Get current sensor state. | |
| hf_temp_err_t | ReadTemperatureCelsius (float *temperature_celsius) noexcept |
| Read temperature in Celsius (blocking) | |
| hf_temp_err_t | ReadTemperature (hf_temp_reading_t *reading) noexcept |
| Read temperature with full information (blocking) | |
| hf_temp_err_t | ReadTemperatureFahrenheit (float *temperature_fahrenheit) noexcept |
| Read temperature in Fahrenheit. | |
| hf_temp_err_t | ReadTemperatureKelvin (float *temperature_kelvin) noexcept |
| Read temperature in Kelvin. | |
| hf_temp_err_t | ReadTemperatureUnit (float *temperature, hf_temp_unit_t unit) noexcept |
| Read temperature in specified unit. | |
| virtual hf_temp_err_t | GetSensorInfo (hf_temp_sensor_info_t *info) const noexcept=0 |
| Get sensor information. | |
| virtual hf_u32_t | GetCapabilities () const noexcept=0 |
| Get sensor capabilities. | |
| bool | HasCapability (hf_temp_capabilities_t capability) const noexcept |
| Check if a specific capability is supported. | |
| virtual hf_temp_err_t | SetRange (float min_celsius, float max_celsius) noexcept |
| Set temperature measurement range (advanced feature) | |
| virtual hf_temp_err_t | GetRange (float *min_celsius, float *max_celsius) const noexcept |
| Get temperature measurement range (advanced feature) | |
| virtual hf_temp_err_t | SetResolution (float resolution_celsius) noexcept |
| Set measurement resolution (advanced feature) | |
| virtual hf_temp_err_t | GetResolution (float *resolution_celsius) const noexcept |
| Get measurement resolution (advanced feature) | |
| virtual hf_temp_err_t | SetThresholds (float low_threshold_celsius, float high_threshold_celsius) noexcept |
| Set temperature thresholds (advanced feature) | |
| virtual hf_temp_err_t | GetThresholds (float *low_threshold_celsius, float *high_threshold_celsius) const noexcept |
| Get temperature thresholds (advanced feature) | |
| virtual hf_temp_err_t | EnableThresholdMonitoring (hf_temp_threshold_callback_t callback, void *user_data) noexcept |
| Enable threshold monitoring (advanced feature) | |
| virtual hf_temp_err_t | DisableThresholdMonitoring () noexcept |
| Disable threshold monitoring (advanced feature) | |
| virtual hf_temp_err_t | StartContinuousMonitoring (hf_u32_t sample_rate_hz, hf_temp_reading_callback_t callback, void *user_data) noexcept |
| Start continuous temperature monitoring (advanced feature) | |
| virtual hf_temp_err_t | StopContinuousMonitoring () noexcept |
| Stop continuous temperature monitoring (advanced feature) | |
| virtual bool | IsMonitoringActive () const noexcept |
| Check if continuous monitoring is active (advanced feature) | |
| virtual hf_temp_err_t | Calibrate (float reference_temperature_celsius) noexcept |
| Perform sensor calibration (advanced feature) | |
| virtual hf_temp_err_t | SetCalibrationOffset (float offset_celsius) noexcept |
| Set calibration offset (advanced feature) | |
| virtual hf_temp_err_t | GetCalibrationOffset (float *offset_celsius) const noexcept |
| Get calibration offset (advanced feature) | |
| virtual hf_temp_err_t | ResetCalibration () noexcept |
| Reset calibration to default (advanced feature) | |
| virtual hf_temp_err_t | EnterSleepMode () noexcept |
| Enter low power mode (advanced feature) | |
| virtual hf_temp_err_t | ExitSleepMode () noexcept |
| Exit low power mode (advanced feature) | |
| virtual bool | IsSleeping () const noexcept |
| Check if sensor is in sleep mode (advanced feature) | |
| virtual hf_temp_err_t | SelfTest () noexcept |
| Perform sensor self-test (advanced feature) | |
| virtual hf_temp_err_t | CheckHealth () noexcept |
| Check sensor health status (advanced feature) | |
| virtual hf_temp_err_t | GetStatistics (hf_temp_statistics_t &statistics) noexcept |
| Get operation statistics (advanced feature) | |
| virtual hf_temp_err_t | GetDiagnostics (hf_temp_diagnostics_t &diagnostics) noexcept |
| Get diagnostic information (advanced feature) | |
| virtual hf_temp_err_t | ResetStatistics () noexcept |
| Reset operation statistics (advanced feature) | |
| virtual hf_temp_err_t | ResetDiagnostics () noexcept |
| Reset diagnostic information (advanced feature) | |
Protected Member Functions | |
| virtual bool | Initialize () noexcept=0 |
| Platform-specific implementation for initialization. | |
| virtual bool | Deinitialize () noexcept=0 |
| Platform-specific implementation for deinitialization. | |
| virtual hf_temp_err_t | ReadTemperatureCelsiusImpl (float *temperature_celsius) noexcept=0 |
| Platform-specific implementation for reading temperature in Celsius. | |
| BaseTemperature () noexcept | |
| Protected default constructor. | |
| hf_temp_err_t | ValidateBasicOperation () const noexcept |
| Protected helper to validate basic operation preconditions. | |
Protected Attributes | |
| bool | initialized_ |
| Initialization status. | |
| hf_temp_state_t | current_state_ |
| Current sensor state. | |
Abstract base class for all temperature sensor implementations.
This class defines the common interface that all temperature sensor implementations must follow. It provides a consistent API for temperature measurement, configuration, and monitoring across different sensor types and platforms.
Key features:
|
delete |
Copy constructor is deleted to avoid copying instances.
|
virtualdefaultnoexcept |
Virtual destructor for proper cleanup of derived classes.
|
inlineprotectednoexcept |
Protected default constructor.
|
inlinevirtualnoexcept |
Perform sensor calibration (advanced feature)
| reference_temperature_celsius | Known reference temperature |
|
inlinevirtualnoexcept |
Check sensor health status (advanced feature)
Reimplemented in EspTemperature.
|
protectedpure virtualnoexcept |
Platform-specific implementation for deinitialization.
Implemented in EspTemperature, and StmTemperature.
|
inlinevirtualnoexcept |
Disable threshold monitoring (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Enable threshold monitoring (advanced feature)
| callback | Callback function for threshold events |
| user_data | User data to pass to callback |
Reimplemented in EspTemperature.
|
inlinenoexcept |
Ensures the sensor is deinitialized (lazy deinitialization).
|
inlinenoexcept |
Ensures the sensor is initialized (lazy initialization).
|
inlinevirtualnoexcept |
Enter low power mode (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Exit low power mode (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Get calibration offset (advanced feature)
| offset_celsius | Pointer to store calibration offset |
Reimplemented in EspTemperature, and StmTemperature.
|
pure virtualnoexcept |
Get sensor capabilities.
Implemented in EspTemperature, and StmTemperature.
|
inlinevirtualnoexcept |
Get diagnostic information (advanced feature)
| diagnostics | Reference to diagnostics structure to fill |
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Get temperature measurement range (advanced feature)
| min_celsius | Pointer to store minimum temperature |
| max_celsius | Pointer to store maximum temperature |
Reimplemented in EspTemperature, and StmTemperature.
|
inlinevirtualnoexcept |
Get measurement resolution (advanced feature)
| resolution_celsius | Pointer to store resolution |
Reimplemented in EspTemperature.
|
pure virtualnoexcept |
Get sensor information.
| info | Pointer to store sensor information |
Implemented in EspTemperature, and StmTemperature.
|
inlinenoexcept |
Get current sensor state.
|
inlinevirtualnoexcept |
Get operation statistics (advanced feature)
| statistics | Reference to statistics structure to fill |
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Get temperature thresholds (advanced feature)
| low_threshold_celsius | Pointer to store low threshold |
| high_threshold_celsius | Pointer to store high threshold |
Reimplemented in EspTemperature.
|
inlinenoexcept |
Check if a specific capability is supported.
| capability | Capability to check |
|
protectedpure virtualnoexcept |
Platform-specific implementation for initialization.
Implemented in EspTemperature, and StmTemperature.
|
inlinenoexcept |
Check if the temperature sensor is initialized.
|
inlinevirtualnoexcept |
Check if continuous monitoring is active (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Check if sensor is in sleep mode (advanced feature)
Reimplemented in EspTemperature.
|
delete |
Assignment operator is deleted to avoid copying instances.
|
inlinenoexcept |
Read temperature with full information (blocking)
| reading | Pointer to store complete reading information |
|
inlinenoexcept |
Read temperature in Celsius (blocking)
| temperature_celsius | Pointer to store temperature value |
|
protectedpure virtualnoexcept |
Platform-specific implementation for reading temperature in Celsius.
| temperature_celsius | Pointer to store temperature value |
Implemented in EspTemperature, and StmTemperature.
|
inlinenoexcept |
Read temperature in Fahrenheit.
| temperature_fahrenheit | Pointer to store temperature value |
|
inlinenoexcept |
Read temperature in Kelvin.
| temperature_kelvin | Pointer to store temperature value |
|
inlinenoexcept |
Read temperature in specified unit.
| temperature | Pointer to store temperature value |
| unit | Desired temperature unit |
|
inlinevirtualnoexcept |
Reset calibration to default (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Reset diagnostic information (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Reset operation statistics (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Perform sensor self-test (advanced feature)
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Set calibration offset (advanced feature)
| offset_celsius | Calibration offset in Celsius |
Reimplemented in EspTemperature, and StmTemperature.
|
inlinevirtualnoexcept |
Set temperature measurement range (advanced feature)
| min_celsius | Minimum temperature in Celsius |
| max_celsius | Maximum temperature in Celsius |
Reimplemented in EspTemperature, and StmTemperature.
|
inlinevirtualnoexcept |
Set measurement resolution (advanced feature)
| resolution_celsius | Resolution in Celsius |
|
inlinevirtualnoexcept |
Set temperature thresholds (advanced feature)
| low_threshold_celsius | Low temperature threshold |
| high_threshold_celsius | High temperature threshold |
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Start continuous temperature monitoring (advanced feature)
| sample_rate_hz | Sampling rate in Hz |
| callback | Callback function for each reading |
| user_data | User data to pass to callback |
Reimplemented in EspTemperature.
|
inlinevirtualnoexcept |
Stop continuous temperature monitoring (advanced feature)
Reimplemented in EspTemperature.
|
inlineprotectednoexcept |
Protected helper to validate basic operation preconditions.
|
protected |
Current sensor state.
|
protected |
Initialization status.