update_manifest.h 993 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include <stdint.h>
  6. #include <stdbool.h>
  7. #include <m-string.h>
  8. /* Paths don't include /ext -- because at startup SD card is mounted as root */
  9. #define UPDATE_DIR_DEFAULT_REL_PATH "/update"
  10. #define UPDATE_MANIFEST_DEFAULT_NAME "update.fuf"
  11. #define UPDATE_MAINFEST_DEFAULT_PATH UPDATE_DIR_DEFAULT_REL_PATH "/" UPDATE_MANIFEST_DEFAULT_NAME
  12. typedef struct {
  13. string_t version;
  14. uint32_t target;
  15. string_t staged_loader_file;
  16. uint32_t staged_loader_crc;
  17. string_t firmware_dfu_image;
  18. string_t radio_image;
  19. uint32_t radio_address;
  20. bool valid;
  21. } UpdateManifest;
  22. UpdateManifest* update_manifest_alloc();
  23. void update_manifest_free(UpdateManifest* update_manifest);
  24. bool update_manifest_init(UpdateManifest* update_manifest, const char* manifest_filename);
  25. bool update_manifest_init_mem(
  26. UpdateManifest* update_manifest,
  27. const uint8_t* manifest_data,
  28. const uint16_t length);
  29. #ifdef __cplusplus
  30. }
  31. #endif