mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
- SensorManager::getAvailableLPPTypes() reports which LPP types will be present based on initialized sensor flags (temp, humidity, pressure, etc.) - Sensors page renders one row per available type; shows "--" for any sensor that hasn't produced a reading yet instead of hiding the row entirely - LPPReader: add readLuminosity, readPercentage, readConcentration, readDistance - All known LPP types now have proper names and units in the sensor display Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <CayenneLPP.h>
|
|
#include "sensors/LocationProvider.h"
|
|
|
|
#define TELEM_PERM_BASE 0x01 // 'base' permission includes battery
|
|
#define TELEM_PERM_LOCATION 0x02
|
|
#define TELEM_PERM_ENVIRONMENT 0x04 // permission to access environment sensors
|
|
|
|
#define TELEM_CHANNEL_SELF 1 // LPP data channel for 'self' device
|
|
|
|
class SensorManager {
|
|
public:
|
|
double node_lat, node_lon; // modify these, if you want to affect Advert location
|
|
double node_altitude; // altitude in meters
|
|
|
|
SensorManager() { node_lat = 0; node_lon = 0; node_altitude = 0; }
|
|
virtual bool begin() { return false; }
|
|
virtual bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { return false; }
|
|
virtual void loop() { }
|
|
virtual int getNumSettings() const { return 0; }
|
|
virtual const char* getSettingName(int i) const { return NULL; }
|
|
virtual const char* getSettingValue(int i) const { return NULL; }
|
|
virtual bool setSettingValue(const char* name, const char* value) { return false; }
|
|
virtual LocationProvider* getLocationProvider() { return NULL; }
|
|
virtual int getAvailableLPPTypes(uint8_t* types, int max_count) const { return 0; }
|
|
|
|
// Helper functions to manage setting by keys (useful in many places ...)
|
|
const char* getSettingByKey(const char* key) {
|
|
int num = getNumSettings();
|
|
for (int i = 0; i < num; i++) {
|
|
if (strcmp(getSettingName(i), key) == 0) {
|
|
return getSettingValue(i);
|
|
}
|
|
}
|
|
return NULL;
|
|
}
|
|
};
|