13#ifndef SENSORMANAGER_H
14#define SENSORMANAGER_H
33#define measure SensorManager::instance()
Abstract interface for all sensors.
float tmp36TemperatureC(int adcValue)
Convert TMP36 ADC reading to degrees Celsius.
void setup()
Initialize the active sensor and any manager state.
SensorManager & operator=(const SensorManager &)=delete
SensorManager(const SensorManager &)=delete
void onExitSleep()
Notify the sensor that the device has woken from deep sleep.
unsigned long _lastPollTime
Timestamp of the last sensor poll (millis).
static SensorManager & instance()
Get the SensorManager singleton instance.
bool isSensorReady() const
Check whether the active sensor is initialized and ready.
bool readTmp112TemperatureC(float &tempC)
Read TMP112A temperature (I2C) in degrees Celsius.
ISensor * _sensor
Currently active sensor implementation (not owned).
SensorData getSensorData() const
Get the latest sensor data from the active sensor.
void initializeFromConfig()
Create and initialize the active sensor based on configuration.
void setSensor(ISensor *sensor)
Set the concrete ISensor implementation to use.
void onEnterSleep()
Notify the sensor that the device is entering deep sleep.
bool isItSafeToCharge()
Determine whether it is safe to charge the battery.
bool batteryState()
Determine whether the battery is present and not critically low.
bool loop()
Poll the active sensor; call from the main loop.
void getSignalStrength()
Update global signal strength strings for logging/telemetry.
static SensorManager * _instance
Pointer to the singleton instance.
Generic sensor data structure.