⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmiservices.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
            showUSSDCNF(win, ss_cnf );
            break;

        default:
            //TRACE_FUNCTION("ERROR in USSD_CNF");
            //showError(win, ss_cnf->ussd_info.error);
            services_info_screen(win,TxtFailed);//WUFEI APPEND
            break;
        }
        break;
    case E_SS_GET_PW:
        if( ss_cnf->pw_cnf.ss_error == MFW_SS_NO_ERROR )
        {
            showOk(win);
            strncpy((char*)ss_data.edt_buf_cb_password,
                    (char*)ss_cnf->pw_cnf.ss_new_pwd,CB_PSW_LEN);
        }
        else
        {
            //showError(win, ss_cnf->pw_cnf.ss_error);
            services_info_screen(win,TxtFailed);//WUFEI APPEND
        }
        break;
    default:
        return;
    }

}
//-----------------------end of wufei modified-------------------------------------

/*******************************************************************************

 $Function:    	srv_check_CF_telephony_status

 $Description:	
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/



static UBYTE srv_check_CF_telephony_status (T_MFW_SS_CF_CNF * in_list)
{
    UBYTE i;

    for( i=0;i<in_list->ss_feature_count;i++ )
    {
        T_MFW_FEATURE * pFeature = &in_list->ss_feature_list[i];

        /*
         * first check service type
         */
        if( pFeature->ss_telecom_type EQ MFW_BST_TELE )
        {
            switch( pFeature->ss_telecom_service )
            {
            case MFW_TS_ALL_TS:        
            case MFW_TS_ALL_SPCH:
            case MFW_TS_TLPHNY:
            case MFW_TS_ALL_XCPT_SMS:
                if( pFeature->ss_status & SS_STAT_ACTIVE )
                    return CF_ACTIVE_STATUS;
                else
                    return CF_INACTIVE_STATUS;
                break;

            default:
                break;
            }
        }

        //SPR#984 - DS - Added code below for when no service type is specified.
        if( pFeature->ss_telecom_type EQ MFW_BST_UNKNOWN ) //When no service type is specfied
        {
            switch( pFeature->ss_telecom_service )
            {
            case MFW_BS_TS_UNKNOWN:
                if( pFeature->ss_status & SS_STAT_ACTIVE )
                    return CF_ACTIVE_STATUS;
                else
                    return CF_INACTIVE_STATUS;
                break;

            default:
                break;
            }
        }

    }
    return CF_UNKNOWN_STATUS;
}


/*******************************************************************************

 $Function:    	srv_check_CF_telephony_status

 $Description:	copies only the interesting parts of the call forwarding
            feature list.
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/

static UBYTE srv_copy_feature_list_cf (T_ss_feature_cf * out_list, T_MFW_SS_CF_CNF * in_list)
{
    UBYTE found_entries = 0;
    UBYTE i;

    {
        char temp[50];

        sprintf(temp,"ss_feature_count %d",in_list->ss_feature_count);
        //TRACE_FUNCTION(temp);		
    }

    for( i=0;i<in_list->ss_feature_count;i++ )
    { //MC Trying got rid of pointer arithmetic

        T_MFW_FEATURE * pFeature = &in_list->ss_feature_list[i]; //SPR#1081 - DS - Removed mem allocation. Uses assignment instead.
        T_ss_feature_cf_data * cf_data = &out_list->ss[found_entries];

        /*
         * first check teleservice
         */
        if( srv_get_service_type (&cf_data->service, pFeature->ss_telecom_type,
                                  pFeature->ss_telecom_service) )
        {
            /*
             * second set status
             */
            srv_get_status (&cf_data->status, pFeature->ss_status);

            if( (ss_cnf->cf_cnf.ss_code==SS_CF_CFU)||(ss_cnf->cf_cnf.ss_code==SS_CF_ALL) )
            {
                if( pFeature->ss_status & SS_STAT_ACTIVE )
                    iconsSetState(iconIdCallFor);
                else
                    iconsDeleteState(iconIdCallFor);
            }

            /*
             * third set forwarded to number
             */
            srv_get_forwarded_to_number ((CHAR *)cf_data->forwarded_to_number,
                                         (CHAR *)pFeature->ss_forwarded_to_number);
            {
                char temp[80];

                sprintf(temp,"ss_forwarded_to_number %s",
                        (CHAR *)pFeature->ss_forwarded_to_number);
                //TRACE_FUNCTION(temp);		
            }
            found_entries++;
        }


        //SPR#1081 - DS - Do not output number or basic service when there is more than one divert
        //				activated for a particular divert type e.g. All Calls '21'.
        //				Output "All Calls Activated" when all of Voice, Fax and Data are activated.

        if( in_list->ss_feature_count > 1 ) //More than one divert active for a divert type.
        {
            int i = 0;

            if( in_list->ss_feature_count == 3 ) //Voice, Fax and Data are all activated
                cf_data->service = TxtAllCalls;
            else //Do not display service
                cf_data->service = TxtNull; 

            for( i=0; i<15; i++ ) //Do not display number
                cf_data->forwarded_to_number[i] = 0x00; //Zero each element
        }

    }

    /*
     * return the number of interesting entries
     */
    return found_entries;
}


