OMOTE/Platformio/HAL/Interface/HardwareInterface.h
Matthew Colvin cd603a2a83 Update Battery Interface by adding it to hardwareInterface
Remove Display out of some classes and leave comments to replace for callbacks
I dont know about the function of this code but it compiles :)
2023-09-09 21:44:47 -04:00

30 lines
700 B
C++

// OMOTE Hardware Abstraction
// 2023 Matthew Colvin
#pragma once
#include <lvgl.h>
#include <memory>
#include <optional>
#include <string>
#include "BatteryInterface.h"
class HardwareInterface {
public:
HardwareInterface(std::shared_ptr<BatteryInterface> aBattery);
virtual void init() = 0;
virtual void sendIR() = 0;
virtual void MQTTPublish(const char *topic, const char *payload) = 0;
virtual void debugPrint(std::string message) = 0;
virtual std::optional<BatteryInterface::batteryStatus> getBatteryStatus() {
if(mBattery){
return mBattery->getBatteryPercentage();
}
return std::nullopt;
}
private:
std::shared_ptr<BatteryInterface> mBattery;
};