Add typed serial settings operations

Route bounded admin mutations through the existing administration
dispatcher,
covering apply, lifecycle, persistence, authorization, and result
tracking.
Add the browser controls, automatic result refresh, regression coverage,
and
phase documentation.
This commit is contained in:
2026-09-08 00:25:31 +02:00
parent 5a2aa0d4d8
commit 42548f6334
27 changed files with 1398 additions and 42 deletions
+10 -3
View File
@@ -106,10 +106,11 @@ bool web_httpd_unread_body(httpd_req_t *request)
return aux && aux->remaining_len != 0;
}
esp_err_t web_httpd_register_optional_get(httpd_handle_t server, const httpd_uri_t *uri)
esp_err_t web_httpd_register_optional(httpd_handle_t server, const httpd_uri_t *uri)
{
struct httpd_data *hd = server;
if (!hd || !uri || !uri->uri || !uri->handler || uri->method != HTTP_GET ||
if (!hd || !uri || !uri->uri || !uri->handler ||
(uri->method != HTTP_GET && uri->method != HTTP_POST) ||
uri->is_websocket || uri->supported_subprotocol || hd->config.uri_match_fn)
return ESP_ERR_INVALID_ARG;
size_t length = 0;
@@ -118,7 +119,7 @@ esp_err_t web_httpd_register_optional_get(httpd_handle_t server, const httpd_uri
int slot = -1;
for (unsigned i = 0; i < hd->config.max_uri_handlers; ++i) {
if (!hd->hd_calls[i]) { if (slot < 0) slot = (int)i; }
else if (!strcmp(hd->hd_calls[i]->uri, uri->uri) && hd->hd_calls[i]->method == HTTP_GET)
else if (!strcmp(hd->hd_calls[i]->uri, uri->uri) && hd->hd_calls[i]->method == uri->method)
return ESP_ERR_INVALID_STATE;
}
if (slot < 0) return ESP_ERR_NO_MEM;
@@ -134,3 +135,9 @@ esp_err_t web_httpd_register_optional_get(httpd_handle_t server, const httpd_uri
hd->hd_calls[slot] = copy;
return ESP_OK;
}
esp_err_t web_httpd_register_optional_get(httpd_handle_t server, const httpd_uri_t *uri)
{
if (!uri || uri->method != HTTP_GET) return ESP_ERR_INVALID_ARG;
return web_httpd_register_optional(server, uri);
}