void CLogServBackupManager::BISetDatabaseNameL(const TDesC& aDatabaseName) { #ifdef LOGGING_ENABLED LOGTEXT3("CLogServBackupManager::BISetDatabaseNameL(%S, isActive: %d)", &aDatabaseName, IsActive()); if (iDatabaseName) { LOGTEXT2("CLogServBackupManager::BISetDatabaseNameL() - currently registered database filename is: %S", iDatabaseName); } else { LOGTEXT("CLogServBackupManager::BISetDatabaseNameL() - no file registered with backup interface yet"); } #endif Cancel(); HBufC* databaseName = aDatabaseName.AllocLC(); // If we haven't already created a backup observer, then we need // to kick the object back into life again. if (!iBackup) { LOGTEXT("CLogServBackupManager::BISetDatabaseNameL() - no backup session created"); // Try and create backup interface synchronously first of all, if that fails // then construct as an idle operation TRAPD(err, iBackup = CreateBackupL(*databaseName)); LOGTEXT2("CLogServBackupManager::BISetDatabaseNameL() - backup session creation error: %d", err); if (err != KErrNone) After(0); } else if (iDatabaseName->Compare(aDatabaseName) != KErrNone) { LOGTEXT3("CLogServBackupManager::BISetDatabaseNameL() - database filename changed from %S to %S", &iDatabaseName, &aDatabaseName); // De register the old, register the new iBackup->DeregisterFile(*iDatabaseName); iBackup->RegisterFileL(aDatabaseName, *this); LOGTEXT("CLogServBackupManager::BISetDatabaseNameL() - database re-registration complete"); } delete iDatabaseName; iDatabaseName = databaseName; CleanupStack::Pop(databaseName); LOGTEXT("CLogServBackupManager::BISetDatabaseNameL() - end"); }
// --------------------------------------------------------------------------- // CAtSmsStoreReadAll::EventSignal // other items were commented in a header // --------------------------------------------------------------------------- void CAtSmsStoreReadAll::EventSignal(TAtEventSource aEventSource, TInt aStatus) { LOGTEXT3(_L8("CAtSmsStoreReadAll::EventSignal aStatus=%D iSource=%D"), aStatus,aEventSource); if(aStatus == KErrNone) { if((aEventSource == EWriteCompletion)) { LOGTEXT(_L8("CAtSmsStoreRead::EventSignal,EWriteCompletion!")); return; } aStatus = iError; } if(iIndex < iPhoneGlobals.iStoreTotal) { iCtsyDispatcherCallback.CallbackPhonebookSmsStoreReadAllComp(aStatus,iSmsData,iIndex,ETrue,EFalse); iIndex++; ReadMessage(); } else { //Handle last message Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackPhonebookSmsStoreReadAllComp(aStatus,iSmsData,iIndex,EFalse,EFalse); } }
// --------------------------------------------------------------------------- // CAtPhbkEnGetInfo::EventSignal // other items were commented in a header // --------------------------------------------------------------------------- void CAtPhbkEnGetInfo::EventSignal(TAtEventSource aEventSource, TInt aStatus) { LOGTEXT3(_L8("CAtPhbkEnGetInfo::EventSignal aStatus=%D iSource=%D"),aStatus,aEventSource); if(aStatus != KErrNone) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackPhonebookEnStoreGetInfoComp(aStatus,iUsed); } else { if( aEventSource == EWriteCompletion ) { LOGTEXT(_L8("CAtPhbkEnGetInfo::EventSignal,EWriteCompletion!")); if( iState==ESetEnStore ) { iState = ESetEnStoreComplete; } else if( iState==EGetEnStoreInfo ) { iState = EGetEnStoreInfoComplete; } } else { LOGTEXT(_L8("CAtPhbkEnGetInfo::EventSignal,EReadCompletion!")); if( iState == ESetEnStoreComplete ) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; if(iError == KErrNone) { iState = EGetEnStoreInfo; GetEnStoreInfo(); } else { iCtsyDispatcherCallback.CallbackPhonebookEnStoreGetInfoComp(iError,iUsed); } } else if( iState == EGetEnStoreInfoComplete ) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackPhonebookEnStoreGetInfoComp(iError,iUsed); } } } }
// --------------------------------------------------------------------------- // CAtSmsAck::EventSignal // other items were commented in a header // --------------------------------------------------------------------------- void CAtSmsAck::EventSignal(TAtEventSource aEventSource, TInt aStatus) { LOGTEXT3(_L8("CAtSmsAck::EventSignal aStatus=%D iSource=%D"),aStatus,aEventSource); if(aStatus == KErrNone) { if((aEventSource == EWriteCompletion)) { LOGTEXT(_L8("CAtSmsNack::EventSignal,EWriteCompletion!")); return; } aStatus = iError; } Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackSmsAckSmsStoredComp(aStatus); }
TInt CLogServBackupManager::NotifyObservers(MLogServBackupObserver::TLogServBackupEvent aEvent) // // Notify observers of the event. Assumes event queue correctly ordered. // { const TInt count = iObservers.Count(); LOGTEXT3("CLogServBackupManager::NotifyObservers(aEvent = %d) - %d observers", aEvent, count); // Depending on the event type, we have to reverse the order of notification. // I wish it was possible to do this in a more elegant way... hmm... pointers // to member functions?... TInt error = KErrNone; TRAP(error, // switch(aEvent) { case MLogServBackupObserver::EBackupStarting: { // Update our state iState = ELogServBackupStateBackupInProgress; // Notify for(TInt i=0; i<count; i++) { TLogBackupNotificationEntry& entry = iObservers[i]; entry.iObserver.BOHandleEventL(aEvent); } } break; case MLogServBackupObserver::EBackupEnded: { // Update our state iState = ELogServBackupStateIdle; // Notify for(TInt i=count-1; i>=0; i--) { TLogBackupNotificationEntry& entry = iObservers[i]; entry.iObserver.BOHandleEventL(aEvent); } } break; } );
// --------------------------------------------------------------------------- // CAtSmsNack::EventSignal // other items were commented in a header // --------------------------------------------------------------------------- void CAtSmsNack::EventSignal(TAtEventSource aEventSource, TInt aStatus) /** * Handle the events from the comm port *ValidateExpectString * @param aSource denotes if event is due to read, write or timeout */ { LOGTEXT3(_L8("CAtSmsNack::EventSignal iStatus=%D iSource=%D"),aStatus,aEventSource); if(aStatus == KErrNone) { if((aEventSource == EWriteCompletion)) { LOGTEXT(_L8("CAtSmsNack::EventSignal,EWriteCompletion!")); return; } aStatus = iError; } Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackSmsAckSmsStoredComp(aStatus); }
void CATWaitForCall::ParseNetworkRegistrationL() { // +CREG: <n>, <stat> [, <lac>, <ci> ] -- solicited // +CREG: <stat> [, <lac>, <ci> ] -- unsolicited // number, number [, "hex", "hex" ] RMobilePhone::TMobilePhoneLocationAreaV1& locationInfo = iPhoneGlobals->iPhoneStatus.iLocationArea; locationInfo.iAreaKnown= EFalse; locationInfo.iLocationAreaCode=0; locationInfo.iCellId=0; ParseLineLC(); CATParamListEntry* entry; TDblQueIter<CATParamListEntry> iter(iRxResults); entry=iter++; if (entry==NULL) User::Leave(KErrGeneral); // should be +CREG: entry=iter++; if (entry==NULL) User::Leave(KErrGeneral); TLex8 lex(entry->iResultPtr); TInt number; (void)User::LeaveIfError(lex.Val(number)); entry=iter++; if (entry!=NULL) { // is this <status> in a solicited +CREG? lex.Assign(entry->iResultPtr); if (lex.Val(number)==KErrNone) entry=iter++; // yes - <n> has been replaced by <status> } // optional <lac> and <ci> if (entry != NULL) { lex.Assign(entry->iResultPtr); (void)User::LeaveIfError(lex.Val(locationInfo.iLocationAreaCode,EHex)); locationInfo.iAreaKnown = ETrue; entry=iter++; } if (entry!=NULL) { lex.Assign(entry->iResultPtr); (void)User::LeaveIfError(lex.Val(locationInfo.iCellId,EHex)); locationInfo.iAreaKnown = ETrue; } if (number<0 || number > RMobilePhone::ERegisteredRoaming) User::Leave(KErrGeneral); RMobilePhone::TMobilePhoneRegistrationStatus regstatus; regstatus = MappingRegistrationStatusFromETSIToMM(&number); //Mapp the ETSI value number to MM enum for network registration status. RMobilePhone::TMobilePhoneRegistrationStatus newstatus = regstatus;// change number to be of type MobilePhone... RMobilePhone::TMobilePhoneRegistrationStatus oldstatus = iPhoneGlobals->iPhoneStatus.iRegistrationStatus; if (oldstatus != newstatus) { LOGTEXT3(_L8("MmTsy:CATWaitForCall:\tRegistrationStatus changed %d->%d"), oldstatus, newstatus); iPhoneGlobals->iPhoneStatus.iRegistrationStatus = newstatus; iPhoneGlobals->iNotificationStore->CheckNotification(iTelObject,ERegistrationStatusChanged); if ( (newstatus == RMobilePhone::ERegisteredOnHomeNetwork || newstatus == RMobilePhone::ERegisteredRoaming) || (oldstatus == RMobilePhone::ERegisteredOnHomeNetwork || oldstatus == RMobilePhone::ERegisteredRoaming) ) { // interesting transition - need new operator details LOGTEXT(_L8("MmTsy:CATWaitForCall:\tCurrent Network has changed")); iPhoneGlobals->iPhoneStatus.iNetworkChanged=ETrue; if (iPhoneGlobals->iPhoneStatus.iInitStatus == EPhoneInitialised && !iPhoneGlobals->iEventSignalActive) { // no current activity - fire up +COPS stuff immediately LOGTEXT(_L8("MmTsy:CATWaitForCall:\tNo activity - Checking current network immediately")); iPhoneGlobals->CheckForChangeOfNetwork(); } } } CleanupStack::PopAndDestroy(); }
// --------------------------------------------------------------------------- // CAtPhbkEnGetInfo::ParseResponseL // other items were commented in a header // --------------------------------------------------------------------------- void CAtPhbkEnGetInfo::ParseResponseL(const TDesC8& /*aResponseBuf*/) { if( iState==ESetEnStoreComplete ) { if (CurrentLine().Match(KLtsyOkString) == 0) { iError = KErrNone; } else { iError = KErrGeneral; } } else if( iState==EGetEnStoreInfoComplete ) { /** * Here is an Example * +CPBS: "EN",2,16 * phonebooken is selected,2 locations are used and * total 16 locations are available */ iError = KErrNone; RArray<TPtrC8> array; CleanupClosePushL(array); iParser->ParseRespondedBuffer(array,Buffer()); //remove AT+CPBS if(array[0].MatchF(KAnyATCommand)!=KErrNotFound) { array.Remove(0); } TInt count = array.Count(); #ifdef _DEBUG for( TInt i=0;i<count;i++ ) { LOGTEXT3(_L8("CAtPhbkEnGetInfo::ParseResponseL\tarray[%d]=%S"), i,&array[i]); } #endif if (count <= 1) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } if(array[0].MatchF(KCPBSResponseString)==KErrNotFound) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } //parse used TLex8 lex(array[2]); TUint16 val; TInt ret=lex.Val(val,EDecimal); if(ret!=KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iUsed = val; //parse total TLex8 lex1(array[3]); ret=lex1.Val(val,EDecimal); if(ret!=KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iTotal = val; LOGTEXT3(_L8("CAtPhbkEnGetInfo::ParseResponseL\tPreferred store used=%d, total=%d"), iUsed,iTotal); CleanupStack::PopAndDestroy(&array); } }
// --------------------------------------------------------------------------- // CAtPhbkStoreRead::ParseResponseL // other items were commented in a header // --------------------------------------------------------------------------- void CAtPhbkStoreRead::ParseResponseL(const TDesC8& /*aResponseBuf*/) { if( iState == ESetStoreNameComplete ) { if (CurrentLine().Match(KLtsyOkString) == 0) { iError = KErrNone; } else { iError = KErrGeneral; } } else if( iState == EReadEntryComplete ) { /** * +CPBR = <index>,<number>,<129/145>,<text> * OK */ RArray<TPtrC8> array; CleanupClosePushL(array); iParser->ParseRespondedBuffer(array,Buffer()); // remove the string of AT+CPBR=.. if(array[0].MatchF(KAnyATCommand) != KErrNotFound) { array.Remove(0); } TInt count = array.Count(); #ifdef _DEBUG for( TInt i=0;i<count;i++ ) { LOGTEXT3(_L8("CAtPhbkStoreRead::ParseResponseL\tarray[%d]=%S"),i,&array[i]); } #endif if((array[1].Match(KLtsyOkString) == KErrNone)) { CleanupStack::PopAndDestroy(); iError = KErrNone; iEndFlag = ETrue; return; } else if((array[1].Match(KLtsyErrorString) == KErrNone)) { CleanupStack::PopAndDestroy(); iError = KErrGeneral; iEndFlag = ETrue; return; } iError = KErrNone; //remove number line if it has if( array[0].MatchF(KCPBRSResponseString) == KErrNotFound ) { array.Remove(0); } if( array[0].MatchF(KCPBRSResponseString) == KErrNotFound ) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } //parse index TLex8 lex(array[1]); TUint16 val; TInt ret = lex.Val(val,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } //Index iReadEntry.iIndex = val; iReadEntry.iNumber.Copy(array[2]); //Parse TON/NPI TLex8 lex1(array[3]); TUint16 val1; ret = lex1.Val(val1,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } //TON/NPI iReadEntry.iTon = (TUint8)val1; iReadEntry.iText.Copy(array[4]); CleanupStack::PopAndDestroy(); } }
// --------------------------------------------------------------------------- // CAtPhbkStoreRead::EventSignal // other items were commented in a header // --------------------------------------------------------------------------- void CAtPhbkStoreRead::EventSignal(TAtEventSource aEventSource, TInt aStatus) { LOGTEXT3(_L8("CAtPhbkStoreRead::EventSignal aStatus=%D iSource=%D"),aStatus,aEventSource); if(aStatus != KErrNone) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; iCtsyDispatcherCallback.CallbackPhonebookStoreReadEntryComp(aStatus,iPhoneBookType,iPhbkData); } else { if( aEventSource== EWriteCompletion ) { if( iState==ESetStoreName ) { iState = ESetStoreNameComplete; } else if( iState==EReadEntry ) { iState = EReadEntryComplete; } } else { if( iState==ESetStoreNameComplete ) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; if(iError == KErrNone) { ClearBuffer(); iState = EReadEntry; ReadEntry(); } else { iCtsyDispatcherCallback.CallbackPhonebookStoreReadEntryComp(iError,iPhoneBookType,iPhbkData); } } else if( iState==EReadEntryComplete ) { Complete(); iPhoneGlobals.iEventSignalActive = EFalse; //encounter OK or ERROR if( iEndFlag ) { ClearBuffer(); iPhbkData.Zero(); iCtsyDispatcherCallback.CallbackPhonebookStoreReadEntryComp(iError,iPhoneBookType,iPhbkData); } else { if( iError==KErrNone ) { TRAPD(err, GeneratePhbkDataL()); iCtsyDispatcherCallback.CallbackPhonebookStoreReadEntryComp(err,iPhoneBookType,iPhbkData); ClearCurrentLine(); } else { iCtsyDispatcherCallback.CallbackPhonebookStoreReadEntryComp(iError,iPhoneBookType,iPhbkData); } } } } } }
// --------------------------------------------------------------------------- // CAtPhbkGetPhoneStoreInfo::ParseResponseL // other items were commented in a header // --------------------------------------------------------------------------- void CAtPhbkGetPhoneStoreInfo::ParseResponseL(const TDesC8& /*aResponseBuf*/) { if( iState == ESetPhoneStoreComplete ) { if (CurrentLine().Match(KLtsyOkString) == 0) { iError = KErrNone; } else { iError = KErrGeneral; } } else if( iState == EGetPhoneStoreInfoComplete ) { /** * Here is an Example * +CPBS: "SM",6,250 * ADN phonebook is selected,6 locations are used and * total 250 locations are available */ iError = KErrNone; RArray<TPtrC8> array; CleanupClosePushL(array); iParser->ParseRespondedBuffer(array,Buffer()); //remove AT+CPBS if(array[0].MatchF(KAnyATCommand) != KErrNotFound) { array.Remove(0); } TInt count = array.Count(); #ifdef _DEBUG for( TInt i=0;i<count;i++ ) { LOGTEXT3(_L8("CAtPhbkGetPhoneStoreInfo::ParseResponseL\tarray[%d]=%S"), i,&array[i]); } #endif if (count <= 1) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } if(array[0].MatchF(KCPBSResponseString) == KErrNotFound) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } //parse used TLex8 lex(array[2]); TUint16 val; TInt ret = lex.Val(val,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iPhoneStoreInfo.iUsedEntries = val; //parse total TLex8 lex1(array[3]); ret = lex1.Val(val,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iPhoneStoreInfo.iTotalEntries = val; iPhoneStoreInfo.iType = RMobilePhoneStore::EPhoneBookStore; LOGTEXT3(_L8("CAtPhbkGetPhoneStoreInfo::ParseResponseL\tPreferred store used=%d, total=%d"), iPhoneStoreInfo.iUsedEntries,iPhoneStoreInfo.iTotalEntries); CleanupStack::PopAndDestroy(&array); } else { /** * Parse result of AT+CPMS? * Response:+CPMS:<mem1>,<used1>,<total1>,<mem2>,<used2>,<total2> * Here only the first mem is used. mem1 is SM */ iError = KErrNone; RArray<TPtrC8> array; CleanupClosePushL(array); iParser->ParseRespondedBuffer(array,Buffer()); if(array[0].MatchF(KAnyATCommand) != KErrNotFound) { array.Remove(0); } TInt Count = array.Count(); if (Count <= 1) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } if(array[0].MatchF(KCPMSResponseString) == KErrNotFound) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } //parse name TPtrC8 name(array[1]); //parse used TLex8 lex(array[2]); TUint16 val; TInt ret = lex.Val(val,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iPhoneStoreInfo.iUsedEntries = val; //parse total TLex8 lex1(array[3]); ret = lex1.Val(val,EDecimal); if(ret != KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iPhoneStoreInfo.iTotalEntries = val; iPhoneStoreInfo.iType = RMobilePhoneStore::EShortMessageStore; LOGTEXT3(_L8("CAtPhbkGetPhoneStoreInfo::ParseResponseL\tPreferred store used=%d, total=%d"), iPhoneStoreInfo.iUsedEntries,iPhoneStoreInfo.iTotalEntries); CleanupStack::PopAndDestroy(&array); } }
int CDirectXRenderLayer::validateDeviceCapabilities(unsigned int adapter, TRasterizationType rasterization) { bool passed = true; LOGTEXT2("Validating capabilities for device#%d...", adapter); if (mD3DInterface) { D3DCAPS9 deviceCaps; D3DDEVTYPE devType = convertRasterizationTypeToDevType(rasterization); if (SUCCEEDED(mD3DInterface->GetDeviceCaps(adapter, devType, &deviceCaps))) { // ----------------ERRORS---------------- if ((deviceCaps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) == 0) { LOGTEXT(" ERROR: Device does not support a presentation swap interval of every screen refresh"); passed = false; } if ((deviceCaps.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) == 0) { LOGTEXT(" ERROR: Device does not support (As, As, As, As) blend factor"); passed = false; } if ((deviceCaps.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) == 0) { LOGTEXT(" ERROR: Device does not support (1 - As, 1 - As, 1 - As, 1 - As) blend factor"); passed = false; } if ((deviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHA) == 0) { LOGTEXT(" ERROR: Device does not support alpha in texture pixels"); passed = false; } if ((deviceCaps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) == 0) { LOGTEXT(" ERROR: Device does not support per-stage bilinear interpolation filtering for magnifying mipmaps"); passed = false; } if ((deviceCaps.TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) == 0) { LOGTEXT(" ERROR: Device does not support per-stage bilinear filtering for minifying textures"); passed = false; } if ((deviceCaps.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) == 0) { LOGTEXT(" ERROR: Device does not support wrapping of textures to addresses"); passed = false; } if (deviceCaps.MaxTextureWidth < MIN_TEXTURE_SIZE || deviceCaps.MaxTextureHeight < MIN_TEXTURE_SIZE) { LOGTEXT3(" ERROR: Device does not support %dx%d or greater texture dimensions", MIN_TEXTURE_SIZE, MIN_TEXTURE_SIZE); passed = false; } if ((deviceCaps.TextureOpCaps & D3DTEXOPCAPS_MODULATE) == 0) { LOGTEXT(" ERROR: Device does not support texture-blending operation of modulation"); passed = false; } if (deviceCaps.MaxVertexIndex < (VERTEX_BUFFER_LENGTH - 1)) { LOGTEXT(" ERROR: Device does not support required max vertex index"); passed = false; } if ((deviceCaps.StretchRectFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) == 0) { LOGTEXT(" ERROR: Device does not support bilinear interpolation filtering for minifying rectangles"); passed = false; } if ((deviceCaps.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) == 0) { LOGTEXT(" ERROR: Device does not support bilinear interpolation filtering for magnifying rectangles"); passed = false; } if ((deviceCaps.DevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) == 0) { LOGTEXT(" ERROR: Device cannot retrieve textures from video memory"); passed = false; } // ---------------WARNINGS--------------- // add warnings here } else { LOGTEXT(" ERROR: GetDeviceCaps() failed"); passed = false; } } else { LOGTEXT(" ERROR: D3DInterface is not initialized"); passed = false; } if (passed) { LOGTEXT("Validation passed"); return E_SUCCESS; } LOGTEXT("Validation failed"); return E_FAILED; }
void CATBase::RemoveUnsolicitedStrings() { LOGTEXT(_L8("RemoveUnsolicitedStrings()")); _LIT8(KNetworkRegistration,"+CREG:"); // Network registration _LIT8(KIncomingCallIndication,"RING"); // Normal Ring _LIT8(KIncomingExtCallIndication,"+CRING:"); // Extended format call _LIT8(KIncomingExtNTCallParameter,"REL"); // Non-Transparent parameter _LIT8(KIncomingExtAlternatingCallParameter,"ALT"); // Unsupported Alternating parameter _LIT8(KIncomingExtVoiceRelCallParameter,"VOICE/REL"); // NT Voice parameter if(!iRxResults.IsEmpty()) { TInt aQueueSteps = NULL; CATParamListEntry* entry; TDblQueIter<CATParamListEntry> iter(iRxResults); // Step along the queue looking for an unsolicited strings while (entry = iter++,entry!=NULL) { TPtrC8 aResult(entry->iResultPtr); // If a match is found, we dequeue it and all its expected parameters if (aResult==KIncomingCallIndication) // 0 Params { // Remove the "RING" entry->Deque(); delete entry; LOGTEXT2(_L8("Unsolicited >%S< Removed"),&aResult); } else if (aResult==KIncomingExtCallIndication) // 1/2 Params { // Remove the "+CRING:" entry->Deque(); delete entry; entry = iter++; LOGTEXT2(_L8("Unsolicited >%S< Removed"),&aResult); // We know we should be getting at least one and maybee two parameters TPtrC8 aFirstParameterResult(entry->iResultPtr); if (aFirstParameterResult==KIncomingExtNTCallParameter || aFirstParameterResult==KIncomingExtVoiceRelCallParameter || aFirstParameterResult==KIncomingExtAlternatingCallParameter) { // We have an "ALT" or a "REL" so we have two parameters entry->Deque(); delete entry; entry = iter++; TPtrC8 aSecondParameterResult(entry->iResultPtr); entry->Deque(); delete entry; // If recognised parameter - remove LOGTEXT3(_L8("Unsolicited Parameter >%S %S< Removed"),&aFirstParameterResult,&aSecondParameterResult); aSecondParameterResult==KIncomingCallIndication; // Quick fix to remove unused parameters make warning } else { // We only have one parameter entry->Deque(); delete entry; // If recognised parameter - remove LOGTEXT2(_L8("Unsolicited Parameter >%S< Removed"),&aFirstParameterResult); } } else if (aResult==KNetworkRegistration) // 2 Params { // Remove the "+CREG:" entry->Deque(); delete entry; entry = iter++; LOGTEXT2(_L8("Unsolicited >%S< Removed"),&aResult); // Remove both parameters TPtrC8 aFirstParameterResult(entry->iResultPtr); entry->Deque(); delete entry; entry = iter++; TPtrC8 aSecondParameterResult(entry->iResultPtr); entry->Deque(); delete entry; LOGTEXT3(_L8("Unsolicited Parameters >%S,%S< Removed"),&aFirstParameterResult,&aSecondParameterResult); aFirstParameterResult==KIncomingCallIndication; aSecondParameterResult==KIncomingCallIndication; // Quick fix to remove unused parameters make warning } // Increment the queue step counter else aQueueSteps++; } // Now we have to retrace the list, ignoring dequeued entries for (TInt aLoop=NULL;aLoop<aQueueSteps;aLoop++) iter--; } }
// --------------------------------------------------------------------------- // CAtSmsStoreReadAll::ParseResponseL // other items were commented in a header // --------------------------------------------------------------------------- void CAtSmsStoreReadAll::ParseResponseL(const TDesC8& /*aResponseBuf*/) { /** * Response:+CMGR:<stat>,[<alpha>],<length><CR><LF><pdu> */ iError = KErrNone; RArray<TPtrC8> array; CleanupClosePushL(array); iParser->ParseRespondedBuffer(array,Buffer()); if(array[0].MatchF(KAnyATCommand)!=KErrNotFound) { array.Remove(0); } TInt count = array.Count(); #ifdef _DEBUG for( TInt i=0;i<count;i++ ) { LOGTEXT3(_L8("CAtSmsStoreReadAll::ParseResponseL\tarray[%d]=%S"),i,&array[i]); } #endif if (count <= 1) { CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } if(array[0].MatchF(KCMGRResponseString)==KErrNotFound) { LOGTEXT(_L8("CAtSmsStoreReadAll::ParseResponseL\tFound +CMGR String!")); CleanupStack::PopAndDestroy(); iError = KErrNotFound; return; } // parse the message status TLex8 lex(array[1]); TUint16 val; TInt ret=lex.Val(val,EDecimal); if(ret!=KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } iSmsData.iMessageStatus = val; //parse the message length TLex8 lex1(array[3]); TUint msgLength; ret=lex1.Val(msgLength,EDecimal); if(ret!=KErrNone) { CleanupStack::PopAndDestroy(); iError = ret; return; } LOGTEXT2(_L8("CAtSmsStoreReadAll::ParseResponseL\tMessage Length=%d"),msgLength); TBuf8<KMaxAsciiPduLength> pdu; //Binary Message pdu SmsAtUtil::ConvertAsciiToBinary(array[4],pdu); TPtrC8 pduPtr(pdu); RMobilePhone::TMobileAddress gsmServiceCentre; //messages's SCA if (msgLength*2 < array[4].Length()) { // There is an SCA prepended so remove this and store it in iGsmServiceCentre SmsAtUtil::ReadAndRemoveAddressFromPdu(pduPtr,gsmServiceCentre); } iSmsData.iSmsMsg = pduPtr; iSmsData.iServiceCentre = gsmServiceCentre.iTelNumber; iSmsData.iMobileScNPI = gsmServiceCentre.iNumberPlan; iSmsData.iMobileScTON = gsmServiceCentre.iTypeOfNumber; LOGTEXT2(_L8("CAtSmsStoreReadAll::ParseResponseL\tMessage Status=%d"), iSmsData.iMessageStatus); LOGTEXT3(_L8("CAtSmsStoreReadAll::ParseResponseL\tSmsMsg=%S, ServiceCentre=%S"), &iSmsData.iSmsMsg, &iSmsData.iServiceCentre); CleanupStack::PopAndDestroy(&array); }