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

📄 mmicall.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:

        break;
    case E_CM_MO_RES:
        MMI_TRACE_EVENT(("wangyan: callCmEvent -- E_CM_MO_RES"));
        {
            T_MFW_PHB_ENTRY phb_entry;
            T_MFW_CM_STATUS outgoing_call_data;
            T_MFW_CM_AOC_INFO   aoc_info;
            char * v_Number = NULL;
            CALLRINGOFF=0;
            memset(&outgoing_call_data, 0, sizeof(T_MFW_CM_STATUS));
            cid = (SHORT*)para;

            // this is used for the "last charge"
            cm_get_aoc_value(CM_AOC_ACM, &aoc_info);

            acm_last_call = aoc_info.acm;


            TRACE_EVENT ("E_CM_MO_RES");
            /*2004/04/05,talcon delete*/
            //sprintf(stringTrace,"Call Id %d",*cid);
            //TRACE_EVENT(stringTrace);

            /* If we have no active call window, create one */
            if( !call_data.win )
            {
                call_create(0);
            }
            MMI_TRACE_EVENT(("wangyan: callCmEvent --call_data.win=%d",call_data.win));
            if( call_data.calls.numCalls == 0 )
                SEND_EVENT(call_data.win,CALL_INIT,0,0);

            /* set the outcall ID */
            // rsa done previously (in SAT) or done later (see below):

            call_data.outCall = *cid;
            call_data.call_direction = OUTGOING;


            /* end any locally generated tones, this is for late assignment
             * and should be managed within ACI
             */
            if( LocalRing )
            {
            }

            if( call_SATCall == TRUE )
            {
                TRACE_EVENT ("SAT_CALL_DIALOG");

                //zy 2003-04-16 checkin Marcus: Issue 1057: 21/01/2003: Removed: call_SATCall = FALSE;
                /* create the outgoing call dialog */
                getCallStatus(*cid, &outgoing_call_data);
                /*zy 2003-04-16 display from "cid",not from satstructure
                set local pointer to number from call table */
                v_Number = (char*)(outgoing_call_data.number);
                memcpy(call_data.phbNameNumber,v_Number, sizeof(call_data.phbNameNumber)-1);
                call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
                call_calling_show(MMI_OUTGOING_CALL_DIALOG_SAT);
                /*end of zy 2003-04-16*/
            }
            else
            {
                TRACE_EVENT ("NORMAL_CALL_DIALOG");

                /* set the outcall ID */
                call_data.outCall = *cid;
                call_data.call_direction = OUTGOING;
                /* fill the call status information from the
    call table in MFW/ACI */
                getCallStatus(*cid, &outgoing_call_data);
                /* set local pointer to number from call
    table */
                v_Number = (char*)(outgoing_call_data.number);
                /* Check whether the dialled number appears in the phonebook and set the
                 * status information if it does
                 */
                /*
                 zy 2003-02-14 before findname add "+" if it is international number 
                 */
                if( (outgoing_call_data.ton == MFW_TON_INTERNATIONAL) && (outgoing_call_data.number[0] != '+') )
                {
                    TRACE_EVENT("International Call Required!");
                    // API - 826 - Create a buffer and a plus to the start of the buffer then add the out going number
                    strcpy(InterNat_Plus, "+");
                    strcat(InterNat_Plus, (char *)v_Number);

                    memcpy(call_data.phbNameNumber, (char*)InterNat_Plus, sizeof(call_data.phbNameNumber)-1);
                    call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
                    // This is an international number so a '+' must be added to this number.
                    // It must be Pre-pended to the number and should come after the ss string
                    // if there is one present:
                    // e.g. **21*+44121675489#
                    //JVJE                 phbk_add_plus_to_number((char*)call_data.phbNameNumber);
                    wstrcpy( (char *)v_Number,call_data.phbNameNumber);
                }
                /*
                end of zy 2003-02-14 before findname add "+" if it is international number
                */
                wstrcpy( latestOutNum,(char *)v_Number);

                // saveNumCallRecord('D',latestOutNum );  //hu binhao 2002-11-26
                // saveNumCallRecord('D',latestOutNum ,IsIngroup,SimReadyFlag,&searchPhdata); //hu binhao 2002-12-29

                if( cm_check_emergency((UBYTE*)v_Number) == TRUE )
                {
                    call_data.emergencyCall = TRUE;
                    memset(call_data.phbNameNumber,'\0',sizeof(call_data.phbNameNumber));
                    searchPhdata.GroupIndex=0xff;
                    searchPhdata.GroupingIcon=0xff;
                    searchPhdata.GroupingRing=0xff;
                    IsIngroup=0;
                    SimReadyFlag=0;
                    /*begin of zy change 2003-01-29 when emergency call need setearmode here */
                    SetEarMode();
                    SetASpk_DownLinkPGA(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].speakervolume);//wms added 01-21
                    /*end of zy change 2003-01-29*/
                }

                /* else if ( (bookFindNameInSDNPhonebook(v_Number, &phb_entry) == 1) && (phb_entry.name.len != 0) )
                 {
                     memcpy(call_data.phbNameNumber, (char*)phb_entry.name.data, sizeof(call_data.phbNameNumber)-1);
                     call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
                 }
                 else if(bookFindNameInPhonebook(v_Number, &phb_entry) == 1 && (phb_entry.name.len != 0) )
                 {
                    memcpy(call_data.phbNameNumber, (char*)phb_entry.name.data, sizeof(call_data.phbNameNumber)-1);
                    call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
                  }*/
                //else if (FindNumber((char *)v_Number, (T_FindName *)&searchPhdata))//zy 09/19 test search phb 
                else if( IsIngroup=FindCallNumber((char *)v_Number, (T_FindName *)&searchPhdata) )
                {//zy 09/19 test search phb 2002-12-29

                    wstrcpy((char *)call_data.phbNameNumber,(char *)searchPhdata.name);
		    if (sizeof(searchPhdata.name) > (CALL_NAME_LENGTH+2))
		    {
		        call_data.phbNameNumber[CALL_NAME_LENGTH+1] = '\0';//zy change 2003-04-07 make it same as phb 24
		        call_data.phbNameNumber[CALL_NAME_LENGTH+2] = '\0';
		    }
                }
                else
                {
                    memcpy(call_data.phbNameNumber,v_Number, sizeof(call_data.phbNameNumber)-1);
                    call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;

                }
                /*begin of zy change 2003-0428 make "p" number save in dialed number correct*/
                if( wstrlen(extnum) )
                {
                    strcat(latestOutNum,"p");
                    strcat(latestOutNum,extnum);
                }
                /*end of zy change 2003-04-28*/
                saveNumCallRecord('D',latestOutNum ,IsIngroup,SimReadyFlag,&searchPhdata); //hu binhao 2003-1-7

                call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;

                /* create the outgoing call dialog */
                call_calling_show(MMI_OUTGOING_CALL_DIALOG_NORMAL);
            }
        }

        break;
    case E_CM_TIMER_EVERY_SECOND:
        MMI_TRACE_EVENT(("wangyan: callCmEvent -- E_CM_TIMER_EVERY_SECOND"));
