Change LCD display layout from grids to layers (#1438)

* Upgrade component version

* update fonts component version

* change lcd display layout from grids to layers

* Update English README as default

* Handle OTA error code
This commit is contained in:
Xiaoxia
2025-11-17 22:38:31 +08:00
committed by GitHub
parent 764f6e3349
commit 511349a7bd
18 changed files with 630 additions and 495 deletions

View File

@@ -71,7 +71,7 @@ std::unique_ptr<Http> Ota::SetupHttp() {
/*
* Specification: https://ccnphfhqs21z.feishu.cn/wiki/FjW6wZmisimNBBkov6OcmfvknVd
*/
bool Ota::CheckVersion() {
esp_err_t Ota::CheckVersion() {
auto& board = Board::GetInstance();
auto app_desc = esp_app_get_description();
@@ -82,7 +82,7 @@ bool Ota::CheckVersion() {
std::string url = GetCheckVersionUrl();
if (url.length() < 10) {
ESP_LOGE(TAG, "Check version URL is not properly set");
return false;
return ESP_ERR_INVALID_ARG;
}
auto http = SetupHttp();
@@ -92,14 +92,15 @@ bool Ota::CheckVersion() {
http->SetContent(std::move(data));
if (!http->Open(method, url)) {
ESP_LOGE(TAG, "Failed to open HTTP connection");
return false;
int last_error = http->GetLastError();
ESP_LOGE(TAG, "Failed to open HTTP connection, code=0x%x", last_error);
return last_error;
}
auto status_code = http->GetStatusCode();
if (status_code != 200) {
ESP_LOGE(TAG, "Failed to check version, status code: %d", status_code);
return false;
return status_code;
}
data = http->ReadAll();
@@ -112,7 +113,7 @@ bool Ota::CheckVersion() {
cJSON *root = cJSON_Parse(data.c_str());
if (root == NULL) {
ESP_LOGE(TAG, "Failed to parse JSON response");
return false;
return ESP_ERR_INVALID_RESPONSE;
}
has_activation_code_ = false;
@@ -237,7 +238,7 @@ bool Ota::CheckVersion() {
}
cJSON_Delete(root);
return true;
return ESP_OK;
}
void Ota::MarkCurrentVersionValid() {