add display interface to HardwareAbstract

This commit is contained in:
Matthew Colvin 2023-08-11 23:33:41 -05:00 committed by MatthewColvin
parent 03c4441bb0
commit 35de08d2e3
2 changed files with 8 additions and 3 deletions

View file

@ -2,10 +2,12 @@
HardwareAbstract::HardwareAbstract(
std::shared_ptr<BatteryInterface> aBattery,
std::shared_ptr<wifiHandlerInterface> aWifiHandler
std::shared_ptr<wifiHandlerInterface> aWifiHandler,
std::shared_ptr<DisplayInterface> aDisplay
)
: mBattery(std::move(aBattery)),
mWifiHandler(std::move(aWifiHandler))
mWifiHandler(std::move(aWifiHandler)),
mDisplay(std::move(aDisplay))
{}
std::optional<HardwareAbstract::batteryStatus> HardwareAbstract::getBatteryStatus(){

View file

@ -7,6 +7,7 @@
#include <optional>
#include <string>
#include "BatteryInterface.h"
#include "DisplayInterface.h"
#include "wifiHandlerInterface.h"
class HardwareAbstract {
@ -22,7 +23,8 @@ public:
virtual std::optional<batteryStatus> getBatteryStatus();
HardwareAbstract(std::shared_ptr<BatteryInterface> aBattery = nullptr,
std::shared_ptr<wifiHandlerInterface> aWifiHandler = nullptr
std::shared_ptr<wifiHandlerInterface> aWifiHandler = nullptr,
std::shared_ptr<DisplayInterface> aDisplay = nullptr
);
/// @brief Override in order to do setup of hardware devices
@ -35,4 +37,5 @@ public:
private:
std::shared_ptr<BatteryInterface> mBattery;
std::shared_ptr<wifiHandlerInterface> mWifiHandler;
std::shared_ptr<DisplayInterface> mDisplay;
};