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

📄 atp5cmd.c

📁 标准ATP命令的处理
💻 C
📖 第 1 页 / 共 5 页
字号:
/* Supplementary Services is not supported in Rec 7.07 V5.5.0 *//*         atp5_112SendSS(p_AppiCmd); */        return ATP_ERROR;/*         break; *//* otherwise: it's a call */      default :      /* release buffer */        MC_UPV_FREE_BUFFER(p_AppiCmd);      /* Set up the call */        if (atp5_100SetUpCall()!=ATP_OK)/* if an error occured */          return ATP_ERROR;        break;    }  }  else  {    pl_Temp = &a_atp_Result[0];    /* Add <CR><LF> at the end of the string */    MC_ATP_CR_LF(pl_Temp);      #ifdef __unix    MC_ATP_SEND_TEXT("1 2 3 4 5 6 7 8 9 0 * # + A B C D P T W , @ !",pl_Temp);#else    pl_Temp += upv0_15AsciiToGsmFormat( "1 2 3 4 5 6 7 8 9 0 * # + A B C D P T W , \x80 !"                                        , pl_Temp                                        , sizeof("1 2 3 4 5 6 7 8 9 0 * # + A B C D P T W , @ !") );#endif/* Add <CR><LF> at the end of the string */    MC_ATP_CR_LF(pl_Temp);      /* add a null character at the end of the string */    pl_Temp[0]= '\0';/* send the message to MIS */    atp3_200SendDataReq((u8 *)pl_Temp-(u8 *)a_atp_Result );  }    /* return OK result code */  return ATP_OK;}/*P(***************************************************************************  * Procedure name : atp5_2ACommand * Object : Execute the A command (Answer) *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: return the result code. * * Used variables    : * ------------------- *   pl_AppiAnswerReq		: Message to send to SPC * * Used procedures   : * ------------------- *   MC_RTK_GET_MEMORY		: Get memory allocation *   MC_ATP_SEND_MSG_TO_PROCESS	: Send FSM message *   MC_RTK_STOP_TIMER		: stop timer *   upv3_71ResetSubAddress	: Reset the subaddress *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 2u8 atp5_2ACommand(void){  t_spc_AppiAnswerReq * pl_AppiAnswerReq ;#ifdef ATP_ATA_VOICE_FTR  t_atp_MapiAcceptIncomingSpeechCall *pl_MsgAcceptSpeechCall;#if defined (PROCESS_EDP)  /*  t_edp_AppiKeyPressedInd *pl_MsgKeyPressedInd;  t_edp_AppiKeyInfoInd *pl_MsgKeyInfoInd;  */#else  /* PROCESS_EDP */  /*  t_hkbd_KeyPressedInd  *pl_MsgKeyPressedInd;  t_hkbd_KeyInfoInd  *pl_MsgKeyInfoInd;  */#endif /* PROCESS_EDP */#endif /* ATP_ATA_VOICE_FTR */  /* If a MT call is awaiting */  if( MC_ATP_IS_MT_WAITING() )  {    /* make sure the phone number string is null-terminated */     p_atp_PhoneNumber->s_PhoneNumber.a_PhoneNumber[UPV_MAX_LENGTH_PHONE_NUM - 1] = '\x0';   /* Use calling number information saved in atp1_4IncomingCall */   if ( (p_atp_PhoneNumber->v_PresentationIndicator == SPC_PI_PRESENTATION_RESTRICTED) ||        (p_atp_PhoneNumber->v_PresentationIndicator == SPC_PI_NUMBER_NOT_AVAILABLE))   {     strcpy(p_atp_PhoneNumber->s_PhoneNumber.a_PhoneNumber,"");   }   /* The incoming call is accepted by the PC and we have the CallId: it is time to tell LOOK about it */   atp5_127SendMapiAtpComInfoInd(v_atp_CurrentCallId, 				 ATP_COM_TYPE_CS,				 p_atp_PhoneNumber->s_PhoneNumber.a_PhoneNumber);   /* Free calling phone number value */   MC_UPV_FREE_BUFFER(p_atp_PhoneNumber);    pl_AppiAnswerReq =(t_spc_AppiAnswerReq*)MC_RTK_GET_MEMORY(sizeof(t_spc_AppiAnswerReq));/* Stop the ring timer */    atp1_147StopRingTimer();#if defined( __SUB_ADDRESS__ )/* reset the called subadress */    upv3_71ResetSubAddress( &pl_AppiAnswerReq->s_ConnectedSubAdr );#endif /* __SUB_ADDRESS__ */ /* Set call Id*/    pl_AppiAnswerReq->v_CallId = v_atp_CurrentCallId;/* Send the message */    MC_ATP_SEND_MSG_BROADCAST(PROCESS_SPC,0, APPI_CALL_ANSWER_REQ, \                    pl_AppiAnswerReq, ATP_BROADCAST );/* Set return state SPV_WAIT */    v_atp_ReturnState = ATP_SPV_WAIT;/* Set abort variable with call info */    v_atp_AbortCmd=ATP_ABORT_CALL_CMD;  /* Start the connection completion timer */    MC_RTK_PROCESS_START_TIMER(ATP_COMPLETION_TIMER_ID, \                               MC_DIN_SECONDS_TO_TICK( *MC_PRM_READ_BLOCK_REQ(HEE_DATA_S7) ));/* return OK result code */    return ATP_OK;  }#ifdef ATP_ATA_VOICE_FTR  /* if we are currently tracking a speech call */  if (v_atp_CurrentSpeechCallId != UNDEFINED)  {/* Stop the ring timer */    atp1_147StopRingTimer();    /* instruct MMI to accept the call */    /* this is the clean way to do things.Must take precedence as Soon as MMI CR is implemented */    pl_MsgAcceptSpeechCall = (t_atp_MapiAcceptIncomingSpeechCall *)MC_RTK_GET_MEMORY(sizeof(t_atp_MapiAcceptIncomingSpeechCall));    pl_MsgAcceptSpeechCall->v_CallId = v_atp_CurrentSpeechCallId;    MC_ATP_SEND_MSG_TO_PROCESS( PROCESS_ATP,0,                                PROCESS_MMI, 0,                                 MAPI_ATP_ACCEPT_INCOMING_SPEECH_CALL_IND,                                (t_MsgHeader *) pl_MsgAcceptSpeechCall);        /* temporary solution, to be trashed as soon as MMI can process MAPI_ATP_ACCEPT_INCOMING_SPEECH_CALL_IND */#if defined(PROCESS_EDP)    /*    pl_MsgKeyPressedInd = (t_edp_AppiKeyPressedInd *)MC_RTK_GET_MEMORY(sizeof(t_edp_AppiKeyPressedInd));    pl_MsgKeyPressedInd->v_KeyInfo    = EDP_KEY_END;    pl_MsgKeyPressedInd->v_DigitValue = EDP_NO_DIGIT;    MC_ATP_SEND_MSG_TO_PROCESS( PROCESS_ATP,0,                                PROCESS_MMI, 0,                                 APPI_EDP_KEY_PRESSED_IND,                                (t_MsgHeader *) pl_MsgKeyPressedInd);    pl_MsgKeyInfoInd = (t_edp_AppiKeyInfoInd *)MC_RTK_GET_MEMORY(sizeof(t_edp_AppiKeyInfoInd));    pl_MsgKeyInfoInd->v_KeyInfo     = EDP_KEY_END;    pl_MsgKeyInfoInd->v_DigitValue  = EDP_NO_DIGIT;    pl_MsgKeyInfoInd->v_TypeOfPress = EDP_SHORT_PRESS;    MC_ATP_SEND_MSG_TO_PROCESS( PROCESS_ATP,0,                                PROCESS_MMI, 0,                                APPI_EDP_KEY_INFO_IND,                                (t_MsgHeader *)pl_MsgKeyInfoInd );    */#else /* PROCESS_EDP */    /*    pl_MsgKeyPressedInd = (t_hkbd_KeyPressedInd *)MC_RTK_GET_MEMORY(sizeof(t_hkbd_KeyPressedInd));    pl_MsgKeyPressedInd->v_KeyInfo    = HKBD_KEY_END;    pl_MsgKeyPressedInd->v_DigitValue = HKBD_NO_DIGIT;    MC_ATP_SEND_MSG_TO_PROCESS( PROCESS_ATP,0,                                PROCESS_MMI, 0,                                 MOBI_HKBD_KEY_PRESSED_IND,                                (t_MsgHeader *)pl_MsgKeyPressedInd );    pl_MsgKeyInfoInd = (t_hkbd_KeyInfoInd *)MC_RTK_GET_MEMORY(sizeof(t_hkbd_KeyInfoInd));    pl_MsgKeyInfoInd->v_KeyInfo     = HKBD_KEY_END;    pl_MsgKeyInfoInd->v_DigitValue  = HKBD_NO_DIGIT;    pl_MsgKeyInfoInd->v_TypeOfPress = HKBD_SHORT_PRESS;    MC_ATP_SEND_MSG_TO_PROCESS( PROCESS_ATP,0,                                PROCESS_MMI, 0,                                MOBI_HKBD_KEY_INFO_IND,                                (t_MsgHeader *)pl_MsgKeyInfoInd );    */#endif /* PROCESS_EDP *//* Set return state to BLOCKED */    v_atp_ReturnState = ATP_BLOCKED;/* return OK result code */    return ATP_OK;  }#endif /* ATP_ATA_VOICE_FTR *//* return ERROR */  return ATP_ERROR;}/*P(***************************************************************************  * Procedure name : atp5_3ECommand * Object :  Execute the E command (Echo) *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * -------------------*   u8 : return the result code. * * Used variables    : * ------------------- *   vl_Value			: Parameter value * * Used procedures   : * ------------------- *   atp5_109SetIfBoolean	: Set paramater to Enable or Disable if correct *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 3u8 atp5_3ECommand(void){  u8 vl_Value;  t_hee_DataBitFields1 *pl_hee_DataBitFields1    = (t_hee_DataBitFields1 *)MC_PRM_READ_BLOCK_REQ(HEE_DATA_BITFIELDS1);    vl_Value = atp5_109SetIfBoolean();  if (vl_Value == UNDEFINED)    return ATP_ERROR;     pl_hee_DataBitFields1->v_Echo = vl_Value;  MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_BITFIELDS1,                                (u8 *)pl_hee_DataBitFields1 );  return ATP_OK;}/*P(***************************************************************************  * Procedure name : atp5_4SetCRLPParameter * Object : Execute +CRLP=<param> command *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: Result code * * Used variables    : * ------------------- *   i				: Current index *   pl_Msg			: Message to send *   s_StatusReq		: temporary buffer * * Used procedures   : * ------------------- *   MC_RTK_GET_MEMORY		: Get memory allocation *   MC_ATP_SEND_MSG_TO_PROCESS	: Send FSM message *   atoi			: transform a string into a number *   sizeof			: Get the size of a structure *   memcpy			: copy n Byte from one memory to another *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 4u8  atp5_4SetCRLPParameter(void){  u32 i;  u8 * vp_Msg;  t_dsm_StatusReq s_StatusReq;  /* allocate memory for the message */  vp_Msg=(u8*)MC_RTK_GET_MEMORY(sizeof(t_MsgHeader)+sizeof(t_dsm_StatusReq));  /* Fill status type */  s_StatusReq.v_StatusType = DSM_STATUS_CRLP;  /* Fill type to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_Type = DSM_STATUS_NO_VALUE;  /* Fill version to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_Version = DSM_STATUS_NO_VALUE;  /* Fill iws to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_MSToIWF = DSM_STATUS_NO_VALUE;  /* Fill mws to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_IWFToMS = DSM_STATUS_NO_VALUE;  /* Fill T1 to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_T1 = DSM_STATUS_NO_VALUE;  /* Fill N2 to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_N2 = DSM_STATUS_NO_VALUE;  /* Fill T2 to unchanged */  s_StatusReq.u_StatusUnion.s_Xid.v_T2 = DSM_STATUS_NO_VALUE;  /* for each received param */  for (i =0; i<s_atp_CurrentCommandInfo.v_NumberOfParam; i++)  { /* if it length is not null */    if (s_atp_CurrentCommandInfo.a_ParamList[i].v_ParamLength)/*depending on the param */      switch (i)      {/*iws*/	case 0:/* if the value is correct */	  if (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) <= DSM_GSM_XID_IWF_TO_MS_MAX)          {/* fill the value in the message */	    s_StatusReq.u_StatusUnion.s_Xid.v_IWFToMS  = atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param);            MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_CRLP_IWS,                                          (u8 *)&s_StatusReq.u_StatusUnion.s_Xid.v_IWFToMS );          }	  else /* return an error */	    return ATP_ERROR;	  break;/* mws */	case 1:/* if the value is correct */	  if (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) <= DSM_GSM_XID_MS_TO_IWF_MAX)          {/* fill the value in the message */            s_StatusReq.u_StatusUnion.s_Xid.v_MSToIWF = atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param);            MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_CRLP_MWS,                                          (u8 *)&s_StatusReq.u_StatusUnion.s_Xid.v_MSToIWF );          }	  else /* return an error */	    return ATP_ERROR;	  break;	case 2:/* if the value is correct */

⌨️ 快捷键说明

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