/*******************************************************************************

 $Function:    	srv_get_forwarded_to_number

 $Description:	sets the forwarded to number if available.
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/



static void srv_get_forwarded_to_number ( char * textString,
                                          char * forwarded_to_number)
{
    //TRACE_FUNCTION("srv_get_forwarded_to_number");

    memset (textString, 0, 16);
    strncpy (textString, forwarded_to_number, 15);
}


/*******************************************************************************

 $Function:    	srv_get_service_type

 $Description:	checks if the service is interesting or not.
            
 $Returns:		

 $Arguments:	
 
 $History:
 //SPR#0776 - DS - Added default value for textId. Changed references from TxtNotImplemented
                    to TxtNull.
*******************************************************************************/


static UBYTE srv_get_service_type ( USHORT * textId,
                                    UBYTE ss_telecom_type, UBYTE ss_telecom_service)
{
    //TRACE_FUNCTION("srv_get_service_type");
    *textId = TxtNull; //Set to TxtNull in case no match found below.

    switch( ss_telecom_type )
    {
    case MFW_BST_UNKNOWN:
        break;

    case MFW_BST_TELE:
        switch( ss_telecom_service )
        {
        case MFW_TS_ALL_TS:
            *textId = TxtAllCalls;
            return TRUE;

        case MFW_TS_ALL_SPCH:       /* All speech transmission services */
        case MFW_TS_TLPHNY:         /* telephony                      */
        case MFW_TS_PLMN1: /*MC, this is returned for auxiliary telephony status, 742*/
            *textId = TxtVoice;
            return TRUE;

        case MFW_TS_ALL_XCPT_SMS:
            *textId = TxtNull;
            return TRUE;

        case MFW_TS_ALL_DATA:
            *textId = TxtData;
            return TRUE;

        case MFW_TS_ALL_FAX:
            *textId = TxtFax;
            return TRUE;
        }

        break;

    case MFW_BST_BEARER:
        switch( ss_telecom_service )
        {
        case MFW_BS_ALL_BS:
            *textId = TxtData; //SPR#933 - DS - Changed TxtNull to TxtData.
            return TRUE;
        case MFW_BS_ALL_DATA_CDA: //SPR#933 - DS - Added so MMI displays correct info to user.
            *textId = TxtData;
            return TRUE;

            /* SPR - DS - Fix for FTA 31.2.1.3 DO NOT REMOVE
             * MFW_BS_xxx added to synch with ACI
             */
        case MFW_BS_CDA_300:        /* data CDA  300 bps              */
        case MFW_BS_CDA_1200:        /* data CDA 1200 bps              */
        case MFW_BS_CDA_1200_75:        /* data CDA 1200/75 bps           */
        case MFW_BS_CDA_2400:        /* data CDA 2400 bps              */
        case MFW_BS_CDA_4800:        /* data CDA 4800 bps              */
        case MFW_BS_CDA_9600:        /* data CDA 9600 bps              */
        case MFW_BS_ALL_DATA_CDS:        /* all data CDS services          */
        case MFW_BS_CDS_1200:        /* data CDS 1200 bps              */
        case MFW_BS_CDS_2400:        /* data CDS 2400 bps              */
        case MFW_BS_CDS_4800:        /* data CDS 4800 bps              */
        case MFW_BS_CDS_9600:        /* data CDS 9600 bps              */
        case MFW_BS_ALL_DATA_PAD:        /* all data PAD services          */
        case MFW_BS_PAD_300:        /* data PAD  300 bps              */
        case MFW_BS_PAD_1200:        /* data PAD 1200 bps              */
        case MFW_BS_PAD_1200_75:        /* data PAD 1200/75 bps           */
        case MFW_BS_PAD_2400:        /* data PAD 2400 bps              */
        case MFW_BS_PAD_4800:        /* data PAD 4800 bps              */
        case MFW_BS_PAD_9600:        /* data PAD 9600 bps              */
        case MFW_BS_ALL_DATA_PDS:        /* all data PDS services          */
        case MFW_BS_PDS_2400:        /* data PDS 2400 bps              */
        case MFW_BS_PDS_4800:        /* data PDS 4800 bps              */
        case MFW_BS_PDS_9600:        /* data PDS 9600 bps              */
        case MFW_BS_SPCH_ALT_CDA:        /* all data CDA alter. speech     */
        case MFW_BS_SPCH_ALT_CDS:        /* all data CDS alter. speech     */
        case MFW_BS_SPCH_FLD_CDA:        /* all data speech followed CDA   */
        case MFW_BS_SPCH_FLD_CDS:        /* all data speech followed CDA   */
        case MFW_BS_ALL_DC_ASYN:        /* all data circuit asynchronous  */
        case MFW_BS_ALL_ASYN:        /* all asynchronous services      */
        case MFW_BS_ALL_DC_SYN:        /* all data circuit synchronous   */
        case MFW_BS_ALL_SYN:        /* all synchronous services       */ 
            *textId = TxtData;
            return TRUE;
        default:
            break;
        }
        break;
    }

    return FALSE;
}

