chore: move header files to includes folder

This commit is contained in:
2025-08-22 16:06:05 +02:00
parent 17bdfeaaf0
commit f48ddcf9f7
8 changed files with 2 additions and 10 deletions

25
include/NodeInfo.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
#include "Globals.h"
#include <IPAddress.h>
#include <vector>
#include <tuple>
struct NodeInfo {
String hostname;
IPAddress ip;
unsigned long lastSeen;
enum Status { ACTIVE, INACTIVE, DEAD } status;
struct Resources {
uint32_t freeHeap = 0;
uint32_t chipId = 0;
String sdkVersion;
uint32_t cpuFreqMHz = 0;
uint32_t flashChipSize = 0;
} resources;
unsigned long latency = 0; // ms since lastSeen
std::vector<std::tuple<String, int>> apiEndpoints; // List of registered endpoints
};
const char* statusToStr(NodeInfo::Status status);
void updateNodeStatus(NodeInfo &node, unsigned long now, unsigned long inactive_threshold, unsigned long dead_threshold);
void updateNodeStatus(NodeInfo &node, unsigned long now = millis()); // Legacy overload for backward compatibility