VOS_VOID MTC_SndRcmModemStateInd(VOS_VOID) { MTC_RCM_MODEM_STATE_NOTIFY_STRU *pstModemState; MODEM_ID_ENUM_UINT16 enModemId; /* 申请消息包 */ pstModemState = (MTC_RCM_MODEM_STATE_NOTIFY_STRU *)MTC_ALLOC_MSG_WITH_HDR(sizeof(MTC_RCM_MODEM_STATE_NOTIFY_STRU)); if (VOS_NULL_PTR == pstModemState) { MTC_ERROR_LOG("MTC_SndRcmModemStateInd: Alloc Msg Fail!"); return; } PS_MEM_SET(((VOS_UINT8*)pstModemState) + VOS_MSG_HEAD_LENGTH, 0, sizeof(MTC_RCM_MODEM_STATE_NOTIFY_STRU) - VOS_MSG_HEAD_LENGTH); /* 填充消息头 */ MTC_CFG_RCM_MSG_HDR(&pstModemState->stMsgHeader, ID_MTC_RCM_MODEM_STATUS_NOTIFY); /* 填写modem0和modem1的状态信息 */ for (enModemId = 0; enModemId < MODEM_ID_BUTT ; enModemId++) { pstModemState->astModemState[enModemId].enCsSrvConnState = MTC_GetCsConnStateInfo(enModemId); pstModemState->astModemState[enModemId].enPsSrvConnState = MTC_GetRcmPsConnStateInfo(enModemId); pstModemState->astModemState[enModemId].enModemPowerState = MTC_GetModemPowerState(enModemId); pstModemState->astModemState[enModemId].enUsimmCardState = MTC_GetUsimmStateInfo(enModemId); pstModemState->astModemState[enModemId].enModemType = MTC_RCM_MODEM_0 + enModemId; } /* 填写CDMA状态信息 */ pstModemState->astModemState[MTC_RCM_MODEM_CDMA].enCsSrvConnState = MTC_GetOutSideCsConnStateInfo(MTC_OUTSIDE_MODEM_CDMA); pstModemState->astModemState[MTC_RCM_MODEM_CDMA].enPsSrvConnState = MTC_GetOutSidePsConnStateInfo(MTC_OUTSIDE_MODEM_CDMA); pstModemState->astModemState[MTC_RCM_MODEM_CDMA].enModemPowerState = MTC_GetOutSideModemPowerState(MTC_OUTSIDE_MODEM_CDMA); pstModemState->astModemState[MTC_RCM_MODEM_CDMA].enUsimmCardState = MTC_GetOutSideModemUsimmState(MTC_OUTSIDE_MODEM_CDMA); pstModemState->astModemState[MTC_RCM_MODEM_CDMA].enModemType = MTC_RCM_MODEM_CDMA; /* 发送消息 */ MTC_SEND_MSG(pstModemState); return; }
VOS_VOID MTC_DEBUG_TraceAllModemConnStateInfo(VOS_VOID) { MTC_DEBUG_ALL_MODEM_STATE_INFO stAllModemState; MODEM_ID_ENUM_UINT16 enModemID; TAF_MTC_SRV_CONN_STATE_ENUM_UINT8 enCsSrvStatus; TAF_MTC_SRV_CONN_STATE_ENUM_UINT8 enPsSrvStatus; enPsSrvStatus = TAF_MTC_SRV_CONN_STATE_BUTT; /* 初始化 */ PS_MEM_SET(&stAllModemState, 0x0, sizeof(MTC_DEBUG_ALL_MODEM_STATE_INFO)); /* 填写消息头 */ MTC_DEBUG_CFG_MSG_HDR(&stAllModemState.stMsgHeader, UEPS_PID_MTC, UEPS_PID_MTC, sizeof(MTC_DEBUG_ALL_MODEM_STATE_INFO) - VOS_MSG_HEAD_LENGTH); stAllModemState.stMsgHeader.ulMsgName = ID_DEBUG_MTC_ALL_MODEM_STATE_INFO; /* 各Modem状态信息 */ for (enModemID = 0; enModemID < MODEM_ID_BUTT; enModemID++) { stAllModemState.stModemStateInfo[enModemID].enPowerState = MTC_GetModemPowerState(enModemID); stAllModemState.stModemStateInfo[enModemID].ulCsSessionValue = MTC_GetCsSessionInfo(enModemID); stAllModemState.stModemStateInfo[enModemID].ulPsSessionValue = MTC_GetPsSessionInfo(enModemID); stAllModemState.stModemStateInfo[enModemID].ucPsConnInfo = MTC_GetPsTypeInfo(enModemID); enPsSrvStatus = MTC_GetPsSrvState(enModemID); if ((PS_TRUE == MTC_IsPsSessionInfoExit(enModemID)) || (TAF_MTC_SRV_EXIST == enPsSrvStatus)) { stAllModemState.stModemStateInfo[enModemID].enIsPsSrvConnExist = TAF_MTC_SRV_EXIST; } else { stAllModemState.stModemStateInfo[enModemID].enIsPsSrvConnExist = TAF_MTC_SRV_NO_EXIST; } stAllModemState.stModemStateInfo[enModemID].ucCsConnInfo = MTC_GetCsTypeInfo(enModemID); enCsSrvStatus = MTC_GetCsSrvState(enModemID); stAllModemState.stModemStateInfo[enModemID].enModemRatCfg = MTC_ConvertToRcmRatCfg(MTC_GetUsimStateInfo(enModemID), MTC_GetRatCfgByModemId(enModemID)); #if (FEATURE_ON == FEATURE_UE_MODE_CDMA) if ((MTC_RCM_MODEM_RAT_CFG_CL == stAllModemState.stModemStateInfo[enModemID].enModemRatCfg) || (MTC_RCM_MODEM_RAT_CFG_C == stAllModemState.stModemStateInfo[enModemID].enModemRatCfg)) { stAllModemState.stModemStateInfo[enModemID].enUsimmState = MTC_GetCsimStateInfo(enModemID); } else #endif { stAllModemState.stModemStateInfo[enModemID].enUsimmState = MTC_GetUsimStateInfo(enModemID); } if ( (PS_TRUE == MTC_IsCsSessionInfoExit(enModemID)) || (TAF_MTC_SRV_EXIST == enCsSrvStatus) ) { stAllModemState.stModemStateInfo[enModemID].enIsCsSrvConnExist = TAF_MTC_SRV_EXIST; } else { stAllModemState.stModemStateInfo[enModemID].enIsCsSrvConnExist = TAF_MTC_SRV_NO_EXIST; } } /* 外置modem状态信息 */ stAllModemState.stModemStateInfo[MTC_RCM_MODEM_OTHER].enIsCsSrvConnExist = MTC_GetOutSideCsConnStateInfo(MTC_OUTSIDE_MODEM_CDMA); stAllModemState.stModemStateInfo[MTC_RCM_MODEM_OTHER].enIsPsSrvConnExist = MTC_GetOutSidePsConnStateInfo(MTC_OUTSIDE_MODEM_CDMA); stAllModemState.stModemStateInfo[MTC_RCM_MODEM_OTHER].enPowerState = MTC_GetOutSideModemPowerState(MTC_OUTSIDE_MODEM_CDMA); stAllModemState.stModemStateInfo[MTC_RCM_MODEM_OTHER].enUsimmState = MTC_GetOutSideModemUsimmState(MTC_OUTSIDE_MODEM_CDMA); stAllModemState.stModemStateInfo[MTC_RCM_MODEM_OTHER].enModemRatCfg = MTC_RCM_MODEM_RAT_CFG_C; /* 发送消息 */ MTC_DEBUG_TraceEvent(&stAllModemState); return; }