37#include "../SensorPlatform.hpp"
66 default:
return "UNKNOWN";
194 virtual bool initImpl(uint8_t addr) = 0;
SensorType
Enumeration of sensor types.
@ MULTI_AXIS
Multi-axis sensor.
@ HUMIDITY
Humidity sensor.
@ GYROSCOPE
Gyroscope sensor.
@ PRESSURE
Pressure sensor.
@ UNKNOWN
Unknown sensor type.
@ ACCELEROMETER
Accelerometer sensor.
@ TEMPERATURE
Temperature sensor.
@ MAGNETOMETER
Magnetometer sensor.
Template base class for all sensor implementations.
void setOffset(int16_t x, int16_t y, int16_t z)
Set sensor calibration offsets.
virtual SensorConfig getConfig() const
Get current sensor configuration.
virtual bool isDataReady()=0
Check if new data is available.
SensorConfig _config
Current configuration.
virtual ~SensorBase()=default
Virtual destructor for proper polymorphic cleanup.
float getSensitivity() const
Get sensor sensitivity.
virtual bool readData(T &data)=0
Read data from sensor.
SensorBase(SensorType sensor_type=SensorType::UNKNOWN)
Construct a new SensorBase object.
SensorBase(const SensorBase &)=delete
SensorBase & operator=(const SensorBase &)=delete
virtual bool selfTest()=0
Perform sensor self-test.
SensorInfo _info
Sensor information.
virtual bool reset()=0
Reset sensor to default state.
SensorInfo getSensorInfo() const
Get sensor information.
Utility class providing static sensor-related helper functions.
static const char * typeToString(SensorType type)
Convert sensor type enumeration to string representation.
Structure representing sensor configuration parameters.
Structure containing sensor identification information.
SensorType type
Sensor type.