OMOTE/Platformio/HAL/Targets/Simulator/HardwareSimulator.hpp
MatthewColvin efa2d4a137 Rework Mains so they are basically as identical as possible.
Create HardwareFactory which is responsible for providing the HardwareAbstract to any part of the program based on compiler defines
2023-10-15 08:24:29 -05:00

47 lines
1.2 KiB
C++

#pragma once
#include "HardwareAbstract.hpp"
#include "KeyPressSim.hpp"
#include "SDLDisplay.hpp"
#include "batterySimulator.hpp"
#include "wifiHandlerSim.hpp"
#include <thread>
class HardwareSimulator : public HardwareAbstract {
public:
HardwareSimulator();
void init() override{};
void loopHandler() override{};
void debugPrint(const char *fmt, ...) override {
va_list arguments;
va_start(arguments, fmt);
vprintf(fmt, arguments);
va_end(arguments);
}
std::shared_ptr<BatteryInterface> battery() override;
std::shared_ptr<DisplayAbstract> display() override;
std::shared_ptr<wifiHandlerInterface> wifi() override;
std::shared_ptr<KeyPressAbstract> keys() override;
char getCurrentDevice() override;
void setCurrentDevice(char currentDevice) override;
bool getWakeupByIMUEnabled() override;
void setWakeupByIMUEnabled(bool wakeupByIMUEnabled) override;
uint16_t getSleepTimeout() override;
void setSleepTimeout(uint16_t sleepTimeout) override;
private:
std::thread mTickThread;
std::thread mHardwareStatusTitleUpdate;
std::shared_ptr<BatterySimulator> mBattery;
std::shared_ptr<SDLDisplay> mDisplay;
std::shared_ptr<wifiHandlerSim> mWifiHandler;
std::shared_ptr<KeyPressSim> mKeys;
};