kerneltest/e32test/usb/t_usb_device/src/activestallnotifier.cpp
changeset 253 d37db4dcc88d
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
252:0a40b8675b23 253:d37db4dcc88d
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 // Device-side part, to work against T_USB_HOST running on the host.
    16 // Device-side part, to work against T_USB_HOST running on the host.
    17 // 
    17 // 
    18 //
    18 //
    19 
    19 
    20 #include "general.h"									// CActiveControl, CActiveRW
    20 #include "general.h"									// CActiveControl, CActiveRW
       
    21 #include "OstTraceDefinitions.h"
       
    22 #ifdef OST_TRACE_COMPILER_IN_USE
       
    23 #include "activestallnotifierTraces.h"
       
    24 #endif
    21 #include "activestallnotifier.h"
    25 #include "activestallnotifier.h"
    22 
    26 
    23 extern RTest test;
    27 extern RTest test;
    24 extern TBool gVerbose;
    28 extern TBool gVerbose;
    25 extern TBool gSkip;
    29 extern TBool gSkip;
    54 
    58 
    55 
    59 
    56 CActiveStallNotifier::~CActiveStallNotifier()
    60 CActiveStallNotifier::~CActiveStallNotifier()
    57 	{
    61 	{
    58 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
    62 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::~CActiveStallNotifier()");
       
    63 	if(gVerbose)
       
    64 	    {
       
    65 	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DCACTIVESTALLNOTIFIER, "CActiveStallNotifier::~CActiveStallNotifier()");
       
    66 	    }
    59 	Cancel();												// base class
    67 	Cancel();												// base class
    60 	}
    68 	}
    61 
    69 
    62 
    70 
    63 void CActiveStallNotifier::DoCancel()
    71 void CActiveStallNotifier::DoCancel()
    64 	{
    72 	{
    65 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
    73 	TUSB_VERBOSE_PRINT("CActiveStallNotifier::DoCancel()");
       
    74 	if(gVerbose)
       
    75 	    {
       
    76 	    OstTrace0(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_DOCANCEL, "CActiveStallNotifier::DoCancel()");
       
    77 	    }
    66 	iPort->EndpointStatusNotifyCancel();
    78 	iPort->EndpointStatusNotifyCancel();
    67 	}
    79 	}
    68 
    80 
    69 
    81 
    70 void CActiveStallNotifier::RunL()
    82 void CActiveStallNotifier::RunL()
    71 	{
    83 	{
    72 	// This just displays the bitmap, showing which endpoints (if any) are now stalled.
    84 	// This just displays the bitmap, showing which endpoints (if any) are now stalled.
    73 	// In a real world program, the user could take here appropriate action (cancel a
    85 	// In a real world program, the user could take here appropriate action (cancel a
    74 	// transfer request or whatever).
    86 	// transfer request or whatever).
    75 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
    87 	TUSB_VERBOSE_PRINT1("StallNotifier: Endpointstate 0x%x\n", iEndpointState);
       
    88 	if(gVerbose)
       
    89 	    {
       
    90 	    OstTrace1(TRACE_VERBOSE, CACTIVESTALLNOTIFIER_RUNL, "StallNotifier: Endpointstate 0x%x\n", iEndpointState);
       
    91 	    }
    76 	Activate();
    92 	Activate();
    77 	}
    93 	}
    78 
    94 
    79 
    95 
    80 void CActiveStallNotifier::Activate()
    96 void CActiveStallNotifier::Activate()