ql_cloud_ota.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*============================================================================
  2. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  3. Quectel Wireless Solution Proprietary and Confidential.
  4. =============================================================================*/
  5. /*===========================================================================
  6. EDIT HISTORY FOR MODULE
  7. This section contains comments describing changes made to the module.
  8. Notice that changes are listed in reverse chronological order.
  9. WHEN WHO WHAT, WHERE, WHY
  10. ---------- ------------ ----------------------------------------------------
  11. =============================================================================*/
  12. #ifndef QL_CLOUD_OTA_H
  13. #define QL_CLOUD_OTA_H
  14. typedef enum
  15. {
  16. QL_HTTPFOTA_PUB_GET_VERSION_FAIL = 9,
  17. QL_HTTPFOTA_PUB_DOWN_FIRMWARE_SUCCESS = 8,//Firmware update success
  18. QL_HTTPFOTA_PUB_DOWN_FIRMWARE_UPGRADE = 7,//start upgradeing
  19. QL_HTTPFOTA_PUB_DOWN_FIRMWARE_DONE = 6,//Download firmware complete
  20. QL_HTTPFOTA_PUB_DOWN_FIRMWARE_DOWNSTATUS= 5,//Firmware downloading status
  21. QL_HTTPFOTA_PUB_DOWN_FIRMWARE_DOWNING = 4,//Firmware downloading
  22. QL_HTTPFOTA_PUB_GRT_URL = 3, //get download URL OK
  23. QL_HTTPFOTA_PUB_GRT_TOKEN = 2, //get token OK
  24. QL_HTTPFOTA_PUB_INPROGRESS = 1,
  25. QL_HTTPFOTA_PUB_SUCCEED = 0,
  26. QL_HTTPFOTA_PUB_FAIL = -1,
  27. }qlHttpFotaStart;
  28. typedef enum
  29. {
  30. QL_HTTPFOTA_START_ERROR = 0,
  31. QL_HTTPFOTA_REQUEST_TOKEN = 1,
  32. QL_HTTPFOTA_RECV_TOKEN = 2,
  33. QL_HTTPFOTA_REQUEST_FOTA = 3,
  34. QL_HTTPFOTA_RECV_FOTA = 4,
  35. QL_HTTPFOTA_URL_SUCCESS,
  36. QL_HTTPFOTA_DOWNLOADING,
  37. QL_HTTPFOTA_RECV_DOWNLOADING,//downloading firmware
  38. QL_HTTPFOTA_DOWNLOADED, // downloaded,notify update
  39. QL_HTTPFOTA_UPDATE_START , //update start
  40. QL_HTTPFOTA_UPDATE_SUCCESS, //update success
  41. QL_HTTPFOTA_STATUS_MAX,
  42. }qlHttpFota;
  43. typedef enum
  44. {
  45. QL_REC_FIRMWARE_VERSION_HTTP = 1,
  46. QL_CHECK_FIRMWARE_VERSION_HTTP = 2,
  47. }qlFirmwareVer_Http;
  48. typedef void (*start_progress_cb_t)(qlHttpFotaStart sta, int progress);
  49. bool ql_check_cloudota_info(int profile_idx, char *version, int verLen, start_progress_cb_t cb);
  50. int ql_cloudota_download(int profile_idx, start_progress_cb_t cb);
  51. void ql_cloudota_init(void);
  52. #endif /*QL_CLOUD_OTA_H*/