/***************************************************************************** 函 数 名 : AT_StopRelTimer 功能描述 : AT停止REL定时器函数 输入参数 : VOS_UINT32 ulName HTIMER *phTm 输出参数 : 无 返 回 值 : VOS_UINT32 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2011年10月5日 修改内容 : 新生成函数 *****************************************************************************/ VOS_UINT32 AT_StopRelTimer( VOS_UINT32 ulName, HTIMER *phTm ) { VOS_UINT32 ulRet; AT_TIMER_OPERATION_STRU stTimer; ulRet = VOS_StopRelTimer(phTm); if (VOS_ERR == ulRet) { AT_ERR_LOG("AT_StopRelTimer: Stop Rel Timer Fail!"); } stTimer.ulSenderCpuId = VOS_LOCAL_CPUID; stTimer.ulSenderPid = WUEPS_PID_AT; stTimer.ulReceiverCpuId = VOS_LOCAL_CPUID; stTimer.ulReceiverPid = VOS_PID_TIMER; stTimer.ulLength = sizeof(AT_TIMER_OPERATION_STRU) - VOS_MSG_HEAD_LENGTH; stTimer.ulMsgName = ulName; stTimer.enTimeAction = AT_TIMER_OPERATION_STOP; stTimer.ulTimeLen = 0x0; OM_AcpuTraceMsgHook(&stTimer); return ulRet; }
VOS_VOID AT_MNTN_TraceRPTPORT(VOS_VOID) { AT_MNTN_RPTPORT_STRU *pstSndMsgCB; VOS_UINT8 ucLoop; pstSndMsgCB = (AT_MNTN_RPTPORT_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(AT_MNTN_RPTPORT_STRU)); if ( VOS_NULL_PTR == pstSndMsgCB ) { AT_ERR_LOG("AT_MNTN_TraceRPTPORT:ERROR: Alloc Memory Fail."); return; } pstSndMsgCB->ulReceiverPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulReceiverCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulLength = sizeof(AT_MNTN_RPTPORT_STRU) - 20; pstSndMsgCB->enMsgId = ID_AT_MNTN_RESULT_RPT_PORT; for (ucLoop = 0; ucLoop < AT_MAX_CLIENT_NUM; ucLoop++) { pstSndMsgCB->astAtRptPort[ucLoop].enAtClientTabIndex = (AT_CLIENT_TAB_INDEX_UINT8)ucLoop; pstSndMsgCB->astAtRptPort[ucLoop].enModemId = g_astAtClientCtx[ucLoop].stClientConfiguration.enModemId; pstSndMsgCB->astAtRptPort[ucLoop].ucReportFlg = g_astAtClientCtx[ucLoop].stClientConfiguration.ucReportFlg; } AT_MNTN_TraceEvent(pstSndMsgCB); PS_FREE_MSG(WUEPS_PID_AT, pstSndMsgCB); return; }
VOS_UINT32 At_TestCgeqnegPara(VOS_UINT8 ucIndex) { /*CGEQNEG的测试命令和CGACT的查询命令的功能类似,都要获取当前各CID的激活 情况,向TAF查询当前各CID的激活情况*/ if ( VOS_OK != TAF_PS_GetPdpContextState(WUEPS_PID_AT, gastAtClientTab[ucIndex].usClientId, 0) ) { return AT_ERROR; } /*发送查询消息成功后,将命令状态改为CGEQNEG*/ if(AT_SUCCESS != At_StartTimer(AT_QRY_PARA_TIME,ucIndex)) { AT_ERR_LOG("At_TestParaCmd:ERROR:Start Timer"); return AT_ERROR; } /* 设置当前操作类型 */ gastAtClientTab[ucIndex].CmdCurrentOpt = AT_CMD_CGEQNEG_TEST; return AT_WAIT_ASYNC_RETURN; /* 返回命令处理挂起状态 */ /*接下来到TAF事件上报的地方,获取当前哪些CID被激活,并打印当前哪些CID被激活.*/ }
VOS_UINT32 APP_VC_SetModemLoop( VOS_UINT16 usClientId, VOS_UINT8 ucOpId, VOS_UINT8 ucModemLoop ) { VOS_UINT32 ulRslt; APP_VC_REQ_MSG_STRU *pstMsg; /* 构造消息 */ pstMsg = (APP_VC_REQ_MSG_STRU*)PS_ALLOC_MSG_WITH_HEADER_LEN( WUEPS_PID_AT, sizeof(APP_VC_REQ_MSG_STRU)); if (VOS_NULL_PTR == pstMsg) { AT_ERR_LOG("APP_VC_SetModemLoop: ALLOC MSG FAIL."); return VOS_ERR; } /* 初始化消息 */ PS_MEM_SET((VOS_CHAR *)pstMsg + VOS_MSG_HEAD_LENGTH, 0x00, sizeof(APP_VC_REQ_MSG_STRU) - VOS_MSG_HEAD_LENGTH); /* 填写消息头 */ pstMsg->ulReceiverCpuId = VOS_LOCAL_CPUID; pstMsg->ulReceiverPid = AT_GetDestPid(usClientId, I0_WUEPS_PID_VC); pstMsg->enMsgName = APP_VC_MSG_SET_MODEMLOOP_REQ; /* 填写消息内容 */ pstMsg->clientId = usClientId; pstMsg->opId = ucOpId; pstMsg->aucContent[0] = ucModemLoop; /* 发送消息 */ ulRslt = PS_SEND_MSG(WUEPS_PID_AT, pstMsg); if (VOS_OK != ulRslt) { AT_ERR_LOG("APP_VC_SetModemLoop: SEND MSG FAIL."); return VOS_ERR; } return VOS_OK; }
/***************************************************************************** 函 数 名 : AT_StartRelTimer 功能描述 : AT启动REL定时器函数 输入参数 : HTIMER *phTm VOS_PID Pid VOS_UINT32 ulLength VOS_UINT32 ulName VOS_UINT32 ulParam VOS_UINT8 ucMode 输出参数 : 无 返 回 值 : VOS_UINT32 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2011年10月5日 修改内容 : 新生成函数 *****************************************************************************/ VOS_UINT32 AT_StartRelTimer( HTIMER *phTm, VOS_UINT32 ulLength, VOS_UINT32 ulName, VOS_UINT32 ulParam, VOS_UINT8 ucMode ) { VOS_UINT32 ulRet; AT_TIMER_OPERATION_STRU stTimer; if (0 == ulLength) { AT_ERR_LOG("AT_StartRelTimer: Start Rel Timer Length is 0!"); return VOS_ERR; } if ( ulLength >= VOS_TIMER_MAX_LENGTH ) { ulLength = VOS_TIMER_MAX_LENGTH - 1; } ulRet = VOS_StartRelTimer(phTm, WUEPS_PID_AT, ulLength, ulName, ulParam, ucMode, VOS_TIMER_PRECISION_5); if (VOS_ERR == ulRet) { AT_ERR_LOG("AT_StartRelTimer: Start Rel Timer Fail!"); } stTimer.ulSenderCpuId = VOS_LOCAL_CPUID; stTimer.ulSenderPid = WUEPS_PID_AT; stTimer.ulReceiverCpuId = VOS_LOCAL_CPUID; stTimer.ulReceiverPid = VOS_PID_TIMER; stTimer.ulLength = sizeof(AT_TIMER_OPERATION_STRU) - VOS_MSG_HEAD_LENGTH; stTimer.ulMsgName = ulName; stTimer.enTimeAction = AT_TIMER_OPERATION_START; stTimer.ulTimeLen = ulLength; OM_AcpuTraceMsgHook(&stTimer); return ulRet; }
VOS_UINT32 APP_VC_SetVoiceMode( MN_CLIENT_ID_T ClientId, MN_OPERATION_ID_T OpId, VOS_UINT8 ucVoiceMode, VOS_UINT32 ulTaskPid ) { /*构造消息发送消息给VC模块*/ VOS_UINT32 ulRslt; APP_VC_REQ_MSG_STRU *pstMsg; /* 申请消息 */ pstMsg = (APP_VC_REQ_MSG_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(APP_VC_REQ_MSG_STRU) - VOS_MSG_HEAD_LENGTH); if (VOS_NULL_PTR == pstMsg) { AT_ERR_LOG("APP_VC_SetVoiceMode: ALLOC MSG FAIL."); return VOS_ERR; } pstMsg->clientId = ClientId; pstMsg->opId = OpId; pstMsg->enMsgName = APP_VC_MSG_REQ_SET_MODE; pstMsg->ulSenderPid = WUEPS_PID_AT; pstMsg->ulReceiverPid = ulTaskPid; pstMsg->aucContent[0] = ucVoiceMode; pstMsg->aucContent[1] = 0; pstMsg->aucContent[2] = 0; pstMsg->aucContent[3] = 0; ulRslt = PS_SEND_MSG(WUEPS_PID_AT, pstMsg); if (VOS_OK != ulRslt) { AT_ERR_LOG("APP_VC_SetVoiceMode: SEND MSG FAIL."); return VOS_ERR; } return VOS_OK; }
VOS_UINT32 AT_SndSetVoicePrefer ( VOS_UINT16 usClientId, VOS_UINT8 ucOpId, VOS_UINT32 ulVoicePreferApStatus ) { AT_RABM_SET_VOICEPREFER_PARA_REQ_STRU *pstSndMsg = VOS_NULL_PTR; VOS_UINT32 ulRslt; /* 申请内存 */ pstSndMsg = (AT_RABM_SET_VOICEPREFER_PARA_REQ_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(AT_RABM_SET_VOICEPREFER_PARA_REQ_STRU) - VOS_MSG_HEAD_LENGTH); if ( VOS_NULL_PTR == pstSndMsg ) { /* 内存申请失败 */ AT_ERR_LOG("AT_SndSetVoicePrefer:ERROR: Memory Alloc Error for pstMsg"); return VOS_ERR; } /* 填写相关参数 */ pstSndMsg->stMsgHeader.ulReceiverCpuId = VOS_LOCAL_CPUID; pstSndMsg->stMsgHeader.ulReceiverPid = AT_GetDestPid(usClientId, I0_WUEPS_PID_RABM); pstSndMsg->stMsgHeader.ulLength = sizeof(AT_RABM_SET_VOICEPREFER_PARA_REQ_STRU) - VOS_MSG_HEAD_LENGTH; pstSndMsg->stMsgHeader.ulMsgName = ID_AT_RABM_SET_VOICEPREFER_PARA_REQ; pstSndMsg->usClientId = usClientId; pstSndMsg->ucOpId = ucOpId; pstSndMsg->ulVoicePreferApStatus = ulVoicePreferApStatus; /* 调用VOS发送原语 */ ulRslt = PS_SEND_MSG(WUEPS_PID_AT, pstSndMsg); if ( VOS_OK != ulRslt ) { AT_ERR_LOG("AT_SndSetVoicePrefer:ERROR:PS_SEND_MSG "); return VOS_ERR; } return VOS_OK; }
VOS_UINT32 APP_VC_GetVoicePort( MN_CLIENT_ID_T ClientId, MN_OPERATION_ID_T OpId ) { /*构造消息发送消息给VC模块*/ VOS_UINT32 ulRslt; APP_VC_REQ_MSG_STRU *pstMsg; /* 申请消息 */ pstMsg = (APP_VC_REQ_MSG_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(APP_VC_REQ_MSG_STRU) - VOS_MSG_HEAD_LENGTH); if (VOS_NULL_PTR == pstMsg) { AT_ERR_LOG("APP_VC_GetVoicePort: ALLOC MSG FAIL."); return VOS_ERR; } /* 组装消息 */ pstMsg->clientId = ClientId; pstMsg->opId = OpId; pstMsg->enMsgName = APP_VC_MSG_REQ_QRY_PORT; pstMsg->ulSenderPid = WUEPS_PID_AT; pstMsg->ulReceiverPid = AT_GetDestPid(ClientId, I0_WUEPS_PID_VC); pstMsg->aucContent[0] = 0; pstMsg->aucContent[1] = 0; pstMsg->aucContent[2] = 0; pstMsg->aucContent[3] = 0; ulRslt = PS_SEND_MSG(WUEPS_PID_AT, pstMsg); if (VOS_OK != ulRslt) { AT_ERR_LOG("APP_VC_GetVoicePort: SEND MSG FAIL."); return VOS_ERR; } return VOS_OK; }
VOS_UINT32 At_SndReleaseRrcReq ( VOS_UINT16 usClientId, VOS_UINT8 ucOpId ) { AT_RABM_RELEASE_RRC_REQ_STRU *pstSndMsg; VOS_UINT32 ulRslt; /* 申请内存 */ pstSndMsg = (AT_RABM_RELEASE_RRC_REQ_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(AT_RABM_RELEASE_RRC_REQ_STRU) - VOS_MSG_HEAD_LENGTH); if ( VOS_NULL_PTR == pstSndMsg ) { /* 内存申请失败 */ AT_ERR_LOG("At_SndReleaseRrcReq:ERROR: Memory Alloc Error for pstMsg"); return VOS_ERR; } PS_MEM_SET((VOS_CHAR*)pstSndMsg + VOS_MSG_HEAD_LENGTH, 0x00, (sizeof(AT_RABM_RELEASE_RRC_REQ_STRU) - VOS_MSG_HEAD_LENGTH)); /* 填写相关参数 */ pstSndMsg->stMsgHeader.ulReceiverCpuId = VOS_LOCAL_CPUID; pstSndMsg->stMsgHeader.ulReceiverPid = AT_GetDestPid(usClientId, I0_WUEPS_PID_RABM); pstSndMsg->stMsgHeader.ulLength = sizeof(AT_RABM_RELEASE_RRC_REQ_STRU) - VOS_MSG_HEAD_LENGTH; pstSndMsg->stMsgHeader.ulMsgName = ID_AT_RABM_SET_RELEASE_RRC_REQ; pstSndMsg->usClientId = usClientId; pstSndMsg->ucOpId = ucOpId; /* 调用VOS发送原语 */ ulRslt = PS_SEND_MSG(WUEPS_PID_AT, pstSndMsg); if ( VOS_OK != ulRslt ) { AT_ERR_LOG("At_SndReleaseRrcReq:ERROR:PS_SEND_MSG "); return VOS_ERR; } return VOS_OK; }
VOS_UINT32 AT_FillAndSndCSIMAMsg(VOS_UINT16 usClinetID, VOS_UINT32 ulModemStatus) { AT_CSIMA_RESET_STATUS_IND_MSG_STRU *pstATCSIMAIndMsg; MODEM_ID_ENUM_UINT16 enModemID; /* 调用接口获取Modem ID */ if(VOS_OK != AT_GetModemIdFromClient(usClinetID,&enModemID)) { AT_ERR_LOG("AT_FillAndSndCSIMAMsg:ERROR: AT_GetModemIdFromClient Error"); return VOS_ERR; } /* 申请内存 */ pstATCSIMAIndMsg = (AT_CSIMA_RESET_STATUS_IND_MSG_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(AT_CSIMA_RESET_STATUS_IND_MSG_STRU) - VOS_MSG_HEAD_LENGTH); if ( VOS_NULL_PTR == pstATCSIMAIndMsg ) { /* 内存申请失败 */ AT_ERR_LOG("AT_FillAndSndCSIMAMsg:ERROR: Memory Alloc Error for pstMsg"); return VOS_ERR; } /* 填写相关参数 */ if (MODEM_ID_1 == enModemID) { pstATCSIMAIndMsg->ulReceiverPid = I1_WUEPS_PID_CSIMA; } else { pstATCSIMAIndMsg->ulReceiverPid = I0_WUEPS_PID_CSIMA; } pstATCSIMAIndMsg->ulMsgId = AT_CSIMA_RESET_IND_MSG; pstATCSIMAIndMsg->enVIAModemStatus = (CBP_MODEM_RESET_STATUS_ENUM_UINT32)ulModemStatus; /* 调用VOS发送原语 */ return PS_SEND_MSG(WUEPS_PID_AT, pstATCSIMAIndMsg); }
VOS_UINT32 AT_GetModemIdFromClient( VOS_UINT16 usClientId, MODEM_ID_ENUM_UINT16 *pModemId ) { AT_CLIENT_CTX_STRU *pstAtClientCtx = VOS_NULL_PTR; /* 判断是否是MODEM0广播的client index */ if ((AT_BROADCAST_CLIENT_INDEX_MODEM_0 == usClientId) || (AT_BROADCAST_CLIENT_ID_MODEM_0 == usClientId)) { *pModemId = MODEM_ID_0; } /* 判断是否是MODEM1广播的client index */ else if ((AT_BROADCAST_CLIENT_INDEX_MODEM_1 == usClientId) || (AT_BROADCAST_CLIENT_ID_MODEM_1 == usClientId)) { *pModemId = MODEM_ID_1; } /* 判断是否是MODEM2广播的client index */ else if ((AT_BROADCAST_CLIENT_INDEX_MODEM_2 == usClientId) || (AT_BROADCAST_CLIENT_ID_MODEM_2 == usClientId)) { *pModemId = MODEM_ID_2; } /* 非广播client index */ else { /* client index 无效,直接返回 */ if (usClientId >= AT_CLIENT_BUTT) { return VOS_ERR; } pstAtClientCtx = AT_GetClientCtxAddr(usClientId); *pModemId = pstAtClientCtx->stClientConfiguration.enModemId; } /* 在单卡的时候NV里读出来的MODEMID为MODEM1时,会发生内存越界,此处做个异常保护 */ if (*pModemId >= MODEM_ID_BUTT) { AT_ERR_LOG("AT_GetModemIdFromClient: modem id is invalid"); *pModemId = MODEM_ID_0; return VOS_ERR; } return VOS_OK; }
/***************************************************************************** 函 数 名 : At_StartTimer 功能描述 : AT启动定时器 输入参数 : TAF_UINT32 usLength TAF_UINT8 ucIndex 输出参数 : 无 返 回 值 : TAF_UINT32 调用函数 : 被调函数 : 修改历史 : 1.Date : 2005-04-19 Modification: Created function 2.日 期 : 2009-03-25 修改内容 : 问题单号:AT2D10008 3.日 期 : 2011年10月5日 修改内容 : AT Project:定时器由AT内部实现 *****************************************************************************/ VOS_UINT32 At_StartTimer( VOS_UINT32 usLength, VOS_UINT8 ucIndex ) { VOS_StopRelTimer(&gastAtClientTab[ucIndex].hTimer); if(VOS_OK != AT_StartRelTimer(&gastAtClientTab[ucIndex].hTimer,usLength,ucIndex,0,VOS_RELTIMER_NOLOOP)) { AT_ERR_LOG("At_StartTimer:ERROR:Start Timer"); return AT_FAILURE; } return AT_SUCCESS; }
VOS_VOID AT_ProcImsaMsg(AT_IMSA_MSG_STRU *pstMsg) { VOS_UINT32 i; VOS_UINT32 ulMsgCnt; VOS_UINT32 ulMsgId; VOS_UINT32 ulRst; /*从g_astAtProcMsgFromImsaTab中获取消息个数*/ ulMsgCnt = sizeof(g_astAtImsaMsgTab)/sizeof(AT_IMSA_MSG_PRO_FUNC_STRU); /*从消息包中获取MSG ID*/ ulMsgId = pstMsg->ulMsgId; /*g_astAtProcMsgFromImsaTab查表,进行消息分发*/ for (i = 0; i < ulMsgCnt; i++) { if (g_astAtImsaMsgTab[i].ulMsgId == ulMsgId) { ulRst = g_astAtImsaMsgTab[i].pProcMsgFunc(pstMsg); if (VOS_ERR == ulRst) { AT_ERR_LOG("AT_ProcImsaMsg: Msg Proc Err!"); } return; } } /*没有找到匹配的消息*/ if (ulMsgCnt == i) { AT_ERR_LOG("AT_ProcImsaMsg: Msg Id is invalid!"); } return; }
VOS_UINT32 MN_CALL_SendAppRequest( MN_CALL_APP_REQ_ENUM_UINT32 enReq, MN_CLIENT_ID_T clientId, MN_OPERATION_ID_T opId, MN_CALL_ID_T callId, const MN_CALL_APP_REQ_PARM_UNION *punParam ) { MN_CALL_APP_REQ_MSG_STRU *pstMsg = (MN_CALL_APP_REQ_MSG_STRU *)PS_ALLOC_MSG_WITH_HEADER_LEN(WUEPS_PID_AT, sizeof(MN_CALL_APP_REQ_MSG_STRU)); if (VOS_NULL_PTR == pstMsg) { AT_ERR_LOG("MN_CALL_SendAppRequest: Failed to alloc VOS message."); return VOS_ERR; } PS_MEM_SET((VOS_INT8*)pstMsg + VOS_MSG_HEAD_LENGTH, 0x00, (VOS_SIZE_T)(sizeof(MN_CALL_APP_REQ_MSG_STRU) - VOS_MSG_HEAD_LENGTH)); /* 填写VOS消息头 */ pstMsg->ulSenderCpuId = VOS_LOCAL_CPUID; pstMsg->ulSenderPid = WUEPS_PID_AT; pstMsg->ulReceiverCpuId = VOS_LOCAL_CPUID; pstMsg->ulReceiverPid = AT_GetDestPid(clientId, I0_WUEPS_PID_TAF); /* 填写原语首部 */ pstMsg->enReq = enReq; pstMsg->clientId = clientId; pstMsg->opId = opId; pstMsg->callId = callId; if (TAF_NULL_PTR != punParam) { PS_MEM_CPY(&pstMsg->unParm, punParam, sizeof(pstMsg->unParm)); } /* 发送VOS消息 */ if (VOS_OK != PS_SEND_MSG(WUEPS_PID_AT, pstMsg)) { AT_ERR_LOG1("MN_CALL_SendAppRequest: Send Message Fail. reqtype:", (VOS_INT32)enReq); return VOS_ERR; } return VOS_OK; }
AT_MODEM_CC_CTX_STRU* AT_GetModemCcCtxAddrFromClientId( VOS_UINT16 usClientId ) { MODEM_ID_ENUM_UINT16 enModemId; VOS_UINT32 ulRslt; enModemId = MODEM_ID_0; ulRslt = AT_GetModemIdFromClient((VOS_UINT8)usClientId, &enModemId); if (VOS_OK != ulRslt) { AT_ERR_LOG("AT_GetModemCcCtxAddrFromClientId: Get modem id fail."); } return &(g_astAtModemCtx[enModemId].stCcCtx); }
VOS_VOID AT_MNTN_TraceClientData(VOS_VOID) { NAS_AT_SDT_AT_CLIENT_TABLE_STRU *pstSndMsgCB; TAF_UINT8 ucLoop; pstSndMsgCB = (NAS_AT_SDT_AT_CLIENT_TABLE_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(NAS_AT_SDT_AT_CLIENT_TABLE_STRU)); if ( VOS_NULL_PTR == pstSndMsgCB ) { AT_ERR_LOG("AT_MNTN_TraceClientData:ERROR: Alloc Memory Fail."); return; } pstSndMsgCB->ulReceiverPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulReceiverCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulLength = sizeof(NAS_AT_SDT_AT_CLIENT_TABLE_STRU) - 20; pstSndMsgCB->enMsgID = ID_AT_MNTN_PC_REPLAY_CLIENT_TAB; pstSndMsgCB->ucType = AT_PC_REPLAY_MSG_CLIENT_TAB; pstSndMsgCB->aucReserved[0] = 0; pstSndMsgCB->aucReserved[1] = 0; pstSndMsgCB->aucReserved[2] = 0; for (ucLoop = 0; ucLoop < AT_MAX_CLIENT_NUM; ucLoop++) { pstSndMsgCB->gastAtClientTab[ucLoop].usClientId = gastAtClientTab[ucLoop].usClientId; pstSndMsgCB->gastAtClientTab[ucLoop].opId = gastAtClientTab[ucLoop].opId; pstSndMsgCB->gastAtClientTab[ucLoop].ucUsed = gastAtClientTab[ucLoop].ucUsed; pstSndMsgCB->gastAtClientTab[ucLoop].UserType = gastAtClientTab[ucLoop].UserType; pstSndMsgCB->gastAtClientTab[ucLoop].Mode = gastAtClientTab[ucLoop].Mode; pstSndMsgCB->gastAtClientTab[ucLoop].IndMode = gastAtClientTab[ucLoop].IndMode; } AT_MNTN_TraceEvent(pstSndMsgCB); PS_FREE_MSG(WUEPS_PID_AT, pstSndMsgCB); return; }
VOS_VOID AT_MNTN_TraceCmdBuffer( VOS_UINT8 ucIndex, VOS_UINT8 *pucData, VOS_UINT16 usDataLen ) { AT_MSG_STRU *pstMsg; AT_INTER_MSG_ID_ENUM_UINT32 enEventId; VOS_UINT32 ulLength; AT_GetAtMsgStruMsgLength(usDataLen, &ulLength); /* 申请消息内存 */ pstMsg = (AT_MSG_STRU *)PS_MEM_ALLOC(WUEPS_PID_AT, (ulLength + VOS_MSG_HEAD_LENGTH)); if (VOS_NULL_PTR == pstMsg) { AT_ERR_LOG("AT_MNTN_TraceCmdBuffer:ERROR:Alloc Mem Fail."); return; } /* 填写消息头 */ enEventId = AT_GetResultMsgID(ucIndex); AT_MNTN_CFG_MSG_HDR(pstMsg, enEventId, ulLength); /* 填写消息内容 */ pstMsg->ucType = 0x2; pstMsg->ucIndex = ucIndex; pstMsg->usLen = usDataLen; AT_GetUserTypeFromIndex(ucIndex, &pstMsg->ucUserType); PS_MEM_SET(pstMsg->aucReserved, 0x00, sizeof(pstMsg->aucReserved)); PS_MEM_CPY((TAF_VOID*)pstMsg->aucValue, pucData, usDataLen); /* 填写消息内容 */ AT_MNTN_TraceEvent(pstMsg); /* 释放消息内存 */ PS_FREE_MSG(WUEPS_PID_AT, pstMsg); return; }
/***************************************************************************** 函 数 名 : AT_FillAndSndCSIMAMsg 功能描述 : AT到CCIMA模块消息 输入参数 : VIA Modem 复位状态 输出参数 : 无 返 回 值 : VOS_UINT32 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2013年12月20日 修改内容 : V9R1 L_plus_C项目新增 *****************************************************************************/ VOS_UINT32 AT_FillAndSndCSIMAMsg(VOS_UINT32 ulModemStatus) { AT_CSIMA_RESET_STATUS_IND_MSG_STRU *pstATCSIMAIndMsg; /* 申请内存 */ pstATCSIMAIndMsg = (AT_CSIMA_RESET_STATUS_IND_MSG_STRU *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(AT_CSIMA_RESET_STATUS_IND_MSG_STRU) - VOS_MSG_HEAD_LENGTH); if ( VOS_NULL_PTR == pstATCSIMAIndMsg ) { /* 内存申请失败 */ AT_ERR_LOG("AT_FillAndSndCSIMAMsg:ERROR: Memory Alloc Error for pstMsg"); return VOS_ERR; } /* 填写相关参数 */ pstATCSIMAIndMsg->ulReceiverPid = WUEPS_PID_CSIMA; pstATCSIMAIndMsg->ulMsgId = AT_CSIMA_RESET_IND_MSG; pstATCSIMAIndMsg->enVIAModemStatus = (CBP_MODEM_RESET_STATUS_ENUM_UINT32)ulModemStatus; /* 调用VOS发送原语 */ return PS_SEND_MSG(WUEPS_PID_AT, pstATCSIMAIndMsg); }
VOS_UINT32 AT_SetActiveModem(VOS_UINT8 ucIndex) { TAF_NV_DSDS_ACTIVE_MODEM_MODE_STRU stMode; /* 参数个数检查 */ if (gucAtParaIndex != 1) { return AT_CME_INCORRECT_PARAMETERS; } PS_MEM_SET(&stMode, 0, sizeof(stMode)); stMode.enActiveModem = (TAF_NV_ACTIVE_MODEM_MODE_ENUM_UINT8)gastAtParaList[0].ulParaValue; /* 写NV, 返回AT_OK */ if (NV_OK != NV_WriteEx(MODEM_ID_0, en_NV_Item_DSDS_Active_Modem_Mode, &stMode, sizeof(stMode))) { AT_ERR_LOG("AT_SetActiveModem(): en_NV_Item_DSDS_Active_Modem_Mode NV Write Fail!"); return AT_ERROR; } return AT_OK; }
VOS_VOID AT_MNTN_TraceContextData(VOS_VOID) { NAS_AT_SDT_AT_PART_ST *pstSndMsgCB = VOS_NULL_PTR; NAS_AT_OUTSIDE_RUNNING_CONTEXT_PART_ST *pstOutsideCtx = VOS_NULL_PTR; AT_MODEM_SMS_CTX_STRU *pstSmsCtx = VOS_NULL_PTR; MODEM_ID_ENUM_UINT16 enModemId; pstSndMsgCB = (NAS_AT_SDT_AT_PART_ST *)PS_ALLOC_MSG(WUEPS_PID_AT, sizeof(NAS_AT_SDT_AT_PART_ST)); if (VOS_NULL_PTR == pstSndMsgCB) { AT_ERR_LOG("AT_MNTN_TraceContextData:ERROR: Alloc Memory Fail."); return; } pstSndMsgCB->ulReceiverPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderPid = WUEPS_PID_AT; pstSndMsgCB->ulSenderCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulReceiverCpuId = VOS_LOCAL_CPUID; pstSndMsgCB->ulLength = sizeof(NAS_AT_OUTSIDE_RUNNING_CONTEXT_PART_ST) + 4; pstSndMsgCB->ucType = AT_PC_REPLAY_MSG; pstSndMsgCB->enMsgID = ID_AT_MNTN_PC_REPLAY_MSG; pstSndMsgCB->aucReserved[0] = 0; pstSndMsgCB->aucReserved[1] = 0; pstSndMsgCB->aucReserved[2] = 0; for (enModemId = 0; enModemId < MODEM_ID_BUTT; enModemId++) { pstSmsCtx = AT_GetModemSmsCtxAddrFromModemId(enModemId); pstOutsideCtx = &pstSndMsgCB->astOutsideCtx[enModemId]; pstOutsideCtx->gucAtCscsType = gucAtCscsType; pstOutsideCtx->gucAtCsdhType = pstSmsCtx->ucCsdhType; pstOutsideCtx->g_OpId = g_OpId; pstOutsideCtx->g_enAtCsmsMsgVersion = pstSmsCtx->enCsmsMsgVersion; pstOutsideCtx->g_enAtCmgfMsgFormat = pstSmsCtx->enCmgfMsgFormat; PS_MEM_CPY(&pstOutsideCtx->gstAtCnmiType, &(pstSmsCtx->stCnmiType), sizeof(pstSmsCtx->stCnmiType)); PS_MEM_CPY(&pstOutsideCtx->g_stAtCgsmsSendDomain, &(pstSmsCtx->stCgsmsSendDomain), sizeof(pstSmsCtx->stCgsmsSendDomain)); PS_MEM_CPY(&pstOutsideCtx->g_stAtCscaCsmpInfo, &(pstSmsCtx->stCscaCsmpInfo), sizeof(pstSmsCtx->stCscaCsmpInfo)); PS_MEM_CPY(&pstOutsideCtx->g_stAtCpmsInfo, &(pstSmsCtx->stCpmsInfo), sizeof(pstSmsCtx->stCpmsInfo)); } AT_MNTN_TraceEvent(pstSndMsgCB); PS_FREE_MSG(WUEPS_PID_AT, pstSndMsgCB); return; }
VOS_UINT32 AT_ParseSetDockCmd( VOS_UINT8 *pucData, VOS_UINT16 usLen ) { VOS_INT8 cRet; VOS_UINT16 usCmdlen; VOS_UINT32 ulPos; VOS_UINT8 *pucDataPara = VOS_NULL_PTR; AT_PARSE_CMD_NAME_TYPE_STRU stAtCmdName; PS_MEM_SET(&stAtCmdName, 0, sizeof(stAtCmdName)); if (0 == usLen) { return AT_FAILURE; } pucDataPara = (VOS_UINT8*)PS_MEM_ALLOC(WUEPS_PID_AT, usLen); if (VOS_NULL_PTR == pucDataPara) { AT_ERR_LOG("AT_ParseSetDockCmd: pucDataPara Memory malloc failed!"); return AT_FAILURE; } PS_MEM_CPY(pucDataPara, pucData, usLen); /* 去掉字符串中的退格符 */ if (AT_FAILURE == At_ScanDelChar(pucDataPara, &usLen)) { PS_MEM_FREE(WUEPS_PID_AT, pucDataPara); return AT_FAILURE; } /* 待处理的字符串长度小于"AT^DOCK="长度直接返回AT_FAILURE */ usCmdlen = (VOS_UINT16)VOS_StrLen("AT^DOCK="); if (usLen < usCmdlen) { PS_MEM_FREE(WUEPS_PID_AT, pucDataPara); return AT_FAILURE; } /* AT命令头字符转大写 */ At_UpString(pucDataPara, usCmdlen); /* 待处理的字符串头部不是"AT^DOCK="直接返回AT_FAILURE */ cRet = VOS_StrNiCmp((VOS_CHAR *)pucDataPara, "AT^DOCK=", usCmdlen); if (0 != cRet) { PS_MEM_FREE(WUEPS_PID_AT, pucDataPara); return AT_FAILURE; } /* 获取命令(不包含命令前缀AT)名称及长度 */ ulPos = VOS_StrLen("AT"); stAtCmdName.usCmdNameLen = (VOS_UINT16)VOS_StrLen("^DOCK"); PS_MEM_CPY(stAtCmdName.aucCmdName, (pucDataPara + ulPos), stAtCmdName.usCmdNameLen); stAtCmdName.aucCmdName[stAtCmdName.usCmdNameLen] = '\0'; ulPos += stAtCmdName.usCmdNameLen; ulPos += VOS_StrLen("="); /* 获取命令的参数字符串及长度 */ gastAtParaList[0].usParaLen = usLen - (VOS_UINT16)ulPos; PS_MEM_CPY(gastAtParaList[0].aucPara, (pucDataPara + ulPos), gastAtParaList[0].usParaLen); /* 设置命令类型,操作类型和参数个数 */ gucAtParaIndex = 1; g_stATParseCmd.ucCmdOptType = AT_CMD_OPT_SET_PARA_CMD; gucAtCmdFmtType = AT_EXTEND_CMD_TYPE; PS_MEM_FREE(WUEPS_PID_AT, pucDataPara); return AT_SUCCESS; }