HB, OTA etc

This commit is contained in:
2026-04-22 20:11:55 +03:00
parent 4100931deb
commit cb1014c950
76 changed files with 3157 additions and 232 deletions

18
esp32/main/fw_command.cpp Normal file
View File

@@ -0,0 +1,18 @@
//
// Created by eugene on 22.04.2026.
//
#include "fw_command.h"
#include "json_utils.h"
#include <cstring>
bool parse_fw_command(const char *msg, fw_cmd_t *out) {
if (!strstr(msg, "\"t\":\"c\"")) return false;
if (!strstr(msg, "\"t\":\"fw\"")) return false;
if (!json_get_string(msg, "\"u\"", out->url, sizeof(out->url))) return false;
if (!json_get_string(msg, "\"s\"", out->sha256, sizeof(out->sha256))) return false;
out->is_fw = true;
return true;
}