blob: 8cd41d35a8483b681190ce62166225268f701ce3 [file] [log] [blame]
/**
* @file : gsw_ota_ua_interface.h
* @brief : sdk interface
* @date : 2023-05-05
* @author :
* @version : v1.0
* @copyright Copyright(C) 2022,Gosuncnwelink
*/
#ifndef __GSW_OTA_UA_INTERFACE_H_
#define __GSW_OTA_UA_INTERFACE_H_
#define UPDATE_MODEM_PACKAGE "/media/vbf/fota.delta"
#define UPDATE_MCU_PACKAGE "/media/vbf/mcu_BOOT.hex"
#define UPDATE_BLE_PACKAGE "/media/vbf/ble.bin"
#include <stdint.h>
#include <stdbool.h>
#include "gsw_hal_errcode.h"
enum _GSW_OTA_UPDATE_TYPE_T
{
GSW_OTA_UPDATE_TYPE_UPDATE_ALL, /**< ota update type is mdm and mcu */
GSW_OTA_UPDATE_TYPE_UPDATE_MODEM, /**< ota update type is mdm */
GSW_OTA_UPDATE_TYPE_UPDATE_MCU, /**< ota update type is mcu */
GSW_OTA_UPDATE_TYPE_UPDATE_REBOOT, /**< ota update cmd reboot mdm*/
GSW_OTA_UPDATE_TYPE_UPDATE_STATUS, /**< ota update cmd is result_query */
};
typedef enum _gsw_ota_ret
{
GSW_OTA_SUCCESS = 0, /**< ota install success */
GSW_OTA_FAILURE, /**< ota install failure */
GSW_OTA_TIMEOUT, /**< ota install timeout */
GSW_OTA_INPROCESS, /**< ota install in process */
GSW_OTA_NO_TASK, /**< ota install no task */
} E_GSW_OTA_RET;
typedef enum
{
GSW_SYSTEM_A,
GSW_SYSTEM_B,
GSW_SYSTEM_UNKNOW
} gsw_system_type;
/**
* @brief update_install_modem
* @param [in] update modem type(reboot or noreboot)
* @retval 0: success
* @retval other: failed
*/
int32_t gsw_update_modem_process(void *bufdata);
/**
* @brief reboot_modem
* @param [in]
* @retval 0: success
* @retval other: failed
*/
int32_t gsw_update_reboot_modem(void *bufdata);
/**
* @brief update_modem_result_query
* @param [in] void
* @retval 0: No install task
* @retval 1: Ignore on AB system
* @retval 16: is flashing
* @retval 17: success
* @retval -1: Api error
*/
int32_t gsw_update_modem_result_query(void);
/**
* @brief update_modem_check_condition
* @param [in] void
* @retval TRUE: can update modem
* @retval FALSE: cannot update modem
*/
bool gsw_update_modem_check_condition(void);
/**
* @brief not used at the moment
* @param [in]
* @param [in]
* @retval 0: success
* @retval other: failed
*/
int32_t gsw_ota_upgrade(int src_id, int upgredetype, char *parameter);
/**
* @brief gsw_get_ab_system
* @param [out] type system A or B
* @retval 0: success
* @retval other: failed
*/
int32_t gsw_get_ab_system(gsw_system_type *type);
#endif