move hardbeat handling into backend, add publish lanestate for lighttower

This commit is contained in:
Carsten Graf
2025-07-31 01:15:44 +02:00
parent 4a1e0b8bca
commit 0166e1a695
7 changed files with 123 additions and 20 deletions

View File

@@ -7,4 +7,11 @@ std::array<uint8_t, 6> macStringToBytes(const char *macStr) {
sscanf(macStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &bytes[0], &bytes[1],
&bytes[2], &bytes[3], &bytes[4], &bytes[5]);
return bytes;
}
std::string macToString(const std::array<uint8_t, 6> &macBytes) {
char macStr[18];
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", macBytes[0],
macBytes[1], macBytes[2], macBytes[3], macBytes[4], macBytes[5]);
return std::string(macStr);
}