style: resolve cpplint warnings in firmware sources

Place C headers before C++ headers in sensor, metrics, utility and
application sources.

Document the owned cache of the applied MQTT prefix and suppress
runtime/string only for this variable. Preserve MQTT reconfiguration
and prefix buffer cleanup.

Validated with cpplint 2.0.2 over include, lib and src using CI filters.
This commit is contained in:
Yurii committed 2026-11-23 17:17:45 +03:00
1 parent 558d52fa9b
commit dc72966aca
7 files changed
+24 -17

No files matched your search

+5 -4
View File
@@ -1,17 +1,18 @@
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include <esp_log.h>
#include <errno.h> #include <errno.h>
#include <esp_log.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath> #include <cmath>
#include <functional> #include <functional>
#include <math.h>
#include <mutex> #include <mutex>
#include <optional> #include <optional>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <stdlib.h>
#include <string.h>
#include "macros.h" #include "macros.h"
#include "utils.h" #include "utils.h"
+2 -1
View File
@@ -4,9 +4,10 @@
#include <esp_arduino_version.h> #include <esp_arduino_version.h>
#include <esp_heap_caps.h> #include <esp_heap_caps.h>
#include <esp_timer.h> #include <esp_timer.h>
#include <mutex>
#include <stdint.h> #include <stdint.h>
#include <mutex>
struct HeapMetrics : multi_heap_info_t { struct HeapMetrics : multi_heap_info_t {
size_t total; size_t total;
size_t minLargestBlock = SIZE_MAX; size_t minLargestBlock = SIZE_MAX;
+3 -2
View File
@@ -1,12 +1,13 @@
#pragma once #pragma once
#include <Arduino.h> #include <Arduino.h>
#include <cmath>
#include <stdio.h> #include <stdio.h>
#include <string>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <cmath>
#include <string>
#include "types.h" #include "types.h"
inline std::string getChipId(const char* prefix = nullptr, const char* suffix = nullptr) { inline std::string getChipId(const char* prefix = nullptr, const char* suffix = nullptr) {
+5 -5
View File
@@ -1,17 +1,17 @@
#include <app.h> #include <app.h>
#include <MycilaWebSerial.h> #include <MycilaWebSerial.h>
#include <esp_log_color.h>
#include <esp_private/log_format.h>
#include <esp_private/log_timestamp.h>
#include <esp_rom_sys.h>
#include <freertos/ringbuf.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <esp_log_color.h>
#include <esp_private/log_format.h>
#include <esp_private/log_timestamp.h>
#include <esp_rom_sys.h>
#include <freertos/ringbuf.h>
static_assert(CONFIG_LOG_VERSION == 2, "OTGateway requires an SDK built with Log v2"); static_assert(CONFIG_LOG_VERSION == 2, "OTGateway requires an SDK built with Log v2");
static_assert(CONFIG_LOG_DYNAMIC_LEVEL_CONTROL, "Runtime log levels require dynamic level control"); static_assert(CONFIG_LOG_DYNAMIC_LEVEL_CONTROL, "Runtime log levels require dynamic level control");
+2 -1
View File
@@ -2,9 +2,10 @@
#include <app.h> #include <app.h>
#include <metrics.h> #include <metrics.h>
#include <cstdlib>
#include <esp_system.h> #include <esp_system.h>
#include <cstdlib>
#if ARDUINO_USB_CDC_ON_BOOT && !ARDUINO_USB_MODE #if ARDUINO_USB_CDC_ON_BOOT && !ARDUINO_USB_MODE
#include <USB.h> #include <USB.h>
#endif #endif
+3 -1
View File
@@ -21,7 +21,9 @@
std::mutex mqttMutex; std::mutex mqttMutex;
static MQTT* mqttClient = nullptr; static MQTT* mqttClient = nullptr;
static std::string mqttPrefix;
// Keep the applied prefix separate from settings until MQTT is reconfigured.
static std::string mqttPrefix; // NOLINT(runtime/string)
static std::atomic<unsigned long> mqttConnectedAt{0}; static std::atomic<unsigned long> mqttConnectedAt{0};
static unsigned long mqttPublishedSensorAt[SENSORS_AMOUNT] = {}; static unsigned long mqttPublishedSensorAt[SENSORS_AMOUNT] = {};
+4 -3
View File
@@ -1,15 +1,16 @@
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE #define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include <app.h> #include <app.h>
#include <atomic>
#include <optional>
#include <unordered_map>
#include <OneWire.h> #include <OneWire.h>
#include <DallasTemperature.h> #include <DallasTemperature.h>
#include <esp32DHT.h> #include <esp32DHT.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <atomic>
#include <optional>
#include <unordered_map>
#if USE_BLE #if USE_BLE
#include <NimBLEDevice.h> #include <NimBLEDevice.h>
#endif #endif