refactor(control_plane): remove business http server stack

This commit is contained in:
admin
2026-03-01 13:32:25 +08:00
parent e553cf7835
commit c6602032c7
14 changed files with 56 additions and 2164 deletions

View File

@@ -69,25 +69,16 @@ static esp_err_t lifecycle_start_voice(void) {
return voice_interaction_init();
}
static esp_err_t lifecycle_start_rest_server(void) {
return rest_server_start();
}
static esp_err_t lifecycle_stop_rest_server(void) {
rest_server_stop();
return ESP_OK;
}
static esp_err_t lifecycle_stop_voice(void) {
esp_err_t rc = voice_interaction_stop(NULL, 0);
static esp_err_t lifecycle_stop_printer_protocol(void) {
esp_err_t rc = printer_protocol_stop(domain_policy_printer_stop_timeout_ms());
if (rc == ESP_OK || rc == ESP_ERR_INVALID_STATE) {
return ESP_OK;
}
return rc;
}
static esp_err_t lifecycle_stop_printer_protocol(void) {
esp_err_t rc = printer_protocol_stop(domain_policy_printer_stop_timeout_ms());
static esp_err_t lifecycle_stop_voice(void) {
esp_err_t rc = voice_interaction_stop(NULL, 0);
if (rc == ESP_OK || rc == ESP_ERR_INVALID_STATE) {
return ESP_OK;
}
@@ -159,7 +150,6 @@ esp_err_t controller_lifecycle_start(void) {
bool system_started = false;
bool printer_started = false;
bool voice_started = false;
bool rest_started = false;
const char *failed_stage = "unknown";
failed_stage = "system_runtime";
@@ -183,13 +173,6 @@ esp_err_t controller_lifecycle_start(void) {
}
voice_started = true;
failed_stage = "rest_server";
rc = lifecycle_run_step_with_retry("rest_server", lifecycle_start_rest_server);
if (rc != ESP_OK) {
goto start_failed;
}
rest_started = true;
image_generation_schedule_prewarm();
if (lifecycle_lock_take(1000)) {
@@ -202,9 +185,6 @@ esp_err_t controller_lifecycle_start(void) {
return ESP_OK;
start_failed:
if (rest_started) {
(void)lifecycle_stop_rest_server();
}
if (voice_started) {
(void)lifecycle_stop_voice();
}
@@ -253,12 +233,7 @@ esp_err_t controller_lifecycle_stop(void) {
esp_err_t first_err = ESP_OK;
esp_err_t rc = lifecycle_stop_rest_server();
if (rc != ESP_OK && first_err == ESP_OK) {
first_err = rc;
}
rc = lifecycle_stop_voice();
esp_err_t rc = lifecycle_stop_voice();
if (rc != ESP_OK && first_err == ESP_OK) {
first_err = rc;
}