#include "ota_update.h" #include "esp_log.h" #include "message_handler.h" #include #include #include static uint8_t updateBuffer[UPDATE_BUFFER_SIZE]; static const char *TAG = "ALOX - OTA"; void start_uart_update(uint8_t msgid, const uint8_t *payload, size_t payload_len, uint8_t *send_payload_buffer, size_t send_payload_buffer_size, uint8_t *send_buffer, size_t send_buffer_size) { ESP_LOGI(TAG, "OTA Update Uart Command"); // prepare for writing new partition with ota api // will get 200 bytes each uart message // fill update buffer // write update buffer complete /*int len = build_message(0x02, send_payload_buffer, needed_buffer_size, send_buffer, send_buffer_size); if (len < 0) { ESP_LOGE(TAG, "Error Building UART Message: payload_len, %d, sendbuffer_size: " "%d, mes_len(error): %d", payload_len, send_buffer_size, len); return; } uart_write_bytes(MASTER_UART, send_buffer, len - 1);*/ } void payload_uart_update(uint8_t msgid, const uint8_t *payload, size_t payload_len, uint8_t *send_payload_buffer, size_t send_payload_buffer_size, uint8_t *send_buffer, size_t send_buffer_size) { ESP_LOGI(TAG, "OTA Update Uart Command"); } void end_uart_update(uint8_t msgid, const uint8_t *payload, size_t payload_len, uint8_t *send_payload_buffer, size_t send_payload_buffer_size, uint8_t *send_buffer, size_t send_buffer_size) { ESP_LOGI(TAG, "OTA Update Uart Command"); } void init_ota() { // RegisterCallback(uint8_t msgid, RegisterFunctionCallback callback); }