Asked claude opus to make an audit of code and use coding guidelines etc. This is the fix

This commit is contained in:
2026-03-09 22:26:16 -04:00
parent 75d88f441c
commit b702839f8e
15 changed files with 459 additions and 1291 deletions

View File

@@ -2,7 +2,9 @@
#include "mdns.h"
#include "sdkconfig.h"
static const char *kLogMDNS = "MDNS";
#include "types.hpp"
internal const char *kTagMDNS = "MDNS";
void start_mdns()
{
@@ -10,14 +12,14 @@ void start_mdns()
esp_err_t err = mdns_init();
if (err != ESP_OK)
{
ESP_LOGE(kLogMDNS, "mDNS Init failed: %d", err);
ESP_LOGE(kTagMDNS, "mDNS Init failed: %d", err);
return;
}
// Set mDNS hostname (from Kconfig)
const char *hostname = CONFIG_CALENDINK_MDNS_HOSTNAME;
mdns_hostname_set(hostname);
ESP_LOGI(kLogMDNS, "mDNS Hostname set to: [%s.local]", hostname);
ESP_LOGI(kTagMDNS, "mDNS Hostname set to: [%s.local]", hostname);
// Set mDNS instance name
mdns_instance_name_set("Calendink Provider");
@@ -26,9 +28,8 @@ void start_mdns()
err = mdns_service_add(NULL, "_http", "_tcp", 80, NULL, 0);
if (err != ESP_OK)
{
ESP_LOGE(kLogMDNS, "mDNS Service add failed: %d", err);
ESP_LOGE(kTagMDNS, "mDNS Service add failed: %d", err);
}
printf("MDNS: Service initialized with hostname [%s.local]\n", hostname);
ESP_LOGI(kLogMDNS, "mDNS Service initialized");
ESP_LOGI(kTagMDNS, "mDNS Service initialized with hostname [%s.local]", hostname);
}