Exemplo n.º 1
0
/*NIt search callback for update tp*/
static UINT8 as_update_tp(TP_INFO *t_info)
{
    INT32 i;

    if(as_info->param.as_frontend_type==FRONTEND_TYPE_S)
    {
        dvbs_tp_info2db(t_info, &as_info->cur_tp);
		//Check whether Current TP Param is Valid or not
        	if(dvbs_tp_sanity_check(as_info->voltage_ctrl, &as_info->cur_tp, &as_info->cur_sat) == FALSE)
        	{
            		return as_info->stop_scan_signal;
        	}
    	}
    	else if(as_info->param.as_frontend_type == FRONTEND_TYPE_C)
    	{
    		//Copy Input TP Info to Current TP
        	dvbc_tp_info2db(t_info, &as_info->cur_tp);
		//Check whether Current TP Param is Valid or not
        	if(dvbc_tp_sanity_check(FALSE, &as_info->cur_tp, NULL) == FALSE)
        	{
            		return as_info->stop_scan_signal;
        	}
	}

	//Search TP Info in DB. If can't find, then Add this TP Info into DB
    	as_info->cur_tp.sat_id = as_info->cur_sat.sat_id;
    	if(db_search_lookup_node(TYPE_SEARCH_TP_NODE, &as_info->cur_tp) != SUCCESS)
    	{
        	if(add_node(TYPE_SEARCH_TP_NODE, as_info->cur_tp.sat_id, &as_info->cur_tp) == STORE_SPACE_FULL)
        	{
            		return 1;
        	}
    	}

    	AS_DUMP_TP(&as_info->cur_tp);
	//Search Current TP in Waiting Scan TP List, if find, then Return, otherwise Add Current TP 
	//to Waiting Scan TP List
    	for(i = as_info->tp_nr - 1; i >= 0; i--)
    	{
        	if (as_info->tp_id[i] == as_info->cur_tp.tp_id)
        	{
            		return as_info->stop_scan_signal; 
        	}
	}		
    	as_info->tp_id[as_info->tp_nr++] = as_info->cur_tp.tp_id;

	if(as_info->param.as_handler != NULL)
    	{
        	as_info->param.as_handler(ASM_TYPE_INC_TRANSPONDER, 0);
    	}

    	return as_info->stop_scan_signal; 
}
Exemplo n.º 2
0
/*NIt search callback for update tp*/
static UINT8 as_update_tp(TP_INFO *t_info)
{
	INT32 i;
#if (SYS_PROJECT_FE == PROJECT_FE_DVBS||SYS_PROJECT_FE == PROJECT_FE_DVBS2)
	if ((t_info->s_info.frequency<= AS_MIN_SAT_DL_FREQUENCY)
		||(t_info->s_info.frequency>=AS_MAX_SAT_DL_FREQUENCY))
	{
		return as_info->stop_scan_signal;
	}
#elif (SYS_PROJECT_FE == PROJECT_FE_DVBC)
	if((t_info->c_info.frequency<AS_MIN_CAB_FREQUENCY)
		||(t_info->c_info.frequency>AS_MAX_CAB_FREQUENCY))
	{
		return as_info->stop_scan_signal;
	}
#endif
	tp_info2db(t_info, &as_info->cur_tp);
	if (tp_sanity_check(&as_info->cur_tp,  &as_info->cur_tp, &as_info->cur_sat)==FALSE)
		return as_info->stop_scan_signal;

	as_info->cur_tp.sat_id = as_info->cur_sat.sat_id;
	if(db_search_lookup_node(TYPE_SEARCH_TP_NODE, &as_info->cur_tp)!=SUCCESS)
	{
		if(add_node(TYPE_SEARCH_TP_NODE, as_info->cur_tp.sat_id,&as_info->cur_tp) ==STORE_SPACE_FULL)
			return 1;
	}

	AS_DUMP_TP(&as_info->cur_tp);
	for(i=as_info->tp_nr-1; i>=0; i--)
     {
		if (as_info->tp_id[i] == as_info->cur_tp.tp_id)
			return as_info->stop_scan_signal; 
	}
	as_info->tp_id[as_info->tp_nr++] = as_info->cur_tp.tp_id;
	as_info->param.as_handler(ASM_TYPE_INC_TRANSPONDER, 0);

	return as_info->stop_scan_signal; 
}
Exemplo n.º 3
0
//dvbs blind scan nim api callback function.
static INT32 dvbs_as_callback(UINT8 signal, UINT8 polar, UINT32 freq, UINT32 sym, UINT8 fec)
{
    	static INT16 crnum;
    	T_NODE *tp;
    	UINT16 sat_id;
    	as_update_event_t handle = as_info->param.as_handler;
    	UINT8 progress = 0;

	/* sky.bi 20101227   */
	FIXED_PRINTF("dvbs_as_callback  ******search_callback*********sky.bi\n");
	
    	if (NULL == as_info)
    	{
        	AS_PRINTF("%s: wrong status!\n", __FUNCTION__);
        	return 2;
    	}
	    	
    	if(as_info->stop_scan_signal)     
    	{
        	return 2;
    	}
    	else if((signal == AS_SGN_UNLOCKED) || (signal == AS_SGN_LOCKED))
    	{
        	/* Patches for lib_nim Out-Band Xponder Mis-Report */
        	if ((crnum < 0) && ((freq < as_info->param.as_from) || (freq > as_info->param.as_to)))
        	{
            		return 0;
        	}
        	else if ((as_info->param.as_method == AS_METHOD_FFT) || (as_info->param.as_method == AS_METHOD_MULTI_FFT))
        	{
        		//Calculate and Show Scan Progress
            		progress = (UINT8)dvbs_calculate_progress(as_info, freq, polar, crnum);
            		if(handle != NULL)
            		{
                		handle(ASM_TYPE_PROGRESS, progress);
				/* sky.bi 20101227   */
				FIXED_PRINTF("dvbs_as_callback  ******search_callback    ASM_TYPE_PROGRESS*********sky.bi\n");
            		}
        	}
    	}
	
    	switch(signal)
    	{
    	case AS_SGN_LOCKED:
		//Check whether New Freq Point, Sym Rate, and Polarity is same to the Old TP or not 
		if (dvbs_tp_duplicate_check(freq, sym, polar) == FALSE)
		{
            		break;
		}

		//Construct one New TP according to Locked Freq and Sym
		tp = &as_info->xp;
        MEMSET(tp, 0, sizeof(T_NODE));
        dvbs_convert_freq(as_info, tp, freq);
        tp->sym = sym;
        tp->sat_id = sat_id = as_info->cur_sat.sat_id;
        tp->ft_type = FRONTEND_TYPE_S;
        
        AS_DUMP_TP(tp);
        if(db_search_lookup_node(TYPE_SEARCH_TP_NODE, tp)!=SUCCESS)
        {
            INT32 ret;
            ret = add_node(TYPE_SEARCH_TP_NODE, tp->sat_id, tp);
            if ((DBERR_FLASH_FULL==ret) || (DBERR_MAX_LIMIT)==ret)
            		{
                		return 1;
            		}
        	}
		//Process by Upper Layer	
        	if(handle != NULL)
        	{
            		handle(ASM_TYPE_ADD_TRANSPONDER, tp->tp_id);
        	}

        /* start searching si information of all programs in this frequency point  */
        psi_module_init(as_info->dmx, as_info->nim,(void *)__MM_PSI_START_ADDR, 180*1024);
        if (SI_STOFULL == psi_search_start(sat_id,tp->tp_id, as_info->param.as_prog_attr,
            as_info->param.as_p_add_cfg, psi_callback,NULL, NULL))
        {
            return 1;
        }
	 	 
    break;
    
    case AS_SGN_STOP:
        AS_PRINTF(">>>>>>>>>>>>>>STOP!!!<<<<<<<<<<<<<<<<<<\n");
        as_info->stop_scan_signal=1;
    break;
    
    case AS_SGN_CRNUM:
        crnum = freq;
    break;
    
    case AS_SGN_INIT:
        crnum = -1;
		//Initialize one TP	
        	dvbs_tp_duplicate_check(0, 0, 0);
        break;
//>>> Unicable begin
	case AS_SET_UNICABLE:
		tp = &as_info->xp;
        MEMSET(tp, 0, sizeof(T_NODE));
		dvbs_convert_freq(as_info, tp, freq);
		as_info->xponder.s_info.frq = tp->frq;
		as_info->xponder.s_info.pol = as_info->polar;
		frontend_set_unicable(as_info->nim,&as_info->antenna, &as_info->xponder);
		break;
//<<< Unicable end
    default:
        break;
    }

    return (as_info->stop_scan_signal)? 2: 0;
}
Exemplo n.º 4
0
/*description	: autoscan nim api callback function.*/
static INT32 dvbs_as_callback(UINT8 signal, UINT8 polar, UINT32 freq, UINT32 sym, 
	UINT8 fec)
{
    static INT16 crnum;
    T_NODE *tp;
    UINT16 sat_id;
    as_update_event_t handle = as_info->param.as_handler;
    
    if (NULL == as_info)
    {
        AS_PRINTF("%s: wrong status!\n", __FUNCTION__);
        return 2;
    }
	
    tp = &as_info->xp;
    if (as_info->stop_scan_signal)
    {
        return 2;
    }
    else if ((signal==AS_SGN_UNLOCKED)||(signal==AS_SGN_LOCKED))
    {
        /* patches for lib_nim out-band xponder mis-report*/
        if ((crnum<0)&&((freq<as_info->param.as_from)||(freq>as_info->param.as_to)))
            return 0;
        else if ((as_info->param.as_method == AS_METHOD_BLIND)
            ||(as_info->param.as_method == AS_METHOD_MULTI_FFT))
        {
            handle(ASM_TYPE_PROGRESS,(UINT8)dvbs_calculate_progress(as_info, freq, 
            polar, crnum));
        }
    }
	
    switch(signal)
    {
    case AS_SGN_LOCKED:  
        if (dvbs_tp_duplicate_check(freq, sym, polar) == FALSE)
            break;

        MEMSET(tp, 0, sizeof(T_NODE));
        dvbs_convert_freq(as_info, tp, freq);
        tp->sym = sym;
        tp->sat_id = sat_id = as_info->cur_sat.sat_id;
        AS_DUMP_SAT(&as_info->cur_sat);
        AS_DUMP_TP(tp);
        if(db_search_lookup_node(TYPE_SEARCH_TP_NODE, tp)!=SUCCESS)
        {
            INT32 ret;
            ret = add_node(TYPE_SEARCH_TP_NODE, tp->sat_id, tp);
            if ((DBERR_FLASH_FULL==ret) || (DBERR_MAX_LIMIT)==ret)
                return 1;
        }

        handle(ASM_TYPE_ADD_TRANSPONDER, tp->tp_id);
#ifdef BASE_TP_HALF_SCAN_SUPPORT

        psi_module_init(as_info->dmx, as_info->nim,(void *)__MM_PSI_START_ADDR, 280*1024);
#else
        psi_module_init(as_info->dmx, as_info->nim,(void *)__MM_PSI_START_ADDR, 180*1024);
#endif
        if (SI_STOFULL == psi_search_start(sat_id,tp->tp_id, as_info->param.as_prog_attr,
            as_info->param.as_p_add_cfg, psi_callback,NULL, NULL))
        {
            return 1;
        }
    break;
    
    case AS_SGN_STOP:
        AS_PRINTF(">>>>>>>>>>>>>>STOP!!!<<<<<<<<<<<<<<<<<<\n");
        as_info->stop_scan_signal=1;
    break;
    
    case AS_SGN_CRNUM:
        crnum = freq;
    break;
    
    case AS_SGN_INIT:
        crnum = -1;			
        dvbs_tp_duplicate_check(0, 0, 0);
        break;
//>>> Unicable begin
	case AS_SET_UNICABLE:
		dvbs_convert_freq(as_info, tp, freq);
		as_info->xponder.frq = tp->frq;
		as_info->xponder.pol = as_info->antenna.pol;
		//libc_printf("pol: %d\n",as_info->antenna.pol);
		set_unicable(&as_info->antenna, &as_info->xponder);
		wait_nim_ready();
//			wait_nim_ready();
		break;
//<<< Unicable end
    default:
        break;
    }

    return (as_info->stop_scan_signal)? 2: 0;
}
Exemplo n.º 5
0
static UINT8 as_update_tp(TP_INFO *t_info)
{
    INT32 i;
    T_NODE* tp = &(as_info->xp);

	if(as_info->param.as_frontend_type == FRONTEND_TYPE_C)
	{
//for jilin prj,filter the HD program.      
#ifdef JILIN_FEATURE
            if((t_info->c_info.frequency==72200)
                ||(t_info->c_info.frequency==73000)
                ||(t_info->c_info.frequency==73800))
            {
                libc_printf("\ncur freq:%d\n",t_info->c_info.frequency);
                return as_info->stop_scan_signal;
            }
#endif       
		//Copy Input TP Info to Current TP
    		dvbc_tp_info2db(t_info, &as_info->cur_tp);
	    //Check whether Current TP Param is Valid or not
	    	if(dvbc_tp_sanity_check(FALSE, &as_info->cur_tp, NULL) == FALSE)
	    	{
	        		return as_info->stop_scan_signal;
	    	}
	}
	

	//Search TP Info in DB. If can't find, then Add this TP Info into DB
    	as_info->cur_tp.sat_id = as_info->cur_sat.sat_id;
    	if(db_search_lookup_node(TYPE_SEARCH_TP_NODE, &as_info->cur_tp) != SUCCESS)
    	{
        	if(add_node(TYPE_SEARCH_TP_NODE, as_info->cur_tp.sat_id, &as_info->cur_tp) == STORE_SPACE_FULL)
        	{
            		return 1;
        	}
    	}

    	AS_DUMP_TP(&as_info->cur_tp);
	//Search Current TP in Waiting Scan TP List, if find, then Return, otherwise Add Current TP 
	//to Waiting Scan TP List

    	for(i = as_info->tp_nr - 1; i >= 0; i--)
    	{
        	if (as_info->tp_id[i] == as_info->cur_tp.tp_id && as_info->tp_si[i])
        	{
            		return as_info->stop_scan_signal; 
        	}
	}		


    	as_info->tp_id[as_info->tp_nr++] = as_info->cur_tp.tp_id;
#ifdef NIT_AUTO_SEARCH_SUPPORT// add for auto scan with nit search 
	if(as_info->atp.nit_enable == 1 && as_info->tp_nr > 0)
		b_found_nit_tp = TRUE;
	else 
		b_found_nit_tp = FALSE;
#endif

	if(as_info->param.as_handler != NULL)
    	{
        	as_info->param.as_handler(ASM_TYPE_INC_TRANSPONDER, 0);
    	}

    	return as_info->stop_scan_signal; 
}