bolar_2 backup
This commit is contained in:
30
main/ota/ota_response_parser.h
Normal file
30
main/ota/ota_response_parser.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "ota/ota_endpoint.h"
|
||||
#include "ota/ota_types.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace borla {
|
||||
|
||||
class OtaResponseParser final {
|
||||
public:
|
||||
// `endpoint` is optional and independent of the firmware block: a
|
||||
// response may repoint the device without shipping an image. It is kept
|
||||
// out of OtaManifest on purpose — the manifest is copied under a
|
||||
// critical section, and the endpoint is consumed immediately.
|
||||
OtaParseStatus Parse(
|
||||
const char* json,
|
||||
size_t size,
|
||||
const char* current_version,
|
||||
bool allow_insecure_http,
|
||||
OtaManifest* manifest,
|
||||
OtaEndpointConfig* endpoint = nullptr) const;
|
||||
|
||||
static int CompareVersions(const char* left, const char* right);
|
||||
static bool DecodeSha256(
|
||||
const char* hex,
|
||||
uint8_t output[32]);
|
||||
};
|
||||
|
||||
} // namespace borla
|
||||
Reference in New Issue
Block a user