Initial commit

This commit is contained in:
2025-07-17 17:47:13 -06:00
commit b1ba6821e1
13 changed files with 1731 additions and 0 deletions

33
main/ota_server.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef OTA_SERVER_H
#define OTA_SERVER_H
#include "esp_err.h"
// OTA server configuration
#define OTA_SERVER_PORT 80
#define OTA_BUFFER_SIZE 1024
#define OTA_RECV_TIMEOUT 5000 // 5 seconds
// OTA update states
typedef enum {
OTA_STATE_IDLE,
OTA_STATE_UPDATING,
OTA_STATE_SUCCESS,
OTA_STATE_ERROR
} ota_state_t;
// OTA progress callback
typedef void (*ota_progress_callback_t)(int percent);
// OTA server functions
esp_err_t ota_server_init(void);
esp_err_t ota_server_start(void);
esp_err_t ota_server_stop(void);
ota_state_t ota_server_get_state(void);
void ota_server_register_progress_callback(ota_progress_callback_t callback);
// Version management
const char* ota_server_get_version(void);
void ota_server_set_version(const char* version);
#endif // OTA_SERVER_H