telephonyprotocols/rawipnif/src/Receiver.cpp
branchRCL_3
changeset 16 fe8b59ab9fa0
parent 0 3553901f7fa8
child 17 3f227a47ad75
--- a/telephonyprotocols/rawipnif/src/Receiver.cpp	Mon Mar 15 12:45:06 2010 +0200
+++ b/telephonyprotocols/rawipnif/src/Receiver.cpp	Wed Mar 31 23:24:02 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -81,14 +81,16 @@
 	{
 	_LOG_L1C2(_L8("CReceiver::RunL [iStatus=%d]"), iStatus.Int());
 
-	if (iStatus!=KErrNone)
+	if (iStatus != KErrNone)
 		{
-		if(iStatus == KErrNoMemory)
+		if (iStatus == KErrNoMemory)
 			{
 			_LOG_L2C1(
 				_L8("WARNING! CReceiver: Read failed with KErrNoMemory"));
 			// Read operation failed!! Nif will re-issue the read request.
-			StartListening();
+		    (iObserver.Bca())->Read(iStatus, iData);
+
+		    SetActive();
 			}
 		else 
 			{
@@ -97,24 +99,29 @@
 			}
 		return;
 		}
-
-	_LOG_L1C1(_L8("CReceiver: Data Packet Received"));
-
-    iRMBufPacket.CreateL(iData);
-    iRMBufPacket.Pack();
-
-    // Immediately execute new read request.
-    StartListening();
-
+	else
+	    {
+        _LOG_L1C1(_L8("CReceiver: Data Packet Received"));
+    
+        iRMBufPacket.CreateL(iData);
+        
+        // Immediately execute new read request.
+        (iObserver.Bca())->Read(iStatus, iData);
+    
+        SetActive();
+        
+        iRMBufPacket.Pack();
+    
 #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
-    TUint16 protocolCode = iObserver.RemoveHeader(iRMBufPacket);
+        TUint16 protocolCode = iObserver.RemoveHeader(iRMBufPacket);
 #else
-    TUint16 protocolCode = 0;
+        TUint16 protocolCode = 0;
 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
-
-    // Process the packet
-    iObserver.GetObserver().Process(iRMBufPacket, protocolCode);
-    iRMBufPacket.Free();
+    
+        // Process the packet
+        iObserver.GetObserver().Process(iRMBufPacket, protocolCode);
+        iRMBufPacket.Free();
+	    }
 	}
 
 void CReceiver::DoCancel()