Files

55 lines
1.5 KiB
C++
Raw Permalink Normal View History

2025-08-04 14:29:49 +08:00
#pragma once
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
2025-08-05 15:24:51 +08:00
#include <MeshSolarBoard.h>
2025-08-04 14:29:49 +08:00
#include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
#include <helpers/sensors/LocationProvider.h>
2026-03-04 03:13:53 +01:00
#include <helpers/ExternalWatchdogManager.h>
2025-08-04 14:29:49 +08:00
#ifdef DISPLAY_CLASS
#include <helpers/ui/ST7789Display.h>
#endif
class SolarSensorManager : public SensorManager {
bool gps_active = false;
bool gps_detected = false;
LocationProvider* _location;
void start_gps();
void stop_gps();
public:
SolarSensorManager(LocationProvider &location): _location(&location) { }
bool begin() override;
bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override;
void loop() override;
int getNumSettings() const override;
const char* getSettingName(int i) const override;
const char* getSettingValue(int i) const override;
bool setSettingValue(const char* name, const char* value) override;
};
2026-03-04 03:13:53 +01:00
class SolarExternalWatchdog : public ExternalWatchdogManager {
2026-01-22 15:03:40 +08:00
public:
2026-03-04 03:13:53 +01:00
SolarExternalWatchdog() {}
2026-01-22 15:03:40 +08:00
bool begin() override;
void loop() override;
unsigned long getIntervalMs() const override;
void feed() override;
};
2025-08-04 14:29:49 +08:00
extern MeshSolarBoard board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern SolarSensorManager sensors;
2026-03-04 03:13:53 +01:00
extern SolarExternalWatchdog external_watchdog;
2025-08-04 14:29:49 +08:00
#ifdef DISPLAY_CLASS
extern DISPLAY_CLASS display;
#endif
bool radio_init();
mesh::LocalIdentity radio_new_identity();