static INT32 mail_content_got_info()
{
	UINT16 ret;
	
		INT32 mail_get_success;
	cas_bmail_u cas_bmail;
	
  	mail_get_success = cas_get_bmail_by_pos(&cas_bmail,g_mail_curPos-1,TRUE);

	if (mail_get_success)
	{
		win_popup_msg(NULL,NULL, RS_CTI_CAERR_DATA_NOT_FOUND);
		return 0;
	}
	else if(mail_get_success==0)
		{
		 	;
		}
	else
		{
			win_popup_msg(NULL, NULL, RS_CTI_CAERR_UNKNOWN);
			return 0;
		}
	
	return 1;
}
Exemple #2
0
void save_detitle()
{
    UINT8 back_saved,deldtl,i;
    UINT16 ret2;
    for(i=0; i<CDCA_MAXNUM_DETITLE+1; i++)
    {
        if(del_detitle_idx[i]==1)
            break;
    }
    if(i==CDCA_MAXNUM_DETITLE+1)
        return;
    win_compopup_init(WIN_POPUP_TYPE_OKNO);
    win_compopup_set_msg(NULL, NULL, RS_DETITLE_DELPOP_CURRENT);
    win_compopup_set_default_choice(WIN_POP_CHOICE_NO);
    ret2= win_compopup_open_ext(&back_saved);
    if (ret2 == WIN_POP_CHOICE_YES)
    {
        //to do
        for(i=0; i<CDCA_MAXNUM_DETITLE+1; i++)
        {
            if(del_detitle_idx[i]==1)
            {
                deldtl = CDCASTB_DelDetitleChkNum(current_operator_ID, Detitle_Chknum[i]);
                if (FALSE == deldtl)
                {
                    win_popup_msg(NULL, NULL, RS_OPERATION_ERROR);
                    break;
                }
            }
        }
    }
}
Exemple #3
0
/**************************************************************
 *CAS Main message process entry.
 *msg_code has different meaning for different msg_type, check the 
 *tf_catask.c for detailed info.
 **************************************************************/
