2023-08-11 18:16:48 -04:00
|
|
|
|
#pragma once
|
2023-09-14 00:34:04 -04:00
|
|
|
|
#include "HardwareAbstract.hpp"
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
#include "KeyPressSim.hpp"
|
2023-09-14 00:34:04 -04:00
|
|
|
|
#include "SDLDisplay.hpp"
|
2023-10-22 14:35:49 -04:00
|
|
|
|
#include "batterySimulator.hpp"
|
2023-09-14 00:34:04 -04:00
|
|
|
|
#include "wifiHandlerSim.hpp"
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-09-14 00:34:04 -04:00
|
|
|
|
#include <thread>
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-09-14 00:34:04 -04:00
|
|
|
|
class HardwareSimulator : public HardwareAbstract {
|
|
|
|
|
public:
|
|
|
|
|
HardwareSimulator();
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
void init() override{};
|
|
|
|
|
void loopHandler() override{};
|
|
|
|
|
|
|
|
|
|
void debugPrint(const char *fmt, ...) override {
|
2023-09-14 00:34:04 -04:00
|
|
|
|
va_list arguments;
|
|
|
|
|
va_start(arguments, fmt);
|
|
|
|
|
vprintf(fmt, arguments);
|
|
|
|
|
va_end(arguments);
|
|
|
|
|
}
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
std::shared_ptr<BatteryInterface> battery() override;
|
|
|
|
|
std::shared_ptr<DisplayAbstract> display() override;
|
|
|
|
|
std::shared_ptr<wifiHandlerInterface> wifi() override;
|
|
|
|
|
std::shared_ptr<KeyPressAbstract> keys() override;
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
char getCurrentDevice() override;
|
|
|
|
|
void setCurrentDevice(char currentDevice) override;
|
2023-09-17 06:14:39 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
bool getWakeupByIMUEnabled() override;
|
|
|
|
|
void setWakeupByIMUEnabled(bool wakeupByIMUEnabled) override;
|
2023-09-17 06:14:39 -04:00
|
|
|
|
|
2023-10-22 14:35:49 -04:00
|
|
|
|
uint16_t getSleepTimeout() override;
|
|
|
|
|
void setSleepTimeout(uint16_t sleepTimeout) override;
|
2023-09-17 06:14:39 -04:00
|
|
|
|
|
2023-09-14 00:34:04 -04:00
|
|
|
|
private:
|
|
|
|
|
std::thread mTickThread;
|
|
|
|
|
std::thread mHardwareStatusTitleUpdate;
|
2023-08-11 18:16:48 -04:00
|
|
|
|
|
2023-09-14 00:34:04 -04:00
|
|
|
|
std::shared_ptr<BatterySimulator> mBattery;
|
|
|
|
|
std::shared_ptr<SDLDisplay> mDisplay;
|
|
|
|
|
std::shared_ptr<wifiHandlerSim> mWifiHandler;
|
2023-10-22 14:35:49 -04:00
|
|
|
|
std::shared_ptr<KeyPressSim> mKeys;
|
2023-08-11 18:16:48 -04:00
|
|
|
|
};
|