| l.yang | 7b93b55 | 2025-05-28 05:00:14 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @file : gsw_ota_ua_interface.h |
| 3 | * @brief : sdk interface |
| 4 | * @date : 2023-05-05 |
| 5 | * @author : |
| 6 | * @version : v1.0 |
| 7 | * @copyright Copyright(C) 2022,Gosuncnwelink |
| 8 | */ |
| 9 | #ifndef __GSW_OTA_UA_INTERFACE_H_ |
| 10 | #define __GSW_OTA_UA_INTERFACE_H_ |
| 11 | |
| 12 | #define UPDATE_MODEM_PACKAGE "/media/vbf/fota.delta" |
| 13 | #define UPDATE_MCU_PACKAGE "/media/vbf/mcu_BOOT.hex" |
| 14 | #define UPDATE_BLE_PACKAGE "/media/vbf/ble.bin" |
| 15 | |
| 16 | #include <stdint.h> |
| 17 | #include <stdbool.h> |
| 18 | #include "gsw_hal_errcode.h" |
| 19 | |
| 20 | |
| 21 | enum _GSW_OTA_UPDATE_TYPE_T |
| 22 | { |
| 23 | GSW_OTA_UPDATE_TYPE_UPDATE_ALL, /**< ota update type is mdm and mcu */ |
| 24 | GSW_OTA_UPDATE_TYPE_UPDATE_MODEM, /**< ota update type is mdm */ |
| 25 | GSW_OTA_UPDATE_TYPE_UPDATE_MCU, /**< ota update type is mcu */ |
| 26 | GSW_OTA_UPDATE_TYPE_UPDATE_REBOOT, /**< ota update cmd reboot mdm*/ |
| 27 | GSW_OTA_UPDATE_TYPE_UPDATE_STATUS, /**< ota update cmd is result_query */ |
| 28 | }; |
| 29 | |
| 30 | typedef enum _gsw_ota_ret |
| 31 | { |
| 32 | GSW_OTA_SUCCESS = 0, /**< ota install success */ |
| 33 | GSW_OTA_FAILURE, /**< ota install failure */ |
| 34 | GSW_OTA_TIMEOUT, /**< ota install timeout */ |
| 35 | GSW_OTA_INPROCESS, /**< ota install in process */ |
| 36 | GSW_OTA_NO_TASK, /**< ota install no task */ |
| 37 | } E_GSW_OTA_RET; |
| 38 | |
| 39 | typedef enum |
| 40 | { |
| 41 | GSW_SYSTEM_A, |
| 42 | GSW_SYSTEM_B, |
| 43 | GSW_SYSTEM_UNKNOW |
| 44 | } gsw_system_type; |
| 45 | |
| 46 | /** |
| 47 | * @brief update_install_modem |
| 48 | * @param [in] update modem type(reboot or noreboot) |
| 49 | * @retval 0: success |
| 50 | * @retval other: failed |
| 51 | */ |
| 52 | int32_t gsw_update_modem_process(void *bufdata); |
| 53 | |
| 54 | |
| 55 | |
| 56 | /** |
| 57 | * @brief reboot_modem |
| 58 | * @param [in] |
| 59 | * @retval 0: success |
| 60 | * @retval other: failed |
| 61 | */ |
| 62 | int32_t gsw_update_reboot_modem(void *bufdata); |
| 63 | |
| 64 | |
| 65 | |
| 66 | /** |
| 67 | * @brief update_modem_result_query |
| 68 | * @param [in] void |
| 69 | * @retval 0: No install task |
| 70 | * @retval 1: Ignore on AB system |
| 71 | * @retval 16: is flashing |
| 72 | * @retval 17: success |
| 73 | * @retval -1: Api error |
| 74 | */ |
| 75 | int32_t gsw_update_modem_result_query(void); |
| 76 | |
| 77 | |
| 78 | |
| 79 | /** |
| 80 | * @brief update_modem_check_condition |
| 81 | * @param [in] void |
| 82 | * @retval TRUE: can update modem |
| 83 | * @retval FALSE: cannot update modem |
| 84 | */ |
| 85 | bool gsw_update_modem_check_condition(void); |
| 86 | |
| 87 | |
| 88 | |
| 89 | /** |
| 90 | * @brief not used at the moment |
| 91 | * @param [in] |
| 92 | * @param [in] |
| 93 | * @retval 0: success |
| 94 | * @retval other: failed |
| 95 | */ |
| 96 | int32_t gsw_ota_upgrade(int src_id, int upgredetype, char *parameter); |
| 97 | |
| 98 | /** |
| 99 | * @brief gsw_get_ab_system |
| 100 | * @param [out] type system A or B |
| 101 | * @retval 0: success |
| 102 | * @retval other: failed |
| 103 | */ |
| 104 | int32_t gsw_get_ab_system(gsw_system_type *type); |
| 105 | #endif |