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

📄 atp5cmd.c

📁 标准ATP命令的处理
💻 C
📖 第 1 页 / 共 5 页
字号:
	  if (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) >= DSM_GSM_XID_T1_MIN              && atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) <= DSM_GSM_XID_T1_MAX)          {/* fill the value in the message */            s_StatusReq.u_StatusUnion.s_Xid.v_T1 = atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param);            MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_CRLP_T1,                                          (u8 *)&s_StatusReq.u_StatusUnion.s_Xid.v_T1 );          }	  else /* return an error */	    return ATP_ERROR;	  break;	case 3:/* if the value is correct */	  if( atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) >= DSM_GSM_XID_N2_MIN              && atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) <= DSM_GSM_XID_N2_MAX )          {/* fill the value in the message */	    s_StatusReq.u_StatusUnion.s_Xid.v_N2 = atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param);            MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_CRLP_N2,                                          (u8 *)&s_StatusReq.u_StatusUnion.s_Xid.v_N2 );          }	  else /* return an error */	    return ATP_ERROR;	  break;	case 4:/* if the value isn't correct */	  if (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[i].p_Param) > DSM_GSM_XID_VERSION_MAX)	    /* Set additional result ot param invalid *//* 	    v_atp_AddInfo = ATP_ER_PARAM_INVALID; *//* return an error */          return ATP_ERROR;	default:	  break;      }  }/* copy temporary buffer into the structure*/  memcpy(vp_Msg+sizeof(t_MsgHeader),&s_StatusReq,sizeof(t_dsm_StatusReq));/*send the message to DSM module*/  MC_ATP_SEND_MSG_TO_PROCESS(PROCESS_ATP,0,PROCESS_DSM,0,MOBI_DSM_STATUS_REQ,(t_MsgHeader*)vp_Msg);/* set return state to idle */  v_atp_ReturnState = ATP_IDLE;/* return OK result code */  return ATP_OK;  }/*P(***************************************************************************  * Procedure name : atp5_5HCommand * Object :  Execute the H command (Hangup) *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: return the result code. * * Used variables    : * ------------------- *   None * * Used procedures   : * ------------------- *   atp5_108DisconnectCall	: Disconnect current call *   atoi			: transform a string into a number *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 5u8 atp5_5HCommand(void){/*   t_OperationDescriptor *pl_CurrentState; *//* #if defined (PROCESS_EDP) *//*   t_edp_AppiKeyPressedInd *pl_MsgKeyPressedInd; *//*   t_edp_AppiKeyInfoInd *pl_MsgKeyInfoInd; *//* #else *//*   t_hkbd_KeyPressedInd  *pl_MsgKeyPressedInd; *//*   t_hkbd_KeyInfoInd  *pl_MsgKeyInfoInd; *//* #endif *//* if there'a parameter and it is not correct, return an error result code */  if ( s_atp_CurrentCommandInfo.v_NumberOfParam &&        (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param) != 0))    return ATP_ERROR;#ifdef GPRS_FTR  /* +CHUP command only hangs up GSM calls */  if (s_atp_CurrentCommandInfo.v_CurrentCommand != AT_CHUP)  {    if (atp5_133CloseAllContexts(ATP_PDP_H_COMMAND) > 0)	    {      /* There were opened PDP contexts and therefore a closing action is running*/      v_atp_ReturnState = ATP_SPV_WAIT;         /* As there was GPRS activity, there can be no CS com : skip the rest of the function */      return ATP_OK;    }  }#endif /* GPRS_FTR */  /* if there are active GSM calls, start disconnecting them (and set return state accordingly) */  atp5_137DisconnectNextCSCall(NULL);/* OK result effective only if previous function has not selected wait state */  return ATP_OK;}/*P(***************************************************************************  * Procedure name : atp5_6SetIPRParameter * Object : Execute +IPR=<param> Command *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: Result code * * Used variables    : * ------------------- *   vl_Rate			: Rate in value * * Used procedures   : * ------------------- *   atoi			: transform a string into a number *  atp5_107SendStatusReq	: send the status_req *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 6u8 atp5_6SetIPRParameter(void){ #ifdef GPRS_DATA_CABLE_FTR  u32	vl_Bitrate;  vl_Bitrate = strtol((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param,NULL,0);  if (vl_Bitrate != 115200)   {     v_atp_AddInfo = ATP_CME_ER_OPERATION_NOT_ALLOWED;    return ATP_ERROR;  }#else/* depending on the value of current param *//* Set the Rate*/  switch (atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param))  {    case 0:    case 2400:    case 4800:    case 9600:    case 19200:      break; /*otherwise*/    default:      /* the param is invalid *//*       v_atp_AddInfo = ATP_ER_PARAM_INVALID; */      return ATP_ERROR;  }#endif/* Return OK result */  return ATP_OK;}/*P(***************************************************************************  * Procedure name : atp5_7SetFCLASSParameter * Object : Execute +FCLASS=<param> Command *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: Result code * * Used variables    : * ------------------- *   vl_Class			: given class parameter * * Used procedures   : * ------------------- *   atp5_107SendStatusReq	: send the status_req *   atoi			: transform a string into a number *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 7u8 atp5_7SetFCLASSParameter(void){  u8 vl_Class = atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param);  t_hee_DataBitFields1 *pl_hee_DataBitFields1    = (t_hee_DataBitFields1 *)MC_PRM_READ_BLOCK_REQ(HEE_DATA_BITFIELDS1);  /* if the parameter isn't correct */#if !defined(SUPPRESS_FAX_FTR)  if (vl_Class > 1)#else  if (vl_Class)#endif  /* SUPPRESS_FAX_FTR */  {/* the param is invalid *//*     v_atp_AddInfo = ATP_ER_PARAM_INVALID; *//* return an ERROR result */    return ATP_ERROR;  }/* store the new rate */  pl_hee_DataBitFields1->v_Fclass=vl_Class;  MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_BITFIELDS1,                                (u8 *)pl_hee_DataBitFields1 );  /* Return OK result */  return ATP_OK;  }/*P(***************************************************************************  * Procedure name : atp5_8SetCSTAParameter * Object : Execute +CSTA=<param> Command *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: Result code * * Used variables    : * ------------------- *   None * * Used procedures   : * ------------------- *   atoi			: transform a string into a number *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 8#if !defined(ATP_SUPPRESS_REC7_07_FTR)u8 atp5_8SetCSTAParameter(void){  t_hee_DataBitFields *pl_hee_DataBitFields    = (t_hee_DataBitFields *)MC_PRM_READ_BLOCK_REQ(HEE_DATA_BITFIELDS);  /* depending on parameter value */  switch(atoi((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param))  {      /* set type of number */    case UPV_TONNPI_NATIONAL:      pl_hee_DataBitFields->v_TypeOfAddress = UPV_TONNPI_NATIONAL;      break;          case UPV_TONNPI_INTERNAT:      pl_hee_DataBitFields->v_TypeOfAddress = UPV_TONNPI_INTERNAT;      break;    default:/* Set additional result ot param invalid *//*       v_atp_AddInfo = ATP_ER_PARAM_INVALID; *//* return an error */      return ATP_ERROR;  }  MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_BITFIELDS,                                (u8 *)pl_hee_DataBitFields );/* return OK result code */  return ATP_OK;}#endif  /* ATP_SUPPRESS_REC7_07_FTR *//*P(***************************************************************************  * Procedure name : atp5_9SetCPBSParameter * Object : Execute +CPBS=<param> Command *----------------------------------------------------------------------------*  * Input parameters  : * ------------------- *   None * * Output parameters : * ------------------- *   u8				: Result code * * Used variables    : * ------------------- *   None * * Used procedures   : * ------------------- *   strcmp			: compare two strings *  *----------------------------------------------------------------------------*  *----------------------------------------------------------------------------*  *                                    DESCRIPTION * *----------------------------------------------------------------------------*  ***************************************************************************)P*//* #*/#undef PROCEDURE_NUMBER#define PROCEDURE_NUMBER 9#if !defined(ATP_SUPPRESS_REC7_07_FTR)u8 atp5_9SetCPBSParameter(void){  ascii al_atp_Storage[HEE_NB_ATP_STORAGE];    if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_ME_LDN))    memcpy( al_atp_Storage , ATP_ME_LDN, HEE_NB_ATP_STORAGE );  else     if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_EMERGENCY_NB))      memcpy( al_atp_Storage, ATP_EMERGENCY_NB,HEE_NB_ATP_STORAGE );     else      if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_SIM_FDN))	memcpy(al_atp_Storage, ATP_SIM_FDN,HEE_NB_ATP_STORAGE );#if defined ( __CALLS_LIST__ )      else 	if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_MISSED_CALL))	  memcpy(al_atp_Storage, ATP_MISSED_CALL,HEE_NB_ATP_STORAGE );#endif  	else	  if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_OWN_NUMBER))	    memcpy(al_atp_Storage, ATP_OWN_NUMBER,HEE_NB_ATP_STORAGE );	  else	    if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_ME_LRN))	      memcpy(al_atp_Storage, ATP_ME_LRN,HEE_NB_ATP_STORAGE ); 	    else	      if (!strcmp((ascii *)s_atp_CurrentCommandInfo.a_ParamList[0].p_Param, ATP_SIM_PHONEBOOK))		memcpy(al_atp_Storage, ATP_SIM_PHONEBOOK,HEE_NB_ATP_STORAGE );   	      else              {/* ATP_ME_PHONEBOOK, ATP_BOTH_ME_SIM_PB, ATP_SIM_LDN, ATP_TA_PHONEBOOK *//* Set additional result ot param invalid *//*                 v_atp_AddInfo = ATP_ER_PARAM_INVALID; */                /* return an error */                return ATP_ERROR;              }    MC_PRM_WRITE_BLOCK_IMAGE_REQ( HEE_DATA_ATP_STORAGE,                                (u8 *)al_atp_Storage );/* return OK result code */  return ATP_OK;}#endif  /* ATP_SUPPRESS_REC7_07_FTR *//*P(***************************************************************************  * Procedure name : atp5_10SetCBSTParameter

⌨️ 快捷键说明

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