Files
DigiRadio/Software/components/services/ota/src/OtaError.cpp
T
micheleandCursor b0cff8369e Add ESP32 OTA firmware update with rollback confirmation.
Stream application binaries to the inactive OTA slot via POST /api/system/ota,
validate the esp_app_desc project name in core, and cancel rollback after a
healthy network boot through OtaService::confirmBoot().

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:29 +02:00

42 lines
962 B
C++

/**
* @file OtaError.cpp
* @brief OtaError token strings.
*
* DigiRadio firmware — https://github.com/manvalan/DigiRadio
*
* Copyright 2026 Michele Bigi
* SPDX-License-Identifier: Apache-2.0
*
* @author Michele Bigi
* @date 2026-07-07
*/
#include "ota/OtaError.hpp"
namespace ota {
const char* otaErrorToken(OtaError error) noexcept
{
switch (error) {
case OtaError::SessionActive:
return "session_active";
case OtaError::NoUpdatePartition:
return "no_update_partition";
case OtaError::BeginFailed:
return "begin_failed";
case OtaError::WriteFailed:
return "write_failed";
case OtaError::EndFailed:
return "end_failed";
case OtaError::ImageTooLarge:
return "image_too_large";
case OtaError::SetBootFailed:
return "set_boot_failed";
case OtaError::ConfirmFailed:
return "confirm_failed";
}
return "unknown";
}
} // namespace ota