#if 0
        if( call_data.win_incoming )
        {
            if( animnum<4 )
            {
                dspl_BitBlt( callIncoming_Attr [animnum].area.px,callIncoming_Attr [animnum].area.py,
                             callIncoming_Attr [animnum].area.sx,callIncoming_Attr [animnum].area.sy,
                             callIncoming_Attr [animnum].nIcons,callIncoming_Attr [animnum].icons,0);
                animnum++;

            }
            else
                animnum=0;
        }
        if( call_data.win_calling&&CALLRINGOFF==1 )
        {
            if( animnum<4 )
            {
                dspl_BitBlt( callAlert_Attr [animnum].area.px,callAlert_Attr [animnum].area.py,
                             callAlert_Attr [animnum].area.sx,callAlert_Attr [animnum].area.sy,
                             callAlert_Attr [animnum].nIcons,callAlert_Attr [animnum].icons,0);
                animnum++;

            }
            else
                animnum=0;
        }
        if( call_data.win_calling&&CALLRINGOFF==2 )
        {
            if( animnum<4 )
            {
                dspl_BitBlt( call_Attr [animnum].area.px,call_Attr [animnum].area.py,
                             call_Attr [animnum].area.sx,call_Attr [animnum].area.sy,
                             call_Attr [animnum].nIcons,call_Attr [animnum].icons,0);
                animnum++;

            }
            else
                animnum=0;
        }
#endif
        QueryPcsyncHandsetStatus();    ////zym added for querying handset 030313
        refreshCallTimer();
        cm_get_aoc_value(CM_AOC_CCM,&call_data.aocInfo);

