Adicionar primeiro
This commit is contained in:
6
components/api/include/api.h
Executable file
6
components/api/include/api.h
Executable 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
43
components/api/include/json.h
Executable 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
15
components/api/include/ota.h
Executable 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_ */
|
||||
23
components/api/include/timeout_utils.h
Executable file
23
components/api/include/timeout_utils.h
Executable 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 */
|
||||
Reference in New Issue
Block a user