📄 cas.h
字号:
/****************************************************************************
*
* ALi
*
* File: cas.h
*
* Description: Debug Cas
*
* History:
* Date Author Version Comment
* ==== ====== ======= =======
*
*
****************************************************************************/
#ifndef __CAS_H__
#define __CAS_H__
#include <types.h> // UINT16 UINT32 NULL INT8 INT16 INT32
#include "cas_cch.h" // Cas Type Cas Bool Cas_false Cas_Null Cas_Byte OSD Operation in CAS Sys
#include "control.h" // ControlMsgSub
//#define CAS_DEBUG_PRINT
#define CAS_ERROR_PRINT
#ifdef CAS_DEBUG_PRINT
//#define CAS_DEBUG_PRINTF soc_printf //libc_printf to DCU
#define CAS_DEBUG_PRINTF libc_printf // to PC
#define CAS_DEBUG_DUMP(data,len) {\
const int l=(len); int i;\
for(i=0; i<l ; i++)\
{\
if((i!=0) && ((i&0x0F) == 0)) CAS_DEBUG_PRINTF("\n");\
CAS_DEBUG_PRINTF("%02x ",*((data)+i));\
}\
CAS_DEBUG_PRINTF("\n");\
}
#else
#define CAS_DEBUG_PRINTF(...) do{}while(0)
#define CAS_DEBUG_DUMP(data,len) do{}while(0)
#endif
#ifdef CAS_ERROR_PRINT
#define CAS_ERROR_PRINTF libc_printf
#define CAS_ERROR_DUMP(data,len) {\
const int l=(len); int i;\
for(i=0; i<l ; i++)\
{\
if((i!=0) && ((i&0x0F) == 0)) CAS_ERROR_PRINTF("\n");\
CAS_ERROR_PRINTF("%02x ",*((data)+i));\
}\
CAS_ERROR_PRINTF("\n");\
}
#else
#define CAS_ERROR_PRINTF(...) do{}while(0)
#define CAS_ERROR_DUMP(data,len) do{}while(0)
#endif
enum cas_state{
CAS_STATE_UNREGISTER = 0,
CAS_STATE_IDLE,
CAS_STATE_RUN,
};
enum cas_msg_type {
CAS_MSG_NULL = 0, /*poll filter*/
CAS_MSG_START, /*change to a scrambled channel*/
CAS_MSG_STOP, /*change to a FTA channel*/
CAS_MSG_CAT, /*got a CAT, (try to handle cas_filter within the main_thread)*/
CAS_MSG_UPKEY, /*update key*/
CAS_MSG_ECM, /*get a ecm data*/
CAS_MSG_EMM, /*get a emm data*/
CAS_MSG_TIMEOUT /*get section timeout*/
/*extend for smartcard*/
};
typedef struct{
enum cas_msg_type type;
UINT32 param;
} cas_msg_t;
typedef struct
{
UINT32 thread_id;
UINT32 msgque_id;
enum cas_state state;
void (*callback)(enum cas_msg_type type); /*To show information on osd*/
} cas_t;
struct CAS_PARA
{
struct cc_antenna_info antenna_info;
struct cc_xpond_info xpond_info;
//UINT16 pid;
};
/* Export function for root */
INT32 api_cas_register(void (*callback)(enum cas_msg_type type));
INT32 api_cas_unregister();
/* Export function for channal change */
INT32 api_cas_start();
INT32 api_cas_stop();
/* Export function for OSD to show and modify key */
INT32 api_cas_load_key();
INT32 api_cas_save_key();
/* Universal send message interface */
void api_cas_send_msg(enum cas_msg_type type, UINT32 param);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -