Flipper Zero Firmware
Loading...
Searching...
No Matches
dfu_file.h
1#pragma once
2
3#include "dfu_headers.h"
4
5#include <stdbool.h>
6#include <storage/storage.h>
7
8typedef enum {
9 UpdateBlockResult_Unknown,
10 UpdateBlockResult_OK,
11 UpdateBlockResult_Skipped,
12 UpdateBlockResult_Failed
13} DfuUpdateBlockResult;
14
15typedef bool (
16 *DfuPageTaskCb)(const uint8_t i_page, const uint8_t* update_block, uint16_t update_block_len);
17typedef void (*DfuPageTaskProgressCb)(const uint8_t progress, void* context);
18typedef bool (*DfuAddressValidationCb)(const size_t address);
19
20typedef struct {
21 DfuPageTaskCb task_cb;
22 DfuPageTaskProgressCb progress_cb;
23 DfuAddressValidationCb address_cb;
24 void* context;
26
27typedef struct {
28 uint16_t vendor;
29 uint16_t product;
30 uint16_t device;
32
33bool dfu_file_validate_crc(File* dfuf, const DfuPageTaskProgressCb progress_cb, void* context);
34
35/* Returns number of valid targets from file header
36 * If file is invalid, returns 0
37 */
38uint8_t dfu_file_validate_headers(File* dfuf, const DfuValidationParams* reference_params);
39
40bool dfu_file_process_targets(const DfuUpdateTask* task, File* dfuf, const uint8_t n_targets);
APIs for working with storages, directories and files.
Definition dfu_file.h:20
Definition dfu_file.h:27
Structure that hold file index and returned api errors.
Definition filesystem_api_internal.h:17