PRESULT ap_cti_cas_message_proc ( UINT32 msg_type, UINT32 msg_code )
{
	UINT8 result = PROC_PASS;
	UINT8 scr_type = 0;
	UINT16 strid = 0;
	UINT16 tfmsg_type = 0;
	UINT16 tfmsg_code = 0;
	POBJECT_HEAD p_top_menu = NULL;

	//P_NODE p_node;

	tfmsg_type = ( UINT16)( msg_code>>16);
	tfmsg_code = ( UINT16)( msg_code&0xffff);
	p_top_menu = menu_stack_get_top();
	
	switch ( tfmsg_type)
	{
		case CAS_DISP_CA_ERROR:
			libc_printf("CAS_DISP_CA_ERROR:%d\n",tfmsg_code);
			{
				//ap_cas_message_setid(tfmsg_code&0xff);
				//ap_cas_message_show();
			}
			break;
		case CAS_DISP_SET_IRD_NUMBER_REPLY:
		case CAS_DISP_IRD_NUMBER_NOTIFY:	
		case CAS_DISP_FINGERPRINT_QUERY_REPLY:
		    finger_start_time = 0;
			ap_cas_fingerprint_proc(1);
			break;
		case CAS_DISP_SUBTITLE_NOTIFY:
			break;
		case CAS_DISP_BMAIL_NOTIFY:
			MAIL_ICON_STATUS = Email_New;
			if (SCREEN_BACK_VIDEO == screen_back_state)
			win_popup_msg("You have a new mail!",NULL,0);
			else
				;
			ap_cas_mail_detitle_proc();
			break;
		case CAS_DISP_IPPV_NOTIFY:
			ap_cas_IPPV_proc();
			break;
		case CAS_DISP_SC_INFO:
			ap_cas_smc_info_proc( msg_type, msg_code);
			break;
		case CAS_DISP_CARD_IN:
			break;
		case CAS_DISP_CARD_OUT:
			break;
		default:
			libc_printf("!!!!%s: unknown message %d got!!", __FUNCTION__, tfmsg_type);
			break;
		
	}

	return result;
}
Exemple #4
0
UINT8 detitle_get_info(UINT16 *num)
{
    UINT16 ret, i, tmp=0;

    for (i=0; i<=CDCA_MAXNUM_DETITLE; i++)
    {
        Detitle_Chknum[i] = 0;
    }

    ret = CDCASTB_GetDetitleChkNums(current_operator_ID, Detitle_Chknum);
    if ((CDCA_RC_POINTER_INVALID == ret)||(CDCA_RC_CARD_INVALID == ret))
    {
        win_popup_msg(NULL, NULL, RS_CAERR_NOSMC);
        return 0;
    }
    else if (CDCA_RC_DATA_NOT_FIND == ret)
    {
        win_popup_msg(NULL, NULL, RS_CAERR_DATA_NOT_FOUND);
        return 0;
    }
    else if (CDCA_RC_OK == ret)
    {
        //not sure how to keep the total detitle number
        for (i=0; i<CDCA_MAXNUM_DETITLE; i++)
        {
            if (Detitle_Chknum[i] != 0)
                tmp = i+1;
        }
        *num = tmp;
        return 1;
    }
    else
    {
        win_popup_msg(NULL, NULL, RS_CAERR_UNKNOWN);
    }

    return 0; // in case other error
}
Exemple #5
0
// 1 valid 0 invalid
static UINT8 qs_check_value()
{
	UINT32 ret1, ret2;
	UINT8 save;

	ret1 = check_freq_value(display_strs[20]);
	ret2 = check_symbol_value(display_strs[21]);
	if (ret1 != 0 || ret2 != 0)
	{
		win_popup_msg(NULL, NULL, RS_MSG_INVALID_INPUT_CONTINUE);
		return 0;
	}
	else
		return 1;
}
static PRESULT cti_mat_win_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 mat_value =0;
	UINT8 bFocusID = OSD_GetFocusID(pObj);

	switch(event)
	{
	case EVN_PRE_OPEN:
		if(cti_mat_init()==CAS_SC_OK)
		{
			//wincom_open_title_ext(pObj,"Maturity Rating",0);
			wincom_open_subtitle(pObj,RS_CTI_MATURITY_RATING,0);
			cti_mat_display(0);
		}
		else
		{
			ret = PROC_LEAVE;
			win_popup_msg(NULL, NULL, RS_CTI_NO_CARD);
		}
		break;
	case EVN_POST_OPEN:

		break;
	case EVN_PRE_CLOSE:
		/* Make OSD not flickering */
		*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG;	
		break;
	case EVN_POST_CLOSE:
		break;

	case EVN_ITEM_POST_CHANGE:
		if(bFocusID == 2)
		{
			input_pin_char_cnt=0;
			memset(input_pin_chars,0,sizeof(input_pin_chars));
			cti_mat_draw_pin();
		}
		
		break;

	case EVN_UNKNOWN_ACTION:
		break;
	case EVN_MSG_GOT:
		if(CTRL_MSG_SUBTYPE_STATUS_CTI_CA==param1)
		{
			UINT16 msg_code =(UINT16)(param2>>16);
			cas_sc_t card_info;
		#if 0	
			if(msg_code==CAS_DISP_CARD_OUT)
			{
			#if (CTI_INFO_DISP_MODE==1)
				ret = PROC_LEAVE;
			#endif
			}
			else
			{
				cti_mat_display(1);
			}
		#else

			if (msg_code == CAS_DISP_SC_INFO)
			{
				cas_get_sc_info_req(&card_info);	

				cti_mat_display(1);
				if(card_info.sc_status==0)	//smart card ok
				{
				}
				else if(card_info.sc_status==1)	//smart card out	
				{
				#if (CTI_INFO_DISP_MODE==1)
				/*ÎÞ¿¨×´Ì¬×Ô¶¯Í˳ö*/
					ret = PROC_LEAVE;
				#endif
				}
				
			}
		#endif
		}
		break;
	
	}
