当前位置: 首页>>代码示例>>C++>>正文


C++ DVBT_DEMOD_MODULE::IsSignalLocked方法代码示例

本文整理汇总了C++中DVBT_DEMOD_MODULE::IsSignalLocked方法的典型用法代码示例。如果您正苦于以下问题:C++ DVBT_DEMOD_MODULE::IsSignalLocked方法的具体用法?C++ DVBT_DEMOD_MODULE::IsSignalLocked怎么用?C++ DVBT_DEMOD_MODULE::IsSignalLocked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DVBT_DEMOD_MODULE的用法示例。


在下文中一共展示了DVBT_DEMOD_MODULE::IsSignalLocked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/**

@see   DVBT_NIM_FP_IS_SIGNAL_LOCKED

*/
s32
dvbt_nim_default_IsSignalLocked(
	DVBT_NIM_MODULE *pNim,
	s32 *pAnswer
	)
{
	BASE_INTERFACE_MODULE *pBaseInterface;
	DVBT_DEMOD_MODULE *pDemod;
	s32 i;


	// Get base interface and demod module.
	pBaseInterface = pNim->pBaseInterface;
	pDemod         = pNim->pDemod;


	// Wait for signal lock check.
	for(i = 0; i < DVBT_NIM_SINGAL_LOCK_CHECK_TIMES_MAX_DEFAULT; i++)
	{
		// Wait 20 ms.
		pBaseInterface->WaitMs(pBaseInterface, 20);

		// Check signal lock status on demod.
		// Note: If signal is locked, stop signal lock check.
		if(pDemod->IsSignalLocked(pDemod, pAnswer) != FUNCTION_SUCCESS)
			goto error_status_execute_function;

		if(*pAnswer == YES)
			break;
	}


	return FUNCTION_SUCCESS;


error_status_execute_function:
	return FUNCTION_ERROR;
}
开发者ID:ldy972,项目名称:Drone,代码行数:43,代码来源:dvbt_nim_base.c

示例2: fe_demod_info_ioctrl

static int fe_demod_info_ioctrl(struct dvb_frontend *fe, void *parg)
{

    struct rtl2832u_ioctl_info_struct*  info_ctrl = (struct rtl2832u_ioctl_info_struct*)parg;
    int ret =-1;
    struct rtl2832_state*	p_state = fe->demodulator_priv;
    DVBT_NIM_MODULE 	*pNim;
    DVBT_DEMOD_MODULE 	*pDemod;
    u16			strength=0;
    u32			quality=0;
    int 			answer=0;
    unsigned long 		BerNum=0,BerDen=1;
    long 			SnrDbNum=0, SnrDbDen=1;
    long 			tr_ppm=0,cr_hz=0;
    unsigned long 		data_length=info_ctrl->data_length;
    int 			info_cmd = info_ctrl->cmd_num;
    deb_info("+%s : ioctl -demod info cmd = %d ,data length= %d (must > %d )\n", __FUNCTION__,info_cmd,(int)data_length,INFO_DEMOD_DATA_LEN);
    if (p_state->demod_type != RTL2832) {
        deb_info("ERROR::demod type not rtl2832u...\n");
        return -1;
    }
    if (data_length < INFO_DEMOD_DATA_LEN) {
        deb_info("ERROR::data length is too short...,must be greater than %d \n",INFO_DEMOD_DATA_LEN);
        return -1;
    }
    pNim = p_state->pNim;
    if (pNim == NULL) {
        deb_info("ERROR::nim is null...\n");
        return -1;
    }

    pDemod=pNim->pDemod;


    if ((info_cmd != FE_GET_SIGN_STRENGTH) && (info_cmd != FE_GET_SIGN_QUALITY))
    {
        if( mutex_lock_interruptible(&p_state->i2c_repeater_mutex) )	{
            return -10;
        }
    }
    info_ctrl->data[INFO_DATA_VALUE]=0x00000000;
    info_ctrl->data[INFO_DATA_DEN]=1;
    switch(info_cmd)
    {
    case FE_GET_SIGN_STRENGTH:
        if (rtl2832_read_signal_strength(fe,&strength) != 0)
        {
            ret=-10;
        }
        else
        {
            ret=10;
            info_ctrl->data[INFO_DATA_VALUE]=(unsigned long)strength;
            info_ctrl->data[INFO_DATA_DEN]=1;
//				deb_info("rtl2832u ioctl (FE_GET_SIGN_STRENGTH)- strength = %x (%x). \n",strength,info_ctrl->data[INFO_DATA_VALUE] );

        }


        break;
    case FE_GET_SIGN_QUALITY:
        if (rtl2832_read_signal_quality(fe,&quality) != 0)
        {
            ret=-10;
        }
        else
        {
            ret=10;
            info_ctrl->data[INFO_DATA_VALUE]=(unsigned long)quality;
            info_ctrl->data[INFO_DATA_DEN]=1;
//				deb_info("rtl2832u ioctl (FE_GET_SIGN_QUALITY)- quality = %x (%x). \n",quality,info_ctrl->data[INFO_DATA_VALUE] );
        }

        break;
    case FE_GET_SIGN_LOCK:

        answer=NO;
        if (pDemod->IsSignalLocked(pDemod, &answer) != FUNCTION_SUCCESS)
        {
            ret=-10;
        }
        else
        {
            if (answer == YES) {
                info_ctrl->data[INFO_DATA_VALUE]=1;
            }
            else	info_ctrl->data[INFO_DATA_VALUE]=0;

            info_ctrl->data[INFO_DATA_DEN]=1;
            ret=10;
        }


        break;
    case FE_GET_DEMOD_BER:

        if(pDemod->GetBer(pDemod, &BerNum, &BerDen) != FUNCTION_SUCCESS)
        {
            ret=-10;
            info_ctrl->data[INFO_DATA_VALUE]=19616;
//.........这里部分代码省略.........
开发者ID:ambrosa,项目名称:DVB-Realtek-RTL2832U-2.2.2-4_tuner,代码行数:101,代码来源:rtl2832u_ioctl.c


注:本文中的DVBT_DEMOD_MODULE::IsSignalLocked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。