flipperzero-firmware/lib/update_util/update_manifest.h
Sergey Gavrilov 4bf29827f8
M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-06 00:15:23 +09:00

64 lines
1.6 KiB
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include <furi.h>
#include <furi_hal_flash.h>
/* Paths don't include /ext -- because at startup SD card is mounted as FS root */
#define UPDATE_MANIFEST_DEFAULT_NAME "update.fuf"
#define UPDATE_MANIFEST_POINTER_FILE_NAME ".fupdate"
typedef union {
uint8_t raw[6];
struct {
uint8_t major;
uint8_t minor;
uint8_t sub;
uint8_t branch;
uint8_t release;
uint8_t type;
} version;
} UpdateManifestRadioVersion;
_Static_assert(sizeof(UpdateManifestRadioVersion) == 6, "UpdateManifestRadioVersion size error");
typedef struct {
uint32_t manifest_version;
FuriString* version;
uint32_t target;
FuriString* staged_loader_file;
uint32_t staged_loader_crc;
FuriString* firmware_dfu_image;
FuriString* radio_image;
uint32_t radio_address;
UpdateManifestRadioVersion radio_version;
uint32_t radio_crc;
FuriString* resource_bundle;
FuriHalFlashRawOptionByteData ob_reference;
FuriHalFlashRawOptionByteData ob_compare_mask;
FuriHalFlashRawOptionByteData ob_write_mask;
FuriString* splash_file;
bool valid;
} UpdateManifest;
UpdateManifest* update_manifest_alloc();
void update_manifest_free(UpdateManifest* update_manifest);
bool update_manifest_init(UpdateManifest* update_manifest, const char* manifest_filename);
bool update_manifest_init_mem(
UpdateManifest* update_manifest,
const uint8_t* manifest_data,
const uint16_t length);
bool update_manifest_has_obdata(UpdateManifest* update_manifest);
#ifdef __cplusplus
}
#endif