kerneltest/e32test/device/t_usbapi.cpp
branchRCL_3
changeset 28 5b5d147c7838
parent 19 4a8fed1c0ef6
child 43 c1f20ce4abcf
equal deleted inserted replaced
26:c734af59ce98 28:5b5d147c7838
  1847 
  1847 
  1848 static void TestEndpointStallStatus()
  1848 static void TestEndpointStallStatus()
  1849 	{
  1849 	{
  1850 	test.Start(_L("Test Endpoint Stall Status"));
  1850 	test.Start(_L("Test Endpoint Stall Status"));
  1851 
  1851 
       
  1852 #ifdef BSW_USB_DRC
       
  1853 	// The MACRO comes from ncp adaptation to indicate that otg is built in.
       
  1854 	// Newly added code for defect ou1cimx1#267421. When otg is built in and the device is not 
       
  1855 	// in peripheral role, the ncp adaptation will return a dummy endpoint for the stall operation.
       
  1856 	// The solution is to check if the device is in peripheral mode, if not, skip the stall
       
  1857 	// operation. A problem is now we can't find a good solution to check the current role of the device.
       
  1858 	// For the test environement, it's ok to use the USB state to confirm and from the test result,
       
  1859 	// it works fine. Later when we find accurate method, we will change the confirmation logic.
       
  1860 	TInt ret = KErrNone;
       
  1861 
       
  1862 	TUsbcDeviceState devstate = EUsbcDeviceStateUndefined;
       
  1863 	ret = gPort.DeviceStatus(devstate);
       
  1864 	test(ret == KErrNone);
       
  1865 
       
  1866 	if( EUsbcDeviceStateUndefined==devstate )
       
  1867 		{
       
  1868 		test.Printf( _L("Device not connected, state EUsbcDeviceStateUndefined.\n")  );
       
  1869 		test.Printf( _L("Skipping endpoint stall status tests.\n") );
       
  1870 		test.End();
       
  1871 		return;
       
  1872 		}
       
  1873 #endif
       
  1874 
  1852 	if (!SupportsEndpointStall())
  1875 	if (!SupportsEndpointStall())
  1853 		{
  1876 		{
  1854 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
  1877 		test.Printf(_L("*** Not supported - skipping endpoint stall status tests\n"));
  1855 		test.End();
  1878 		test.End();
  1856 		return;
  1879 		return;