- Updated KVStorageHandler interface to use std::string instead of char* for key-value operations. - Enhanced NVSStorageHandler to utilize ESP_LOG for error and info messages instead of printf. - Refactored WifiHandler to manage WiFi credentials using JSON format for better structure and storage. - Replaced raw pointers with std::unique_ptr in WifiHandler and NetworkHandler for automatic memory management. - Removed unused TouchHandler and EInkTouchHandler classes to clean up the codebase. - Adjusted CMakeLists.txt to remove unnecessary include directories. - Updated lv_conf.h to enable FreeRTOS and gesture recognition features.
28 lines
683 B
C++
28 lines
683 B
C++
#pragma once
|
|
#include <memory>
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "esp_system.h"
|
|
#include "network/wifi_handler.h"
|
|
#include "esp_http_client.h"
|
|
|
|
// forward declare HttpHandler to avoid circular include with http_handler.h
|
|
class HttpHandler;
|
|
|
|
class NetworkHandler {
|
|
public:
|
|
NetworkHandler(
|
|
std::unique_ptr<WifiHandler> wifiHandler
|
|
);
|
|
~NetworkHandler();
|
|
|
|
void init(EventGroupHandle_t system_event_group);
|
|
WifiHandler& get_wifi_handler();
|
|
// factory method to create HttpHandler instances
|
|
std::unique_ptr<HttpHandler> get_http_handler(const esp_http_client_config_t&& config);
|
|
|
|
|
|
private:
|
|
std::unique_ptr<WifiHandler> wifiHandler;
|
|
bool initialized = false;
|
|
};
|