usbengines/usbotgwatcher/src/cusbstatehostaperipheral.cpp
branchRCL_3
changeset 65 a44cdf4b4bf0
parent 0 1e05558e2206
child 21 ff9df6630274
equal deleted inserted replaced
64:8ecef05bbada 65:a44cdf4b4bf0
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation
       
    15  *
     8  *
    16 */
     9  * Initial Contributors:
    17 
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Implementation
       
    15  *
       
    16  */
    18 
    17 
    19 #include <usbuinotif.h>
    18 #include <usbuinotif.h>
    20 
    19 
    21 #include "cusbstatehostaperipheral.h"
    20 #include "cusbstatehostaperipheral.h"
    22 
       
    23 #ifndef STIF
       
    24 #include "cusbnotifmanager.h"
       
    25 #include "cusbtimer.h"
       
    26 #else
       
    27 #include "mockcusbnotifmanager.h"
       
    28 #include "mockcusbtimer.h"
       
    29 #endif
       
    30 
    21 
    31 #include "errors.h"
    22 #include "errors.h"
    32 #include "debug.h"
    23 #include "debug.h"
    33 #include "panic.h"
    24 #include "panic.h"
    34 
    25 
    35 // ---------------------------------------------------------------------------
    26 // ---------------------------------------------------------------------------
    36 // 
    27 // 
    37 // ---------------------------------------------------------------------------
    28 // ---------------------------------------------------------------------------
    38 //
    29 //
    39 CUsbStateHostAPeripheral::CUsbStateHostAPeripheral(CUsbOtgWatcher* aWatcher) :
    30 CUsbStateHostAPeripheral::CUsbStateHostAPeripheral(CUsbOtgWatcher& aWatcher) :
    40     CUsbStateHostABase(aWatcher)
    31     CUsbStateHostABase(aWatcher)
    41     {
    32     {
    42     }
    33     }
    43 
    34 
    44 // ---------------------------------------------------------------------------
    35 // ---------------------------------------------------------------------------
    45 // 
    36 // 
    46 // ---------------------------------------------------------------------------
    37 // ---------------------------------------------------------------------------
    47 //
    38 //
    48 void CUsbStateHostAPeripheral::ConstructL()
    39 void CUsbStateHostAPeripheral::ConstructL()
    49     {
    40     {
    50         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::ConstructL" ) );
    41     LOG_FUNC
    51 
    42 
    52     CUsbStateHostABase::ConstructL();
    43     CUsbStateHostABase::ConstructL();
    53     }
    44     }
    54 
    45 
    55 // ---------------------------------------------------------------------------
    46 // ---------------------------------------------------------------------------
    56 // 
    47 // 
    57 // ---------------------------------------------------------------------------
    48 // ---------------------------------------------------------------------------
    58 //
    49 //
    59 CUsbStateHostAPeripheral* CUsbStateHostAPeripheral::NewL(
    50 CUsbStateHostAPeripheral* CUsbStateHostAPeripheral::NewL(
    60         CUsbOtgWatcher* aWatcher)
    51         CUsbOtgWatcher& aWatcher)
    61     {
    52     {
    62         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::NewL" ) );
    53     LOG_FUNC
    63 
    54 
    64     CUsbStateHostAPeripheral* self = new (ELeave) CUsbStateHostAPeripheral(
    55     CUsbStateHostAPeripheral* self = new (ELeave) CUsbStateHostAPeripheral(
    65             aWatcher);
    56             aWatcher);
    66     CleanupStack::PushL(self);
    57     CleanupStack::PushL(self);
    67     self->ConstructL();
    58     self->ConstructL();
    73 // 
    64 // 
    74 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
    75 //
    66 //
    76 CUsbStateHostAPeripheral::~CUsbStateHostAPeripheral()
    67 CUsbStateHostAPeripheral::~CUsbStateHostAPeripheral()
    77     {
    68     {
    78         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::~CUsbStateHostAPeripheral" ) );
    69     LOG_FUNC
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // 
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 void CUsbStateHostAPeripheral::JustAdvancedToThisStateL()
       
    86     {
       
    87         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::JustAdvancedToThisStateL" ) );
       
    88     iWatcher->PrintStateToLog();
       
    89     }
    70     }
    90 
    71 
    91 // ---------------------------------------------------------------------------
    72 // ---------------------------------------------------------------------------
    92 // 
    73 // 
    93 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    94 //
    75 //
    95 TUsbStateIds CUsbStateHostAPeripheral::Id()
    76 TUsbStateIds CUsbStateHostAPeripheral::Id()
    96     {
    77     {
    97         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::Id" ) );
       
    98     return EUsbStateHostAPeripheral;
    78     return EUsbStateHostAPeripheral;
    99     }
    79     }
   100 
    80 
   101 // From OTG state observer
    81 // From OTG state observer
   102 
    82 
   104 // 
    84 // 
   105 // ---------------------------------------------------------------------------
    85 // ---------------------------------------------------------------------------
   106 //
    86 //
   107 void CUsbStateHostAPeripheral::AHostL()
    87 void CUsbStateHostAPeripheral::AHostL()
   108     {
    88     {
   109         FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::AHostL" ) );
    89     LOG_FUNC
   110         ChangeHostStateL(EUsbStateHostAInitiate);
    90     ChangeHostStateL( EUsbStateHostAInitiate);
   111     }
    91     }
   112 
    92