kb_dc_pub.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:6k
- #ifndef KB_DC_PUB_H
- #define KB_DC_PUB_H
- /*****************************头文件**************************/
- //basic include file
- #include <string.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <math.h>
- #include <debug.h>
- //DC include file
- #include "kb_dc_var.h"
- #include "kb_dc_section.h"
- #include "kb_dc_fileproc.h"
- #include "kb_dc_dataparse.h"
- #include "kb_dc_filterdata.h"
- #include "kb_dc_sipsi.h"
- #include "kb_dc_pool.h"
- #include "kb_crc32.h"
- #include "kb_dc_servcfgdata.h"
- #include "kb_dc.h"
- //Other module include file
- #include "machblue_porting_core.h"
- #include "kb_machblue_client_task.h"
- #include "StbMoviesInfo.h"
- #include "kb_xmlParse.h"
- #include "xmlStbInfo.h"
- //OS include file
- #include"kb_dc_osp.h"
- /*****************************宏定义**************************/
- //平台 相关宏定义
- #define KBDcMemset mb_memset
- #define KBDcMalloc mb_malloc
- #define KBDcFree mb_free
- #define KBDcMemcpy mb_memcpy
- #define KBDcGetTable KB_DC_GetTable
- #define KBDcDelay KB_OSPTaskDelay
- //#define KB_DC_TEST_0
- #define KB_DC_TEST_1
- #define KB_DC_TEST_VERSION_UPDATE
- #define KB_DC_TEST_MENU_UPDATE
- #define KB_DC_PARESE_BUFFER_MODE //缓冲模式
- #define KB_DC_SERVICECFG_IN_MAINFREQ_MODE // 主配置文件在主频点发送方式
- //#define KB_DC_SERVICECFG_IN_WHOLENET_MODE // 主配置文件在全网发送方式
- //debug level define
- #define DC_DEBUG_LEVEL 1
- #if DC_DEBUG_LEVEL==0
- #define DEBUG1 0
- #define DEBUG2 0
- #define DEBUG3 0
- #define DEBUG4 0
- #endif
- #if DC_DEBUG_LEVEL==1
- #define DEBUG1 1
- #define DEBUG2 0
- #define DEBUG3 0
- #define DEBUG4 0
- #endif
- #if DC_DEBUG_LEVEL==2
- #define DEBUG1 1
- #define DEBUG2 1
- #define DEBUG3 0
- #define DEBUG4 0
- #endif
- #if DC_DEBUG_LEVEL==3
- #define DEBUG1 1
- #define DEBUG2 1
- #define DEBUG3 1
- #define DEBUG4 0
- #endif
- #if DC_DEBUG_LEVEL==4
- #define DEBUG1 1
- #define DEBUG2 1
- #define DEBUG3 1
- #define DEBUG4 1
- #endif
- #if DEBUG1
- #define DCDebug1 mb_printf
- #else
- #define DCDebug1 NOPrintf
- #endif
- #if DEBUG2
- #define DCDebug2 mb_printf
- #else
- #define DCDebug2 NOPrintf
- #endif
- #if DEBUG3
- #define DCDebug3 mb_printf
- #else
- #define DCDebug3 NOPrintf
- #endif
- #if DEBUG4
- #define DCDebug4 mb_printf
- #else
- #define DCDebug4 NOPrintf
- #endif
- /* program number bit positions */
- #define PROGRAM_DONT_CARE ((U32)1<<31)
- #define PROGRAM_NUMBER_MASK (PROGRAM_NUMBER_MSB_MASK | PROGRAM_NUMBER_LSB_MASK)
- #define PROGRAM_NUMBER_MSB_MASK 0x0000ff00
- #define PROGRAM_NUMBER_LSB_MASK 0x000000ff
- #define SET_PROGRAM_NUMBER(_x_,_pn_) (_x_ = (_pn_ & PROGRAM_NUMBER_MASK))
- #define SET_PROGRAM_NUMBER_DONT_CARE(_x_) (_x_ |= PROGRAM_DONT_CARE)
- /* dvb section header indices */
- #define TABLE_IDX 0
- #define PROGRAML_IDX 3
- #define PROGRAMH_IDX 4
- #define VERSION_IDX 5
- #define SECTION_IDX 6
- #define LASTSECT_IDX 7
- /*
- ** Table id defined by SI standard
- */
- #define PAT_TABLE_ID 0x00 /* Program Association Table */
- #define CAT_TABLE_ID 0x01 /* Conditional Access Table */
- #define PMT_TABLE_ID 0x02 /* Program Map Table */
- #define NIT_TABLE_ID 0x40 /* Network Info Table (actual transport) */
- #define NITO_TABLE_ID 0x41 /* Network Info Table (other transport) */
- #define SDT_TABLE_ID 0x42 /* Service Descriptor Table (actual transport) */
- #define SDTO_TABLE_ID 0x46 /* Service Descriptor Table (other transport) */
- #define BAT_TABLE_ID 0x4a /* Bouquet Association Table */
- #define EIT_TABLE_ID 0x4e /* Event Information Table (actual transport) */
- #define EITO_TABLE_ID 0x4f /* Event Information Table (other transport) */
- #define TDT_TABLE_ID 0x70 /* Time Date Table */
- #define RST_TABLE_ID 0x71 /* Running Status Table */
- #define ST_TABLE_ID 0x72 /* Stuffing Table */
- #define TOT_TABLE_ID 0x73 /* Time Offset Table */
- #define DIT_TABLE_ID 0x7E /* Discontinuity Information Table */
- #define SIT_TABLE_ID 0x7F /* Selection Information Table */
- #define INVALID_TABLE 0x100
- /*
- ** PID definitions
- */
- #define PAT_PID 0x0000
- #define CAT_PID 0x0001
- #define NIT_PID 0x0010
- #define SDT_PID 0x0011
- #define BAT_PID 0x0011
- #define EIT_PID 0x0012
- #define RST_PID 0x0013
- #define TDT_PID 0x0014
- #define TOT_PID 0x0014
- #define DIT_PID 0x001E
- #define SIT_PID 0x001F
- /*****************************数据结构定义**************************/
- typedef void (*KB_DC_TIMER_FUNC_POINTER)(void*);
- typedef enum
- {
- DC_RET_OK,
- DC_RET_ERR
- }KB_DC_Ret;
- typedef struct
- {
- unsigned long Word1;
- unsigned long Word2;
- unsigned long Word3;
- unsigned long Word4;
- }KB_DC_MsgNode;
- typedef enum
- {
- KB_DC_TIMER_REPEAT = 0,
- KB_DC_TIMER_ONCE,
- KB_DC_TIMER_MAX
- }KB_DC_TimerMode;
- typedef enum
- {
- KB_QPSK,
- KB_QAM_16,
- KB_QAM_32,
- KB_QAM_64,
- KB_QAM_128,
- KB_QAM_256,
- KB_QAM_AUTO
- }KBTunerMod;
- //频点描述结构
- typedef struct KB_TUNER_PARA_
- {
- unsigned long frequency; /* frequency in KHz */
- unsigned long symbol; /* symbol rate in ksymbols/s */
- KBTunerMod modulate; /* Modulation:QPSK,QAM_16,QAM_32,QAM_64,QAM_128,QAM_256,QAM_AUTO*/
- }KBTunerPara;
- extern mb_error_t KB_DC_SetQam(unsigned long frequency, unsigned long symbol_rate, unsigned char modulateMode);
- extern void KB_DC_GetMainFreqInfo(KBTunerPara *para);
- extern void kb_DC_GetCurTsInfo(KBTunerPara *para);
- extern void NOPrintf(char *format, ...);
- #endif