Přeskočit obsah

File Application.hpp

File List > apps > Application.hpp

Go to the documentation of this file.

#pragma once

#include "AppConfig.hpp"
#include "GxEPD.h"
#include <Arduino_JSON.h>
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <utility>

class Application {
private:
protected:
    std::string httpUrlParamKey;

    std::map<std::string, std::string> httpUrlParams;

    int updateIntervalSec;

    AppConfig& appConfig;

public:
    Application(int updateIntervalSec, AppConfig& appConfig);

    JSONVar requestJson(std::string httpUrlBase, std::string httpUrlParam);

    virtual std::string toString() = 0;

    int getUpdateIntervalSec();

    virtual void buttonClickMiddle() = 0;

    virtual void buttonClickRight() = 0;

    virtual int showDataOnDisplay(GxEPD* display, JSONVar data) = 0;

    virtual int update(GxEPD* display);
};