Exemple #7
0
static PRESULT sys_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 id = 0;
	VACTION act;
	OSD_RECT rct;
	SYSTEM_DATA *psys = NULL;
	psys = sys_data_get();
	struct smc_device *smc_dev;
	smc_dev = (struct smc_device *)dev_get_by_id(HLD_DEV_TYPE_SMC, 0);

	rct.uHeight = 130;
	rct.uWidth = 200;
	rct.uLeft = PREVIEW_L + (PREVIEW_W - rct.uWidth) / 2;
	rct.uTop = PREVIEW_T + PREVIEW_H;

	switch (event)
	{
		case EVN_UNKNOWN_ACTION:
			act = (VACTION)(param1 >> 16);
			switch (act)
			{
			case VACT_ITEM_SELECT:
				id = OSD_GetFocusID(pObj);
#ifdef MULTI_CAS
#if(CAS_TYPE== CAS_DVN)
				if(id==WIN_CA_ID&&(!getIsCardIn()))
				{
					win_popup_msg(NULL, NULL, RS_CAERR_NOSMC);
					break;
				}
#elif(CAS_TYPE== CAS_CONAX)
				if((id == WIN_CA_ID) && (smc_card_exist(smc_dev) != SUCCESS))
				{
					break;
				}
#elif(CAS_TYPE== CAS_ABEL)
				if((id == WIN_CA_ID) && (!api_abel_cas_check_card_inited()))
				{
					win_popup_msg(NULL, NULL, RS_CAERR_NOSMC);
					break;
				}				
#endif
#endif
                    if((id == WIN_PWD_ID)||
                        (psys->menu_lock&&(id == WIN_CA_ID || id == WIN_FACT_ID || id == WIN_OTA_ID)))
				{
					if (!win_pwd_open(NULL, 0, &rct))
						break;
				}
				if ((NULL !=items_list[id - 1]) && (OSD_ObjOpen(items_list[id - 1], 0xFFFFFFFF) != PROC_LEAVE))
					menu_stack_push(items_list[id - 1]);
				break;
			default:
				break;
			}
			ret = PROC_LOOP;
			break;
		default:
			break;
	}
	return ret;
}
INT32 IPPVinfo_got_info()
{
	UINT16 ret;
	UINT16 total_num = CDCA_MAXNUM_IPPVP;
	SCDCAIppvInfo  total_program_info[CDCA_MAXNUM_IPPVP];
	
#if 1	
	MEMSET(total_program_info, 0, sizeof(total_program_info));
	ret = CDCASTB_GetIPPVProgram(current_operator_ID, total_program_info, &total_num);
	if (CDCA_RC_CARD_INVALID== ret)
	{
		win_popup_msg(NULL, NULL, RS_CAERR_NOSMC);
		return 0;
	}
	else if (CDCA_RC_DATA_NOT_FIND == ret)
	{
		win_popup_msg(NULL, NULL, RS_CAERR_DATA_NOT_FOUND);
		return 0;	
	}
	else if (CDCA_RC_DATASPACE_SMALL == ret)
	{
		win_popup_msg(NULL, NULL, RS_CAERR_BUFFER_SMALL);
		return 0;
	}
	else if (CDCA_RC_OK == ret)
	{
		//success, sort the IPPV prog info by Select Sorting Method
		UINT32 i, j, k;
		SCDCAIppvInfo tmp;

		for (i=0; i<total_num; i++)
		{
			k = i;
			for (j=i+1; j<total_num; j++)
			{
				/*if ((total_program_info[j].m_bySlotID < total_program_info[k].m_bySlotID)
					||((total_program_info[j].m_bySlotID == total_program_info[k].m_bySlotID) 
						&&(total_program_info[j].m_dwProductID<total_program_info[k].m_dwProductID)))*/
				if (total_program_info[j].m_dwProductID<total_program_info[k].m_dwProductID)
					k = j;
			}
			if (k != i)
			{
				MEMCPY(&tmp, &total_program_info[i], sizeof(SCDCAIppvInfo));
				MEMCPY(&total_program_info[i], &total_program_info[k], sizeof(SCDCAIppvInfo));
				MEMCPY(&total_program_info[k], &tmp, sizeof(SCDCAIppvInfo));
			}
		}
		//just display the viewed records
		MEMSET(IPPV_program_info, 0, sizeof(IPPV_program_info));
		j= 0;
		for(i=0; i<total_num; i++)
		{
			if (CDCA_IPPVSTATUS_VIEWED == total_program_info[i].m_byBookEdFlag) //viewed
			{
				MEMCPY(&IPPV_program_info[j], &total_program_info[i], sizeof(SCDCAIppvInfo));
				j++;
			}
		}
		total_IPPV_number = j;
	}
	else
	{
		win_popup_msg(NULL, NULL, RS_CAERR_UNKNOWN);
		return 0;
	}
#else // for self -testing 
	UINT32 i, j, k;
	SCDCAIppvInfo tmp;
	total_num = 201;

	MEMSET(total_program_info, 0, sizeof(total_program_info));
	for (k=0;k<total_num;k++)
	{
		i = total_num - k;
		total_program_info[i].m_dwProductID = 1200000290+i;
		total_program_info[i].m_bCanTape = i%2;
		total_program_info[i].m_byBookEdFlag = (i%3) +1;
		total_program_info[i].m_bySlotID = i%5;
		total_program_info[i].m_wPrice = i*3;
	}


		for (i=0; i<total_num; i++)
		{
			k = i;
			for (j=i+1; j<total_num; j++)
			{
				/*if ((total_program_info[j].m_bySlotID < total_program_info[k].m_bySlotID)
					||((total_program_info[j].m_bySlotID == total_program_info[k].m_bySlotID) 
						&&(total_program_info[j].m_dwProductID<total_program_info[k].m_dwProductID)))*/
				if (total_program_info[j].m_dwProductID<total_program_info[k].m_dwProductID)
					k = j;
			}
			if (k != i)
			{
				MEMCPY(&tmp, &total_program_info[i], sizeof(SCDCAIppvInfo));
				MEMCPY(&total_program_info[i], &total_program_info[k], sizeof(SCDCAIppvInfo));
				MEMCPY(&total_program_info[k], &tmp, sizeof(SCDCAIppvInfo));
			}
		}
		//just display the viewed records
		MEMSET(IPPV_program_info, 0, sizeof(IPPV_program_info));
		j= 0;
		for(i=0; i<total_num; i++)
		{
			if (CDCA_IPPVSTATUS_VIEWED == total_program_info[i].m_byBookEdFlag) //viewed
			{
				MEMCPY(&IPPV_program_info[j], &total_program_info[i], sizeof(SCDCAIppvInfo));
				j++;
			}
		}
		total_IPPV_number = j;
#endif	
	return 1;

}
Exemple #9
0
static PRESULT cti_PPID_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bFocusID=OSD_GetContainerFocus((PCONTAINER)&g_win_cti_PPID);

	switch(event)
	{
		case EVN_PRE_OPEN:
			if(cti_PPID_init(param2)!=0)
			{
			#if (CTI_INFO_DISP_MODE==1)
				win_popup_msg(NULL, NULL, RS_CTI_NO_CARD);
				ret= PROC_LEAVE;
				break;
			#endif
			}
			cti_PPID_display(FALSE);
			//wincom_open_title_ext(pObj,"Program Provider",0);
			wincom_open_subtitle(pObj,RS_CTI_PROVIDER_INFO,0);
			break;
			
		case EVN_POST_OPEN:
			break;		
			
		case EVN_PRE_CLOSE:
			/* Make OSD not flickering */
			*((UINT32*)param2) &= ~C_CLOSE_CLRBACK_FLG; 
			break;
			
		case EVN_POST_CLOSE:
			break;

		case EVN_ITEM_POST_CHANGE:
			g_PPID_itemIdx=bFocusID;
			break;

		case EVN_UNKNOWN_ACTION:
			{
				cas_sc_t cardinfo;
				VACTION act = (VACTION)(param1>>16);

				// check sc statues
				cas_get_sc_info_req(&cardinfo);
				if(cardinfo.sc_status!=CAS_SC_OK)
				{
					return PROC_PASS;
				}

				if(act==VACT_ENTER)
				{
					cti_PPID_detail_info_display();
				}
				else
				{
					cti_PPID_unknowact_proc(act);
				}

			}
			break;				
			
		case EVN_MSG_GOT:
			if(CTRL_MSG_SUBTYPE_STATUS_CTI_CA==param1)
			{
			#if 0
				if( (param2>>16)== CAS_DISP_CARD_OUT)
				{
				#if (CTI_INFO_DISP_MODE==1)
					ret=PROC_LEAVE;
				#endif
				}
				else
				{
					cti_PPID_init(MENU_OPEN_TYPE_MENU);
					cti_PPID_display(TRUE);
				}
			#else
					cas_sc_t card_info;
				if( (param2>>16)== CAS_DISP_SC_INFO)
				{
					cas_get_sc_info_req(&card_info);	

					cti_PPID_init(MENU_OPEN_TYPE_MENU);
					cti_PPID_display(TRUE);
					if(card_info.sc_status==0)	//smart card ok
					{
					}
					else if(card_info.sc_status==1)	//smart card out	
					{
					#if (CTI_INFO_DISP_MODE==1)
					/*无卡状态自动退出*/
						ret = PROC_LEAVE;
					#endif
					}

				}
		
			#endif
			}
			break;
			
		default:
			break;
	}