ota_file_patch.h 724 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2019 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief OTA file patch interface
  9. */
  10. #ifndef __OTA_FILE_PATCH_H__
  11. #define __OTA_FILE_PATCH_H__
  12. struct ota_file_patch_info {
  13. struct ota_storage *storage;
  14. struct ota_image *img;
  15. uint32_t flag_use_crc:1;
  16. uint32_t flag_use_encrypt:1;
  17. int write_cache_size;
  18. int write_cache_pos;
  19. uint32_t write_cache_offs;
  20. uint8_t *write_cache;
  21. uint8_t *old_file_mapping_addr;
  22. int old_file_offset;
  23. int old_file_size;
  24. int new_file_offset;
  25. int new_file_size;
  26. int patch_file_offset;
  27. int patch_file_size;
  28. };
  29. int ota_file_patch_write(struct ota_file_patch_info *ota_patch);
  30. #endif /* __OTA_FILE_PATCH_H__ */