update_task_i.h 768 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <storage/storage.h>
  3. #include <furi_hal.h>
  4. #define UPDATE_TASK_NOERR 0
  5. #define UPDATE_TASK_FAILED -1
  6. typedef struct UpdateTask {
  7. UpdateTaskState state;
  8. FuriString* update_path;
  9. UpdateManifest* manifest;
  10. FuriThread* thread;
  11. Storage* storage;
  12. File* file;
  13. updateProgressCb status_change_cb;
  14. void* status_change_cb_state;
  15. FuriHalRtcBootMode boot_mode;
  16. } UpdateTask;
  17. void update_task_set_progress(UpdateTask* update_task, UpdateTaskStage stage, uint8_t progress);
  18. bool update_task_parse_manifest(UpdateTask* update_task);
  19. bool update_task_open_file(UpdateTask* update_task, FuriString* filename);
  20. int32_t update_task_worker_flash_writer(void* context);
  21. int32_t update_task_worker_backup_restore(void* context);