HB, OTA etc
This commit is contained in:
18
esp32/main/fw_command.cpp
Normal file
18
esp32/main/fw_command.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user