refactor(architecture): enforce component layering constraints

- move runtime policy/diag contracts to domain-owned facade and remove control_plane leapfrog usage

- enforce single declaration point for direct debug config in domain public API (constraint #6)

- harden timeout/idempotent semantics in REST/voice/printer/wifi/ble paths
This commit is contained in:
admin
2026-02-28 14:21:17 +08:00
parent 8a55ca0005
commit a549989332
23 changed files with 718 additions and 331 deletions

View File

@@ -56,12 +56,18 @@ static void wifi_event_handler(void *arg,
(void)event_data;
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
if (!s_started) {
return;
}
(void)esp_wifi_connect();
return;
}
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
s_ready = false;
if (!s_started) {
return;
}
if (s_retry_num < CONFIG_TQ_WIFI_MAXIMUM_RETRY) {
(void)esp_wifi_connect();
s_retry_num++;
@@ -73,6 +79,9 @@ static void wifi_event_handler(void *arg,
}
if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
if (!s_started) {
return;
}
ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
s_retry_num = 0;
@@ -218,6 +227,7 @@ esp_err_t wifi_manager_start(void) {
runtime_diag_counter_add(RUNTIME_DIAG_COUNTER_WIFI_CONNECT_FAILED, 1);
}
runtime_diag_record_error("wifi_connect", err, "STA connect failed");
(void)wifi_manager_stop();
}
return err;
}