VOS_VOID SMR_TimerTr1mExpire() { /* 停止timer TR1M */ SMS_LOG( PS_PRINT_NORMAL, "SMS:SMR_TimerTr1mExpire: TimerStop: TR1M" ); if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TR1M ) ) { return; } if ( SMR_WAIT_FOR_RP_ACK == g_SmrEnt.SmrMo.ucState ) { if ( SMS_TRUE == g_SmrEnt.SmrMo.ucMemAvailFlg ) { /*是内存通知过程 */ SMR_MemNotifyRetrans(SMR_SMT_ERROR_TR1M_TIMEOUT, VOS_NULL_PTR, 0); /* 调用重发过程的处理 */ if (SMR_IDLE == g_SmrEnt.SmrMo.ucState) { SMC_SmrApiRelReq(SMR_SMC_REL_CAUSE_NORMAL, SMS_FALSE ); /* 释放当前正在建立的消息的资源 */ } } else { SMC_SmrApiAbortReq(SMR_SMC_ABORT_CAUSE_TR1M_EXP); /* 向网侧报错 */ PS_LOG(WUEPS_PID_SMS, VOS_NULL, PS_PRINT_NORMAL, "SMR_TimerTr1mExpire:NORMAL:SMS state = SMR_IDLE"); g_SmrEnt.SmrMo.ucState = SMR_IDLE; /* 进入空闲 */ SMS_SendMnReportReq(SMR_SMT_ERROR_TR1M_TIMEOUT, VOS_NULL_PTR, 0); } } }
VOS_UINT32 NAS_SMS_RestoreContextData( struct MsgCB *pstMsg ) { NAS_SMS_SDT_SMS_PART_ST *pstRcvMsgCB; NAS_SMS_OUTSIDE_RUNNING_CONTEXT_PART_ST *pstOutsideCtx; pstRcvMsgCB = (NAS_SMS_SDT_SMS_PART_ST *)pstMsg; if (SMS_PC_REPLAY_MSG == pstRcvMsgCB->ulMsgName) { pstOutsideCtx = &pstRcvMsgCB->stOutsideCtx; PS_MEM_CPY(&g_SmcPsEnt,&pstOutsideCtx->g_SmcPsEnt,sizeof(g_SmcPsEnt)); PS_MEM_CPY(&g_SmcCsEnt,&pstOutsideCtx->g_SmcCsEnt, sizeof(g_SmcCsEnt)); PS_MEM_CPY(&g_SmrEnt, &pstOutsideCtx->g_SmrEnt, sizeof(g_SmrEnt)); g_ucPsServiceStatus = pstOutsideCtx->g_ucPsServiceStatus; g_ucCsRegFlg = pstOutsideCtx->g_ucCsRegFlg; g_ucSmsMR = pstOutsideCtx->g_ucSmsMR; g_SndDomain = pstOutsideCtx->g_SndDomain; SMS_LOG(PS_LOG_LEVEL_INFO, "MSG: NAS_SMS_RestoreContextData data is restored."); } return VOS_OK; }
VOS_VOID SMR_MemNotifyRetrans( SMR_SMT_ERROR_ENUM_UINT32 enErrorCode, VOS_UINT8 *pucData, VOS_UINT32 ulSendLen ) { if ( SMR_RETRANS_PERMIT != g_SmrEnt.SmrMo.ucRetransFlg ) { /* RETRANS FLAG 置位 */ SMS_SendMnReportReq(enErrorCode, pucData, ulSendLen); g_SmrEnt.SmrMo.ucRetransFlg = SMR_RETRANS_PERMIT; /* 将RETRANS FLAG置0清除 */ g_SmrEnt.SmrMo.ucMemAvailFlg = SMS_FALSE; /* 清除标志位 */ PS_LOG(WUEPS_PID_SMS, VOS_NULL, PS_PRINT_NORMAL, "SMR_SmcApiDataInd:NORMAL:SMS state = SMR_IDLE"); g_SmrEnt.SmrMo.ucState = SMR_IDLE; /* 状态迁移到空闲状态 */ } else { SMC_SmrApiRelReq((VOS_UINT8)enErrorCode, SMS_FALSE ); /* 发送MNSMS_REL_REQ,释放mm连接 */ /*清除前面的消息*/ g_SmrEnt.SmrMo.ucRetransFlg = SMR_RETRANS_NO_PERMIT; /* 将RETRANS FLAG置0清除 */ /* 启动定时器TRAM */ SMS_LOG( PS_PRINT_NORMAL, "SMS:SMR_MemNotifyRetrans: TimerStart: TRAM" ); if ( SMS_FALSE == SMS_TimerStart( SMC_TIMER_ID_TRAM ) ) { return; } g_SmrEnt.SmrMo.ucState = SMR_WAIT_FOR_RETRANS_TIMER; /* 状态迁移 */ } }
/******************************************************************************* Module: SMR_TimerTramExpire Function: TRAM定时器溢出处理 Input: Output: NOTE: Return: VOS_VOID History: 1. 张志勇 2004.03.10 新规作成 2. *******************************************************************************/ VOS_VOID SMR_TimerTramExpire() { VOS_UINT8 ErrData[3]; /*A32D00461,zzy,pclint*/ /* 定义临时指向RP_SMMA的指针 */ /* 停止timer TRAM */ SMS_LOG( PS_PRINT_NORMAL, "SMS:SMR_TimerTramExpire: TimerStop: TRAM" ); if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TRAM ) ) { return; } /* g_SmrEnt.SmrMo.aTimerInfo[1].ucTimerSta = SMS_TIMER_STATUS_STOP; */ if ( SMR_WAIT_FOR_RETRANS_TIMER == g_SmrEnt.SmrMo.ucState ) { g_SmrEnt.SmrMo.ucRetransFlg = SMR_RETRANS_PROCESS; /* 将实体内的RetransFlg置为SMR_RETRANS_PROC * ESS */ ErrData[0] = 2; /* 填写RP_SMMA的消息长度 */ ErrData[1] = SMR_MTN_DATA_TYPE_RP_SMMA; /* 填写RP_SMMA的消息类型 */ g_SmrEnt.SmrMo.ucMr = ++g_ucSmsMR; ErrData[2] = g_SmrEnt.SmrMo.ucMr; /* 填写RP_SMMA的MR */ SMC_SmrApiEstReq(g_ucCurSendDomain,ErrData,3); /* 发送MNSMS_EST_REQ */ /* 启动定时器TR1M */ SMS_LOG( PS_PRINT_NORMAL, "SMS:SMR_TimerTramExpire: TimerStart: TR1M" ); if ( SMS_FALSE == SMS_TimerStart( SMC_TIMER_ID_TR1M ) ) { return; } /* g_SmrEnt.SmrMo.aTimerInfo[0].ucTimerSta = SMS_TIMER_STATUS_RUN; */ g_SmrEnt.SmrMo.ucState = SMR_WAIT_FOR_RP_ACK; /* 状态迁移到SMR_WAIT_FOR_RP_ACK状态 */ } }
VOS_VOID SMR_TimerTr2mExpire() { /* 停止timer TR2M */ SMS_LOG( PS_PRINT_NORMAL, "SMS:SMR_TimerTr2mExpire: TimerStop: TR2M" ); if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TR2M ) ) { return; } /* g_SmrEnt.SmrMt.TimerInfo.ucTimerSta = SMS_TIMER_STATUS_STOP; */ if (SMR_WAIT_TO_SND_RP_ACK == g_SmrEnt.SmrMt.ucState) { SMC_SmrApiAbortReq( SMR_SMC_ABORT_CAUSE_TR2M_EXP ); /* 发送MNSMS_ABORT_REQ */ /* SMR_MkSndReportError( g_SmrEnt.SmrMt.ucMr,SMR_ERR_CAUSE_TEMP_FAILURE ); 发送SMRL_REPORT_IND */ /*定时器超时后,还没有响应,通知AT修改+CNMI命令参数<mt>和<ds>置为0*/ SMS_SendMnMtErrInd(SMR_SMT_ERROR_TR2M_TIMEOUT); PS_LOG(WUEPS_PID_SMS, VOS_NULL, PS_PRINT_NORMAL, "SMR_TimerTr2mExpire:NORMAL:SMS state = SMR_IDLE"); g_SmrEnt.SmrMt.ucState = SMR_IDLE; /* 状态迁移到空闲状态 */ } }
VOS_VOID NAS_SMS_SndOutsideContextData() { NAS_SMS_SDT_SMS_PART_ST *pSndMsgCB = VOS_NULL_PTR; NAS_SMS_OUTSIDE_RUNNING_CONTEXT_PART_ST *pstOutsideCtx; pSndMsgCB = (NAS_SMS_SDT_SMS_PART_ST *)PS_ALLOC_MSG(WUEPS_PID_SMS, sizeof(NAS_SMS_SDT_SMS_PART_ST)); if ( VOS_NULL_PTR == pSndMsgCB ) { SMS_LOG(PS_LOG_LEVEL_ERROR, "NAS_SMS_SndOutsideContextData:ERROR: Alloc Memory Fail."); return; } pSndMsgCB->ulReceiverPid = WUEPS_PID_SMS; pSndMsgCB->ulSenderPid = WUEPS_PID_SMS; pSndMsgCB->ulSenderCpuId = VOS_LOCAL_CPUID; pSndMsgCB->ulReceiverCpuId = VOS_LOCAL_CPUID; pSndMsgCB->ulLength = sizeof(NAS_SMS_OUTSIDE_RUNNING_CONTEXT_PART_ST) + 4; pSndMsgCB->ulMsgName = SMS_PC_REPLAY_MSG; pstOutsideCtx = &pSndMsgCB->stOutsideCtx; PS_MEM_CPY(&pstOutsideCtx->g_SmcPsEnt, &g_SmcPsEnt, sizeof(g_SmcPsEnt)); PS_MEM_CPY(&pstOutsideCtx->g_SmcCsEnt, &g_SmcCsEnt, sizeof(g_SmcCsEnt)); PS_MEM_CPY(&pstOutsideCtx->g_SmrEnt, &g_SmrEnt, sizeof(g_SmrEnt)); pstOutsideCtx->g_ucPsServiceStatus = g_ucPsServiceStatus; pstOutsideCtx->g_ucCsRegFlg = g_ucCsRegFlg; pstOutsideCtx->g_ucSmsMR = g_ucSmsMR; pstOutsideCtx->g_SndDomain = g_SndDomain; DIAG_TraceReport(pSndMsgCB); PS_FREE_MSG(WUEPS_PID_SMS, pSndMsgCB); return; }
VOS_VOID SMS_Poweroff(VOS_VOID) { /*停止所有定时器*/ if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_PS_TC1M_MO ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_PS_TC1M_MO Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_PS_TC1M_MT ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_PS_TC1M_MT Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_CS_TC1M_MO ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_CS_TC1M_MO Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_CS_TC1M_MT ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_CS_TC1M_MO Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TR1M ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_TR1M Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TR2M ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_TR2M Timer stop fails" ); } if ( SMS_FALSE == SMS_TimerStop( SMC_TIMER_ID_TRAM ) ) { SMS_LOG( PS_LOG_LEVEL_ERROR, "SMS:SMS_Poweroff: SMC_TIMER_ID_TRAM Timer stop fails" ); } /*释放所有正在进行的短信发送或接受过程*/ g_ucCsRegFlg = SMS_FALSE; /* 记录此状态 */ SMC_ComCsMtErr(SMR_SMT_ERROR_NO_SERVICE, g_SmcCsEnt.SmcMt.ucTi); /* 调用CS域MT实体的处理 */ SMC_ComCsMoErr(SMR_SMT_ERROR_NO_SERVICE, g_SmcCsEnt.SmcMo.ucTi); /* 调用CS域MO实体的处理 */ if (SMS_TRUE == g_SmcCsEnt.SmcMo.ucCpAckFlg) { /* TI相等 */ g_SmcCsEnt.SmcMo.ucCpAckFlg = SMS_FALSE; SMS_SendMnMoLinkCloseInd(); } g_ucPsServiceStatus = SMS_FALSE; /* 记录此状态 */ SMC_ComPsMtErr(SMR_SMT_ERROR_NO_SERVICE); /* 调用PS域MT实体的处理 */ SMC_ComPsMoErr(SMR_SMT_ERROR_NO_SERVICE); /* 调用PS域MO实体的处理 */ if (SMS_TRUE == g_SmcPsEnt.SmcMo.ucCpAckFlg) { /* TI相等 */ g_SmcPsEnt.SmcMo.ucCpAckFlg = SMS_FALSE; SMS_SendMnMoLinkCloseInd(); } #ifdef DMT SMS_InitEntity(); #endif return; }