Adicionar primeiro

This commit is contained in:
2025-06-06 21:17:25 +01:00
parent c188084ba4
commit 282e7f517b
841 changed files with 199592 additions and 1 deletions

6
components/api/include/api.h Executable file
View File

@@ -0,0 +1,6 @@
#ifndef API_H_
#define API_H_
void api_init(void);
#endif /* API_H_ */

43
components/api/include/json.h Executable file
View File

@@ -0,0 +1,43 @@
#ifndef JSON_UTILS_H
#define JSON_UTILS_H
#include "esp_err.h"
#include "cJSON.h"
cJSON* json_get_evse_config(void);
esp_err_t json_set_evse_config(cJSON* root);
cJSON* json_get_wifi_config(void);
esp_err_t json_set_wifi_config(cJSON* root, bool timeout);
cJSON* json_get_wifi_scan(void);
cJSON* json_get_mqtt_config(void);
esp_err_t json_set_mqtt_config(cJSON* root);
//cJSON* json_get_serial_config(void);
//esp_err_t json_set_serial_config(cJSON* root);
cJSON* json_get_modbus_config(void);
esp_err_t json_set_modbus_config(cJSON* root);
//cJSON* json_get_script_config(void);
//esp_err_t json_set_script_config(cJSON* root);
cJSON* json_get_time_config(void);
esp_err_t json_set_time_config(cJSON* root);
cJSON* json_get_state(void);
cJSON* json_get_info(void);
cJSON* json_get_board_config(void);
#endif /* JSON_UTILS_H */

15
components/api/include/ota.h Executable file
View File

@@ -0,0 +1,15 @@
#ifndef OTA_H_
#define OTA_H_
#include <stdbool.h>
#include "esp_err.h"
#define OTA_VERSION_URL "https://dzurikmiroslav.github.io/esp32-evse/firmware/version.txt"
#define OTA_FIRMWARE_URL "https://dzurikmiroslav.github.io/esp32-evse/firmware/"
esp_err_t ota_get_available_version(char* version);
bool ota_is_newer_version(const char* actual, const char* available);
#endif /* OTA_H_ */

View File

@@ -0,0 +1,23 @@
#ifndef TIMEOUT_UTILS_H
#define TIMEOUT_UTILS_H
#include <stdbool.h>
#include "esp_err.h"
/**
* @brief Restart in 5 seconds
*
*/
void timeout_restart(void);
/**
* @brief Set WiFi config in 1 second
*
* @param enabled
* @param ssid
* @param password
* @return esp_err_t
*/
esp_err_t timeout_wifi_set_config(bool enabled, const char* ssid, const char* password);
#endif /* TIMEOUT_UTILS_H */