/*******************************************************************************

 $Function:    	srv_get_status

 $Description:	
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/


static void srv_get_status (USHORT *textId, UBYTE pStatus)
{
    //TRACE_FUNCTION("srv_get_status");

    if( pStatus & SS_STAT_ACTIVE )    // handles also the case of invalid status
        *textId = TxtActivated;
    else
        *textId = TxtDeActivated;
}


/*******************************************************************************

 $Function:    	srv_copy_feature_list_cw

 $Description:	 copies only the interesting parts of the call waiting
            service list.
            
 $Returns:		

 $Arguments:	
 
*******************************************************************************/

static UBYTE srv_copy_feature_list_cw (T_ss_feature_cw * out_list, T_MFW_SS_CW_CNF * in_list)
{
    UBYTE found_entries = 0;
    UBYTE i;

    for( i=0;i<in_list->ss_service_count;i++ )
    {
        T_MFW_SRV_GROUP      * pFeature = &in_list->ss_service_list[i];
        T_ss_feature_cw_data * cw_data = &out_list->ss[found_entries];

        /*
         * first check teleservice
         */
        if( srv_get_service_type (&cw_data->service, pFeature->ss_telecom_type,
                                  pFeature->ss_telecom_service) )
        {
            /*
             * second set status
             */
            srv_get_status (&out_list->status, in_list->ss_status);
            found_entries++;
        }
    }

    /*
     * return the number of interesting entries
     */
    return found_entries;
}

/*******************************************************************************

 $Function:    	srv_copy_feature_list_cb

 $Description:	
            
 $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -