fix: use max connection count as max client count
All checks were successful
Build ESP32 BMC Firmware / build (push) Successful in 57s

This commit is contained in:
2026-03-12 18:12:36 +01:00
parent 6e88ce1137
commit e678ccb8b3
2 changed files with 4 additions and 5 deletions

View File

@@ -72,7 +72,6 @@ static const bmc_gpio_def_t bmc_gpio_defaults[BMC_GPIO_COUNT] = {
// Power Control Timing
// ============================================================================
#define BMC_RESET_PULSE_MS 200
#define BMC_POWER_GOOD_DELAY_MS 2000
// ============================================================================
// Logging Tags

View File

@@ -11,6 +11,8 @@
#include <sys/param.h>
static const char *TAG = TAG_HTTP;
#define MAX_WS_COUNT_CLIENTS BMC_HTTP_MAX_CONN
#define MAX_WS_BROADCAST_CLIENTS BMC_HTTP_MAX_CONN
// Server handle
static httpd_handle_t server = NULL;
@@ -947,7 +949,6 @@ esp_err_t web_server_ws_broadcast(const uint8_t *data, size_t len) {
};
// Use a fixed-size array to avoid stack issues
#define MAX_WS_BROADCAST_CLIENTS 4
int client_fds[MAX_WS_BROADCAST_CLIENTS];
size_t clients = MAX_WS_BROADCAST_CLIENTS;
@@ -955,7 +956,7 @@ esp_err_t web_server_ws_broadcast(const uint8_t *data, size_t len) {
esp_err_t ret = httpd_get_client_list(server, &clients, client_fds);
if (ret != ESP_OK) {
// This can happen when there are no clients or server is busy - not a critical error
ESP_LOGD(TAG, "Could not get client list: %s (may be no clients connected)", esp_err_to_name(ret));
ESP_LOGI(TAG, "Could not get client list: %s (may be no clients connected)", esp_err_to_name(ret));
return ESP_OK; // Return OK since this is not a critical error
}
@@ -987,7 +988,6 @@ int web_server_ws_client_count(void) {
return 0;
}
#define MAX_WS_COUNT_CLIENTS 4
int client_fds[MAX_WS_COUNT_CLIENTS];
size_t clients = MAX_WS_COUNT_CLIENTS;
int count = 0;