basebandadaptationplugins/basebandchanneladaptorforc32/te_c32bca/src/te_C32BcaUnitSteps.cpp
changeset 31 8ab6687fb94c
parent 0 3553901f7fa8
child 42 3adadc800673
--- a/basebandadaptationplugins/basebandchanneladaptorforc32/te_c32bca/src/te_C32BcaUnitSteps.cpp	Fri May 14 17:02:16 2010 +0300
+++ b/basebandadaptationplugins/basebandchanneladaptorforc32/te_c32bca/src/te_C32BcaUnitSteps.cpp	Thu May 27 14:05:07 2010 +0300
@@ -1540,30 +1540,31 @@
 TVerdict CIoctlSerialPort1::RunTestStepL()
 	{
 	LoadC32SettingsFromConfigFileL();
-	
+    
 	LoadCsyNameFromConfigFileL();
 	OpenRealCommPortL(iCommPort, iC32CsyName, iC32PortName);
-	
+    
 	LoadUutL();
 	SetProxyCsyL(*iUut, iC32CsyName);
-	
+    
 	iUut->Open(iC32PortName);
 	iUut->WaitForOpenL(KErrNone);
-	
+    
 	TCommConfig actualCommConfig;
 	iCommPort.Config(actualCommConfig);
 	actualCommConfig().iTerminatorCount = 1;
 	actualCommConfig().iTerminator[0] = 0x7E;
-	LogAndLeaveIfErrorL(iCommPort.SetConfig(actualCommConfig), _L("Setting COMM Config on RComm"));
-	
+
+	LogAndLeaveIfErrorL(iCommPort.SetConfig(actualCommConfig), _L("Setting COMM Config on RComm"));    
+    
 	TCommConfig balCommConfig;
 	// sanity check
 	TRAPD(err, CheckBuffersEqualL(balCommConfig, actualCommConfig));
 	if(KErrNone == err)
-		{
-		INFO_PRINTF1(_L("Santify Check Failure: buffers were equal before TCommConfig was retrieved from BCA."));
-		return EInconclusive;
-		}
+	{
+	INFO_PRINTF1(_L("Santify Check Failure: buffers were equal before TCommConfig was retrieved from BCA."));
+	return EInconclusive;
+	}
 
 	TPckgBuf<TCommConfig> argPckg(balCommConfig);
 	iUut->Ioctl(KBcaOptLevelExtSerial, KSerialConfig, argPckg);
@@ -1571,15 +1572,33 @@
 	balCommConfig = argPckg();
 
 	CheckBuffersEqualL(balCommConfig, actualCommConfig);
-	
+
+	// Now check that we can accept a V2 structure, although only the V1 attributes are configured for use.
+	TCommConfig2 actualCommConfig2;
+	actualCommConfig2.FillZ();
+	actualCommConfig2().iTerminatorCount = 2;
+	actualCommConfig2().iTerminator[0] = 0x7E;    
+	LogAndLeaveIfErrorL(iCommPort.SetConfig(actualCommConfig2), _L("Setting COMM Config using V2 on RComm"));
+
+	// Now check that we can retrieve a V1 structure correctly.
+	TCommConfig balCommConfig1;
+	balCommConfig1.FillZ();
+	TPckgBuf<TCommConfig> argPckg1(balCommConfig1);
+	iUut->Ioctl(KBcaOptLevelExtSerial, KSerialConfig, argPckg1);
+	iUut->WaitForIoctlL(KErrNone);
+	balCommConfig1 = argPckg1();
+
+	actualCommConfig().iTerminatorCount = 2;    //Modify Comparison Structure to be aligned to balCommConfig1          
+	CheckBuffersEqualL(balCommConfig1, actualCommConfig);
+    
 	iCommPort.Close();
-	
+    
 	iUut->Shutdown();
 	iUut->WaitForShutdownL(KErrNone);
-	
+    
 	UnloadUut();
-	
-	return EPass;
+    
+	return EPass;    
 	}
 
 /**
@@ -1777,7 +1796,7 @@
 /** Test C32 BCA open functionality with the different combinations of ChannelId*/
 TVerdict CValidChannelId::RunTestStepL()
 	{
-	TPtrC channelId;
+    TPtrC channelId;
 		
 	if(!GetStringFromConfig(ConfigSection(), _L("Port_Name1"), channelId))
 		{
@@ -1785,10 +1804,19 @@
 		return EAbort;
 		}
 		
-	// Pass channelId in the form of csyname::portname (ECUART::COMM::0) to the BCA
+	// Pass channelId in the form of:
+	// csyname::portname (ECUART::COMM::0) to the BCA
+	// where csyname  = ECUART
+	//       portname = COMM::0
+	// OR alternatively
+	// csyname::portname (PKTLOOPBACK::PKTLOOPBACK::501) 
+	// where csyname   = PKTLOOPBACK
+	//       portname  = PKTLOOPBACK::501
+	//       (PKTLOOPBACK port names contain a seemingly redundant PKTLOOPBACK in their specification).
+	LoadUutL();
+
+	// Scenario 1 - the CSY name is specified in the descriptor argument passed to the Open()
 	
-	LoadUutL();
-			
 	iUut->Open(channelId);
 	iUut->WaitForOpenL(KErrNone);
 	
@@ -1800,10 +1828,16 @@
 		return EAbort;
 		}
 		
-	// Pass channelId in the form of portname (COMM::0) to the BCA	
-		
+	// Pass channelId in the form of portname (COMM::0) to the BCA
+	//     OR
+	//                                         (PKTLOOPBACK::501) 
+
+	// Scenario 2 - the CSY name is not specified in the descriptor argument passed to the Open()
+	// In this case, the CSY name is retrieved from CommsDat, based on the IAP.
+	// The client specifies the IAP by call SetProxyIapIdL();
+	
 	LoadUutL();
-	
+
 	SetProxyIapIdL(*iUut, iUutIapId);
 	
 	iUut->Open(channelId);