quec_boot_fota.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /** @file
  2. ql_boot_fota.h
  3. @brief
  4. This file is used to define boot spi flash api for different Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. /*=================================================================
  11. EDIT HISTORY FOR MODULE
  12. This section contains comments describing changes made to the module.
  13. Notice that changes are listed in reverse chronological order.
  14. WHEN WHO WHAT, WHERE, WHY
  15. ------------ ------- -------------------------------------------------------------------------------
  16. 17/12/2020 Fei Init version
  17. =================================================================*/
  18. #ifndef QL_BOOT_FOTA_H
  19. #define QL_BOOT_FOTA_H
  20. #include "quec_boot_pff.h"
  21. #include <stdint.h>
  22. #include "ql_api_common.h"
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #define QL_FILE_MAX_PATH_LEN (172)
  27. #define QL_FOTA_ERRCODE_BASE (QL_COMPONENT_FOTA<<16)
  28. typedef enum
  29. {
  30. QUEC_BOOT_FOTA_SUCCESS = 0,
  31. QUEC_BOOT_FOTA_MEM_ERR = 1|QL_FOTA_ERRCODE_BASE, //动态申请内存错误
  32. QUEC_BOOT_FOTA_PACK_NAME_ERR = 2|QL_FOTA_ERRCODE_BASE, //fota更新包名字错误,使用默认fota包文件
  33. QUEC_BOOT_FOTA_PACK_SIZE_ERR = 3|QL_FOTA_ERRCODE_BASE, //fota更新包大小错误
  34. QUEC_BOOT_FOTA_PACK_READ_ERR = 4|QL_FOTA_ERRCODE_BASE, //读fota更新包操作错误
  35. QUEC_BOOT_FOTA_PACK_CRC_ERR = 5|QL_FOTA_ERRCODE_BASE, //fota更新包CRC校验错误
  36. }quec_boot_errcode_fota_e;
  37. /*****************************************************************
  38. * Function: quec_boot_fota_init
  39. *
  40. * Description:
  41. * FOTA initialization operations
  42. *
  43. * Parameters:
  44. * NULL
  45. *
  46. * Return:
  47. * NULL
  48. *
  49. *****************************************************************/
  50. void quec_boot_fota_init();
  51. /*****************************************************************
  52. * Function: quec_boot_fota_pack_verify
  53. *
  54. * Description:
  55. * FOTA PACK verify operations
  56. *
  57. * Parameters:
  58. * NULL
  59. *
  60. * Return:
  61. * NULL
  62. *
  63. *****************************************************************/
  64. quec_boot_errcode_fota_e quec_boot_fota_pack_verify(void);
  65. quec_boot_fs_type_e quec_check_path_type(const char *path,int *offset);
  66. #ifdef __cplusplus
  67. } /*"C" */
  68. #endif
  69. #endif /* QL_BOOT_FOTA_H */