BSB Developer Docs
Loading...
Searching...
No Matches
sl_updater.h
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5#include <furi.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11typedef struct SlUpdater SlUpdater;
12
16typedef enum {
17 SlUpdaterProgressPhaseUploading,
18 SlUpdaterProgressPhaseAwaitingInstall,
20 SlUpdaterProgressPhaseNone,
21} SlUpdaterProgressPhase;
22
26typedef enum {
27 SlUpdaterStatusOk,
28 SlUpdaterStatusFileNotFound,
29 SlUpdaterStatusFailure,
30} SlUpdaterStatus;
31
38typedef void (
39 *SlUpdaterProgressCallback)(SlUpdaterProgressPhase phase, uint8_t percentage, void* context);
40
45SlUpdater* sl_updater_alloc(void);
46
57SlUpdaterStatus sl_updater_run(
58 SlUpdater* instance,
59 const char* firmware_path,
60 bool is_stack_image,
61 uint8_t install_timeout_seconds,
62 uint8_t baud_throttle);
63
70void sl_updater_set_progress_callback(
71 SlUpdater* instance,
72 SlUpdaterProgressCallback callback,
73 void* context);
74
82SlUpdaterStatus sl_update_probe(SlUpdater* instance, uint8_t baud_throttle, FuriString* version);
83
88void sl_updater_free(SlUpdater* instance);
89
90#ifdef __cplusplus
91}
92#endif
Definition sl_updater.c:44