Claire/include/backend_communication.hpp

38 lines
717 B
C++
Raw Normal View History

#ifndef __BACKEND_HPP__
#define __BACKEND_HPP__
#include <Arduino.h>
#include <ArduinoJson.h>
#include "../include/root_ca.hpp"
#include "../include/wifi_handler.hpp"
class BackendCommunication {
public:
// Constructor
BackendCommunication(WifiHandler& p_wifi_handler);
public:
// Public methods
bool parseJsonConfig(String& payload);
bool getConfig();
bool getWeatherData();
private:
// Private methods
String urlencode(String str);
public:
// Public member objects
JsonDocument m_config;
bool m_is_config_valid;
JsonDocument m_weather_data;
private:
// Private member objects
WifiHandler& m_wifi_handler;
};
#endif // __BACKEND_HPP__