void DataManager::ParseSmsInfo(std::wstring key) { if ( m_smsMap.end() != m_smsMap.find(key) ) return; wchar_t dataPath[MAX_PATH] = {0}; wsprintfW(dataPath, L"%s\\%s", m_dirPath.c_str(), key.c_str()); if ( g_SetOutputDataDir ) g_SetOutputDataDir(dataPath); if ( !SMS_Start(dataPath) ) return; int recordCount = SMS_GetRecordCount(); if ( 0 == recordCount ) return; SMS_InfoMap infoMap; for ( int i = 0; i < recordCount; ++i ) { SMS_Info* info = SMS_GetRecordAt(i); SMS_Info copy; copy.isSend = info->isSend; copy.message = info->message; copy.name = info->name; copy.number = info->number; copy.time = info->time; infoMap.insert(std::pair<std::wstring, SMS_Info>(copy.number, copy)); } SMS_Free(); m_smsMap[key] = infoMap; }
VOS_VOID SMC_RcvLlcMsgDistr( VOS_VOID *pRcvMsg /* 收到的消息 */ ) { LL_SMS_UNITDATA_IND_MSG *pMsg; /*调用NAS_EventReport需要构造NAS_MSG_STRU*/ NAS_MSG_STRU *pNasMsg = VOS_NULL_PTR; VOS_UINT32 ulNasMsgLen; VOS_UINT32 ulMsgLen; if ( NAS_GMM_NET_RAT_TYPE_WCDMA == GMM_GetCurNetwork() ) { PS_NAS_LOG(WUEPS_PID_SMS, VOS_NULL, PS_LOG_LEVEL_WARNING, "SMC_RcvLlcMsgDistr:WARNING:In 3G mode, Message from LLC shouldn't be received"); return; } pMsg = (LL_SMS_UNITDATA_IND_MSG *)pRcvMsg; switch(((LL_SMS_UNITDATA_IND_MSG *)pRcvMsg)->usMsgType) { case ID_LL_UNITDATA_IND: /*Report event begin*/ ulMsgLen = ((LL_SMS_UNITDATA_IND_MSG *)pRcvMsg)->stUnitDataInd.usPduLen; if(ulMsgLen > 4) { ulNasMsgLen = (sizeof(NAS_MSG_STRU) + ulMsgLen) - 4; } else { ulNasMsgLen = sizeof(NAS_MSG_STRU); } pNasMsg = (NAS_MSG_STRU *)SMS_Malloc(ulNasMsgLen); if(VOS_NULL_PTR == pNasMsg) { PS_NAS_LOG(WUEPS_PID_SMS, VOS_NULL, PS_LOG_LEVEL_ERROR, "SMC_ReportM2NEvent:ERROR: pNasMsg is NULL"); } else { pNasMsg->ulNasMsgSize = ulMsgLen; SMS_Memcpy(pNasMsg->aucNasMsg, ((LL_SMS_UNITDATA_IND_MSG *)pRcvMsg)->stUnitDataInd.aucPdu, pNasMsg->ulNasMsgSize); SMS_ReportN2MOtaMsg(pNasMsg); SMS_Free(pNasMsg); } /*Report event end*/ if((((LL_SMS_UNITDATA_IND_MSG *)pRcvMsg)->stUnitDataInd.aucPdu[0]>>4)< 8) { /* 是mt过程 */ if(SMC_MT_IDLE != g_SmcCsEnt.SmcMt.ucState) { /* 同时有两个mt过程 */ SMC_SndGmmDataReq( SMC_DATA_TYPE_CP_ERR, SMS_CP_ERR_CONGEST, (VOS_UINT8)((((LL_SMS_UNITDATA_IND_MSG *)pRcvMsg)->stUnitDataInd. aucPdu[0]>>4) ) /* 向网侧发送CP_ERROR TI取接收到消息的TI */ ); /* 向网侧报错 */ } else { /* 调用mt的处理过程 */ SMC_RcvPsMtData((VOS_UINT8 *)(VOS_UINT32)pMsg->stUnitDataInd.aucPdu, pMsg->stUnitDataInd.usPduLen); } }