bugfix/static-code-analysis (#28)

The claude.ai LLM performed a static code analysis.

Reviewed-on: #28
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
This commit is contained in:
2026-02-14 16:21:32 +01:00
committed by Hendrik Schutter
parent 0c3779bf72
commit 260b26023c
7 changed files with 212 additions and 96 deletions

View File

@ -301,23 +301,23 @@ void taskMetrics(void *pvParameters)
// Wifi RSSI
wifi_ap_record_t ap;
esp_wifi_sta_get_ap_info(&ap);
ap.rssi = 0U;
ESP_ERROR_CHECK(esp_wifi_sta_get_ap_info(&ap));
strcpy(aMetrics[u16MetricCounter].caMetricName, "wifi_rssi");
aMetrics[u16MetricCounter].type = INTEGER_64;
aMetrics[u16MetricCounter].i64MetricValue = ap.rssi;
u16MetricCounter++;
ESP_ERROR_CHECK(u16MetricCounter > METRIC_MAX_COUNT);
configASSERT(!(u16MetricCounter > METRIC_MAX_COUNT));
vSetMetrics(aMetrics, u16MetricCounter);
}
}
void vSetMetrics(sMetric *paMetrics, uint16_t u16Size)
{
if (xSemaphoreTakeRecursive(xMutexAccessMetricResponse, pdMS_TO_TICKS(5000)) == pdTRUE)
{
memset(caHtmlResponse, 0U, strlen(caHtmlResponse));
memset(caHtmlResponse, 0U, HTML_RESPONSE_SIZE);
for (uint16_t u16Index = 0U; u16Index < u16Size; u16Index++)
{
char caValueBuffer[64];