Files
HiSTBLinuxV100R005C00SPC060/source/component/loader/app/protocol.h
T
2024-08-12 23:03:27 +08:00

127 lines
4.1 KiB
C

/******************************************************************************
Copyright (C), 2001-2015, HiSilicon Technologies Co., Ltd.
******************************************************************************
File Name : protocol.h
Version : Initial draft
Author : Device Chipset STB Development Dept
Created Date : 2015-07-29
Last Modified by: sdk
Description :
Function List :
Change History :
Version Date Author DefectNum Description
main\1 2015-07-29 sdk N/A Create this file.
******************************************************************************/
#ifndef __PROTOCOL_H__
#define __PROTOCOL_H__
/******************************************************************************/
/* Header file references */
/* Quote order */
/* 1. Global header file */
/* 2. Public header files of other modules */
/* 3. Header files within this module */
/* 4. Private files within this module (.inc) */
/******************************************************************************/
#include "protocol_common.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
/*************************** Macro Definition *********************************/
/** \addtogroup PROTOCOL */
/** @{ */ /** <!-- [PROTOCOL] */
/** @} */ /*! <!-- Macro Definition End */
/*************************** Structure Definition *****************************/
/** \addtogroup PROTOCOL */
/** @{ */ /** <!-- [PROTOCOL] */
/****** Enumeration definition ************/
/****** Structure definition **************/
/****** Union definition ******************/
/****** Global variable declaration *******/
/** @} */ /** <!-- ==== Structure Definition End ====*/
/******************************* API Declaration ******************************/
/** \addtogroup PROTOCOL */
/** @{ */ /** <!-- [PROTOCOL] */
/**
\brief initialize protocol.
\attention \n
\param[in] pstLoaderParam: Upgrade parameter
\param[in] pfnDataCallback: Upgrade data callback func
\param[in] pfnProgressCallback: Progress callback func
\retval ::HI_SUCCESS : initialize success
\retval ::Error Code : initialize failed
*/
HI_S32 LOADER_PROTOCOL_Init
(
HI_LOADER_PARAM_S* pstLoaderParam,
PROT_DATA_CALLBACK pfnDataCallback,
PROT_PROCESS_CALLBACK pfnProgressCallback
);
/**
\brief deinitialize protocol.
\attention \n
\retval ::HI_SUCCESS : deinitialize success
\retval ::Error Code : deinitialize failed
*/
HI_S32 LOADER_PROTOCOL_DeInit(HI_VOID);
/**
\brief get the version infomation of the upgrade image.
\attention \n
\param[out] pstVersionInfo: the version information of the image
\retval ::HI_SUCCESS : success
\retval ::Error Code : failed
*/
HI_S32 LOADER_PROTOCOL_GetVersionInfo(PROT_VERSION_INFO_S* pstVersionInfo);
/**
\brief get the partition infomation of the upgrade image.
\attention \n
\param[in] pstBuffer: The buffer for storing partition information.
\param[in] u32BufNum: The size of the buffer for storing partition information.
\param[out] pu32PartNum: The Actual number of partitions
\retval ::HI_SUCCESS : success
\retval ::Error Code : failed
*/
HI_S32 LOADER_PROTOCOL_GetPartitionInfo
(
PROT_PARTITION_INFO_S* pstBuffer,
HI_U32 u32BufNum,
HI_U32* pu32PartNum
);
/**
\brief receive upgrade data, and call datacallback to notice caller the data.
\attention \n
\retval ::HI_SUCCESS : success
\retval ::Error Code : failed
*/
HI_S32 LOADER_PROTOCOL_Process(HI_VOID);
/** @} */ /** <!-- ==== API Declaration End ==== */
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /*__PROTOCOL_H__*/