#if 0   //2004-03-8 Sunny removed
        // TRACE_EVENT_P1("winIsFocussed(call_data.win) %d",winIsFocussed(call_data.win));
        // if ((call_data.calls.mode == CallSingle))//&&(winIsFocussed(call_data.win)))
        if( (call_data.calls.mode == CallSingle)&&(winIsFocussed(call_data.win)||winIsFocussed(call_data.win_scratch)) )
        /*2003/12/16, wangyan modify*/
        //if ((call_data.calls.mode == CallSingle)&&(winIsFocussed(call_data.win)||winIsFocussed(call_data.win_scratch)||winIsFocussed(call_data.win_active)))
        /* 2003-03-13 when there is single call and focused at callwin or scratch win display time */
        {
            // winShow(call_data.win);zy remove needn't show all screen

            memset(line,'\0',sizeof(line));
            getTimeString(call_data.calls.time[0],(char*)line);
            //         dspl_TextOut((120-64)/2, Mmi_layout_third_line(), 0, (char *)line);/*2003/12/9, wangyan modify*/
            old_color=dspl_GetBkgColor();
            //		dspl_GetBkgColor(0x5AC7FF);
            dspl_TextOut(52, 2, 0, (char *)line);
            //			dspl_TextOut(1, STANDARD_CALL_TXT_VERTICAL-Mmi_layout_second_line(), 0, (char *)line);
            dspl_SetBkgColor(old_color);

            if( call_data.calls.time[0]<3 )
            {
                //if (melody_status==MELODY_BUSY)//wms added to avoid play melody when call begin 03-=04-07
                //	StopMelody2(oldringstr);
                StopPlayingMelody2( ); //glowing: use the yamaha api
                SetASpk_DownLinkPGA(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].speakervolume);
            }
        }//zy add only show time 2003-02-14
        else if( /*(call_data.calls.mode == CallSingle)&&(*/winIsFocussed(call_data.win_scratch) )
        {/*begin of zy change 2003-03-12
is dial a new call need show time
*/
            T_MFW_WIN      * win_data = ((T_MFW_HDR *) call_data.win_scratch)->data;
            T_call_scratchpad         * data = (T_call_scratchpad *)win_data->user;
            if( data->mode==ViewMulticallControl )
            {
                memset(line,'\0',sizeof(line));
                getTimeString(call_data.calls.time[0],(char*)line);
                if( /*FFS_flashData.*/InCallTimer == TRUE )
                    dspl_TextOut((SCREEN_SIZE_X-get_StringWidth(line)), 2, 0, (char *)line);//2004-03-8 Sunny Modify
                /*end of zy change 2003-03-12*/
            }
        }/*end of zy add for scratch win has time update*/

        else //2004-03-8 Sunny add for displaying the time.
        {
            memset(line,'\0',sizeof(line));
            getTimeString(call_data.calls.time[0],(char*)line);
            if( InCallTimer == TRUE )
                dspl_TextOut((SCREEN_SIZE_X-get_StringWidth(line)), 2, 0, (char *)line);//2004-03-8 Sunny Modify
        }//2004-03-8 Sunny add for displaying the time.end
#endif

        //2004-03-08 Sunny add for displaying the time.
        if( (call_data.calls.mode == CallSingle)&&(winIsFocussed(call_data.win)||winIsFocussed(call_data.win_scratch)) )
        {

            memset(line,'\0',sizeof(line));
            getTimeString(call_data.calls.time[0],(char*)line);
            old_color=dspl_GetBkgColor();
            dspl_TextOut(SCREEN_SIZE_X-get_StringWidth(line), 2, 0, (char *)line);
            dspl_SetBkgColor(old_color);

            if( call_data.calls.time[0]<3 )
            {
                StopPlayingMelody2( ); //glowing: use the yamaha api
                SetASpk_DownLinkPGA(FlashEnvironmentData.EnviroProfile[FlashEnvironmentData.CurrentEnv].speakervolume);
            }
        }
        //2004-03-08 Sunny add for displaying the time.end

        /*
        In field test, need to connect trace line, the earphone check will disconnect the call, need more check
        */
        /*beging of zy add 01-23-2003 for led incomingcall*/
        if( !HallStatus()&&IncallLedisRun )
        {
            if( IncallLedControl==TRUE )
            {
                IncallLed(TRUE);
                IncallLedControl=FALSE;
            }
            else
            {
                IncallLed(FALSE);
                IncallLedControl=TRUE;
            }
        }
        if( HallStatus()&&IncallLedisRun )
        {
            stopIncallLed();/* zy add 01-23-2003 for led incomingcall stop*/
        }
        /*end of zy add 01-23-2003 for led incomingcall*/

        /*begin of zy for handset mode 12/11*/
        call_data.isHandSetMode=IsHandsetPlugin();
        //      zgzTraceDataFunc("EVERYSECOND isHandSetMode", (unsigned short) call_data.isHandSetMode);
        if( call_data.isHandSetMode==1 )
        {//zy 12/12 only value is 1,the handset is on
            TRACE_EVENT("handset is plugin");
            if( call_data.handSetOldStatus==0&&!call_data.win_incoming&&melody_status==MELODY_IDLE )
            {//zy 2003-03-03 if there is any sound playing we couldn't set handset mode
                SetHandsetMode();
                call_data.handSetOldStatus=1;
            }
            /* else
               call_data.handSetOldStatus=0;zy move here otherewise there will wrong status*/
#ifdef _M188_
            if( IsHandsetKey() )
#else
            if( IsHeadsetKey() )
#endif
            {
                //glowing,2004-04-12, fix the bug that can't disconnect emergency call
                if( call_data.emergencyCall == 1 )
                {
                    cm_disconnect(call_data.outCall);

                    if( !call_data.calls.num

⌨️ 快捷键说明

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