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

📄 mmiservices.c

📁 GSM手机设计软件代码
💻 C
📖 第 1 页 / 共 5 页
字号:
 $Function:    	srv_get_status

 $Description:	
            
 $Returns:		

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


static void srv_get_status (USHORT *textId, UBYTE pStatus)
{char debug[40];
  TRACE_FUNCTION("srv_get_status");
	sprintf(debug, "Call Forwarding status: %d", pStatus);
	TRACE_FUNCTION(debug);
  if  (pStatus & SS_STAT_ACTIVE)    // handles also the case of invalid status
    *textId = TxtActivated;
  /* Marcus: Issue 1652: 03/02/2003: Start */
  else if  (pStatus & SS_STAT_PROVISIONED)
    *textId = TxtProvisioned;
  /* Marcus: Issue 1652: 03/02/2003: End */
  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:	
            
 $Returns:		

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

static UBYTE srv_copy_feature_list_cb (T_ss_feature_cb * out_list, T_MFW_SS_CB_CNF * in_list)
{
  UBYTE found_entries = 0;
  UBYTE i;

  USHORT textId;

  /*
   * SPR #1878 NDH - Determine which text is to be displayed depending on what request
   *                was initially sent.
   */
  switch(in_list->ss_category)
  {
  	case SS_REGISTRATION:
  	case SS_ACTIVATION:
  	case SS_INTERROGATION:
      /*
       * Interrogation returns only those services which are active
       */
  		textId = TxtActivated;
  		break;

  	case SS_ERASURE:
  	case SS_DEACTIVATION:
  		textId = TxtDeActivated;
  		break;
  }

  for (i=0;i<in_list->ss_telecom_count;i++)
  {
    T_MFW_TELECOM * pFeature = &in_list->ss_telecom_list[i];
    T_ss_feature_cb_data * cb_data = &out_list->ss[found_entries];

    /*
     * first check teleservice
     */
    if (srv_get_service_type (&cb_data->service, pFeature->ss_telecom_type,
                              pFeature->ss_telecom_service))
    {
      cb_data->status = textId;
      found_entries++;
    }
  }

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



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

 $Function:    	services_info_cb

 $Description:	Callback function from information dialog.
            
 $Returns:		

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



static int services_info_cb(T_MFW_HND win, USHORT identifier, UBYTE reason)
{

//  T_DISPLAY_DATA   display_info;
    UBYTE PWD;

    char buf[40];
    sprintf (buf, "Service Info CB %d", win);
    TRACE_FUNCTION (buf);

  ss_data.info_wait = 0;
  ss_data.info_win = 0;


  /*
   * Who has initiated the information screen
   */
  switch (identifier)
  {
    case SS_WAIT:

    	break;
    case ServicesOk:
    case ServicesFailed:
    case ServicesCheckCLI_OK:
    case ServicesCheckCW_OK:
    case ServicesIMEI_OK:
    case ServicesError:
   	case ServicesUSSD_CNF_OK:
#if 0
    case ServicesUSSDAlreadyFull:   /* already full message screen */
#endif
    case ServicesCFU_OK:
    case ServicesCB_OK:

    case E_SS_NOTIFY:
    case E_SS_IMEI:   /* present IMEI */
    case E_SS_CLI_CNF:
    case E_SS_USSD_CNF:
      switch (reason)
      {
        case INFO_TIMEOUT:
          /* info dialog timed out, where to now? */
          /* no break; */
        case INFO_KCD_HUP:
          /* clear key in info dialog, where to now? */
          /* no break;*/
        case INFO_KCD_LEFT:
          /* left soft key in info dialog, where to now? */
          /* no break;*/
        case INFO_KCD_RIGHT:
          /* right soft key in info dialog, where to now? */
            services_destroy(win);
          break;
      }
      break;

    case E_SS_CB_CNF:
      {
        T_MFW_WIN * win_data;
        T_ss      * data;

        win_data = ((T_MFW_HDR *)win)->data;
        data     = (T_ss *)win_data->user;

        switch (reason)
        {
          case INFO_TIMEOUT:
            /*
             * not started, so it is not possible
             */
            break;
          case INFO_KCD_HUP:
          case INFO_KCD_LEFT:
            /*
             * stop the display of the results
             */
            if (data->mfw_ss_cb)
            {
              FREE_MEMORY ((void *)data->mfw_ss_cb, sizeof (T_ss_feature_cb));
              data->mfw_ss_cb = NULL;
              data->current_feature = 0;
              {
                char buf[40];
                sprintf (buf, "SS_data.win %d %d",ss_data.win, data);
                TRACE_FUNCTION (buf);
              }
            }
            break;

          case INFO_KCD_RIGHT:
            if ((data->mfw_ss_cb) && (data->max_feature > 1))
            {
              if (data->max_feature > data->current_feature + 1)
                data->current_feature++;
              else
              	data->current_feature = 0;
              
              showCBStatus (win, data);
            }
            break;

          default:
            break;
        }
      }
	break;

    case E_SS_CW_CNF:
      {
        T_MFW_WIN * win_data;
        T_ss      * data;

        win_data = ((T_MFW_HDR *)win)->data;
        data     = (T_ss *)win_data->user;

        switch (reason)
        {
          case INFO_TIMEOUT:
            /*
             * not started, so it is not possible
             */
            break;
          case INFO_KCD_HUP:
          case INFO_KCD_LEFT:
            /*
             * stop the display of the results
             */
            if (data->mfw_ss_cw)
            {
              FREE_MEMORY ((void *)data->mfw_ss_cw, sizeof (T_ss_feature_cw));
              data->mfw_ss_cw = NULL;
              data->current_feature = 0;
            }
            break;

          case INFO_KCD_RIGHT:
            if ((data->mfw_ss_cw) && (data->max_feature > 1))
            {
              if (data->max_feature > data->current_feature + 1)
                data->current_feature++;
              else
              	data->current_feature = 0;
              
              showCWStatus (win, data);
            }
            break;

          default:
            break;
        }
      }
	break;
    case E_SS_CF_CNF:
      {
        T_MFW_WIN * win_data;
        T_ss      * data;

        win_data = ((T_MFW_HDR *)win)->data;
        data     = (T_ss *)win_data->user;

        switch (reason)
        {
          case INFO_TIMEOUT:
            /*
             * not started, so it is not possible
             */
            break;
          case INFO_KCD_HUP:
          case INFO_KCD_LEFT:
            /*
             * stop the display of the results
             */
            if (data->mfw_ss_cf)
            {
              FREE_MEMORY ((void *)data->mfw_ss_cf, sizeof (T_ss_feature_cf));
              data->mfw_ss_cf = NULL;
              data->current_feature = 0;
            }
            break;

          case INFO_KCD_RIGHT:
            if ((data->mfw_ss_cf) && (data->max_feature > 1))
            {
              if (data->max_feature > data->current_feature + 1)
                data->current_feature++;
              else
              	data->current_feature = 0;
              
              showCFStatus (win, data);
            }
            break;

          default:
            break;
        }
        break;
      }
    case ServicesUSSD_REQ_OK:
      switch (reason)
      {
        case INFO_KCD_HUP:
          /* clear key in info dialog, where to now? */
         // no break;
        case INFO_TIMEOUT:
          /* info dialog timed out, where to now? */
         // no break;
        case INFO_KCD_RIGHT:
          /* right soft key in info dialog, where to now?
             all above mean cancelled so go back to whatever was before (idle?)*/
            services_destroy(win);
            break;

        case INFO_KCD_LEFT:
          /* left soft key in info dialog, where to now?
            This means confirm, so now go to USSD entry screen */
             SEND_EVENT(ss_data.win,ServicesUSSDEnter,0,0);
             break;
        default:
            break;
      }
      break;

	case ServicesUSSDEnter:
			{
			T_MFW_SS_PARA ussd_data;


		    ussd_data.ussd_info.len = strlen((char*)ss_data.edt_buf_number);
  		 	ussd_data.ussd_info.dcs = ss_data.dcs;
  			ussd_data.ussd_info.error = MFW_SS_NO_ERROR;

			memcpy(ussd_data.ussd_info.ussd, ss_data.edt_buf_number, ussd_data.ussd_info.len);


			sendUSSD (&ussd_data);
		}
		break;

  }
  return 1;
}


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

 $Function:    	servicesNumbers

 $Description:	
            
 $Returns:		

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


int servicesNumbers(MfwMnu* m, MfwMnuItem* i){
    CFAction = CFActivate;
	servicesDoOtherNumber();	
}


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

 $Function:    	servicesInfraRed

 $Description:	
            
 $Returns:		

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


int servicesInfraRed(void){return 11;}


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

 $Function:    	servicesExec

 $Description:	
            
 $Returns:		

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

void servicesExec (int reason, MmiState next)
{
    UBYTE PWD;
    T_MFW_HND win = mfw_parent(mfw_header());
    T_MFW_WIN     * win_data = ((T_MFW_HDR *)win)->data;

    nextState = next;


	if (!winIsFocussed(win))
		lastFocus = winFocus(win);

	servicesState = reason;						/* save reason now !! */

	switch (reason)
    {
	case ServicesIdle:							/* giving back control to last module*/
		winFocus(lastFocus);
		winShow(lastFocus);
		lastFocus = 0;
		return;									/* return from module */

	case ServicesOk:
		TRACE_FUNCTION("Service OK");
        winShow(win);
        timStart(times);  /* start timer to go back in the submenu */
		break;

	case ServicesFailed:
		TRACE_FUNCTION("Service Failed");
        winShow(win);
        timStart(times);  /* start timer to go back in the submenu */
		break;

   	case ServicesError:
		TRACE_FUNCTION("Service Error");
        winShow(win);
        timStart(times);  /* start timer to go back in the submenu */
		break;

    case ServicesExecCF:          /* all Call forwarding from menu */
    case ServicesActCF:             /* show "Please Wait" screen/animation */
    case ServicesDeactCF:
    case ServicesCheckCF:
	case ServicesActCW:
	case ServicesDeactCW:
	case ServicesCheckCW:
	case ServicesActCLIR:

⌨️ 快捷键说明

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