kb_ota.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:4k
- #ifndef KB_OTA_H
- #define KB_OTA_H
- #include "Kb_porting.h"
- //----------------------------------------------------------------------------
- // Inner definition, for kb_ota.c
- //----------------------------------------------------------------------------
- //dynamic memory size needed for this module, about 80K
- #define DYNAMIC_MEMORY_SIZE (80*1024)
- //unset parameter
- #define UNSET_PARAM 0xffff
- //loader nvm address define
- #define _M_NVRAM_BASE_ADDRESS (0)
- #define _M_NVRAM_LOADER_ADDR (_M_NVRAM_BASE_ADDRESS+512)
- //unused parameters
- #define DUMMY_PARAMETER 0xffffffff
- //#define OTA_TEST
- //#define OTA_TEST1
- #define OTA_SWITCH_OPEN
- //-----------------------------------------------------------------------------
- // external Data Struct Prototypes:
- //-----------------------------------------------------------------------------
- //
- //CAT, PMT, SDT, TDT State
- enum
- {
- E_RESET_STATE = 0,
- E_STOPPED_NODATA_STATE,
- E_STOPPED_WITH_DATA_STATE,
- E_IN_STARTING_STATE
- };
- //Irdeto BAT Struct //For Bug101
- typedef struct
- {
- UInt16 transport_stream_id;
- UInt16 original_network_id;
- UInt16 service_id;
- UInt8 linkage_type;
- UInt16 manufacturer_code;
- UInt8 control_byte_1;
- UInt16 major_hw_version;
- UInt16 minor_hw_version;
- UInt16 hw_batch_no;
- UInt16 major_sw_version;
- UInt16 minor_sw_version;
- UInt8 stb_type;
- UInt16 region_code_start;
- UInt16 region_code_end;
- UInt8 upgrage_type;
- UInt32 stb_sequence_start;
- UInt32 stb_sequence_end;
- UInt8 time;
- UInt8 control_byte_2;
- }TF_Linkage_Descriptor;
- //Irdeto BAT Struct //For Bug101
- typedef struct
- {
- UInt16 manufacturer_code;
- UInt8 major_hw_version;
- UInt8 minor_hw_version;
- UInt16 hw_batch_no;
- UInt8 major_sw_version;
- UInt8 minor_sw_version;
- }TF_STREAM_PARA;
- //loader 参数
- typedef struct _TFOtaDate
- {
- UInt16 year;
- UInt8 month;
- UInt8 day;
- }TFOtaDate;
- typedef struct _TFOtaTime
- {
- UInt8 hour;
- UInt8 minute;
- UInt8 second;
- }TFOtaTime;
- typedef struct _TFLoaderPara
- {
- UInt32 IMAGE_SIZE; /*字节数*/
- UInt8 KB_MANUFACTURER_ID; /*根据厂家分配*/
- UInt32 STB_SERIAL_NO; /*机顶盒序列号*/
- UInt8 KB_HARDWARE_VERSION_NUMBER;
- UInt16 KB_HARDWARE_MAJOR_VERSION_NUMBER;
- UInt16 KB_HARDWARE_MINOR_VERSION_NUMBER;
- UInt16 KB_HARDWARE_BATCH_NO;
- UInt16 LOAD_SEQUENCE_NUMBER; /* loader序列号*/
- UInt16 KB_SOFTWARE_MAJOR_VERSION_NUMBER; /*软件版本号*/
- UInt16 KB_SOFTWARE_MINOR_VERSION_NUMBER;
- UInt16 kB_REGION_CODE; /* 区域号 */
- UInt8 kB_KeY_TYPE;
- TFOtaDate SIGN_DATE;
- TFOtaTime SIGN_TIME;
- TFOtaDate DLOAD_DATE;
- TFOtaTime DLOAD_TIME;
- UInt16 DLOAD_DUR;
-
- }TFLoaderPara;
- #define MAX_IRDETO_LINKAGES 100
- //CA Client Service Types
- enum
- {
- //From Application
- E_NEW_TS_ASSOCIATED,
- E_CURRENT_TS_DEASSOCIATED,
- E_NEW_SERVICE_REQUEST,
- E_STOP_CURRENT_SERVICE,
- E_RESET_STORED_INFORMATION,
- E_FILTER_SETPU,
- E_NIT_FILTER_SETUP,
- E_PAT_FILTER_SETUP,
-
- //For Download service
- E_DOWNLOAD_CHECKING,
- E_DOWNLOAD_SEARCHING,
- E_PAT_REACH,
- E_DOWNLOAD_CONTROL_SECTION,
- //From HDMX
- E_CAT_REACH,
- E_SDT_REACH,
- E_PMT_REACH,
- E_TDT_REACH,
- E_BAT_REACH,
- E_NIT_REACH,
- E_DII_REACH,
- E_DSI_REACH,
- E_FE_LOCKED,
- E_REGISTER_ERROR_REQ,
- E_CRC_ERROR
- };
- enum
- {
- IRD_DL_NIT_FAIL,
- IRD_DL_SVC_FAIL,
- IRD_DL_CONN_FAIL,
- IRD_DL_NOT_PRESENT,
- IRD_DL_PARA1_NOT_EQUAL,
- IRD_DL_PARA2_NOT_EQUAL,
- IRD_DL_PRESENT
- };
- typedef enum {
- SPY_STATUS_IN_STARTING = 0,
- SPY_STATUS_STARTED,
- SPY_STATUS_STOPPED,
- SPY_STATUS_DUMMY
- } SPY_STATUS_t;
- enum
- {
- OTA_FORCED, /*强制升级*/
- OTA_USER_CONFORMED, /*用户许可升级*/
- OTA_MANUL, /*手动升级*/
- OTA_INVALID
- };
- typedef struct _Ota_Hint_Message{
- char ota_hint_message[50];
- int flag;
- }Ota_Hint_Message;
- //-----------------------------------------------------------------------------
- // external Function Prototypes:
- //-----------------------------------------------------------------------------
- //
- #endif