|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <usbuinotif.h> |
|
20 |
|
21 #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 |
|
31 #include "errors.h" |
|
32 #include "debug.h" |
|
33 #include "panic.h" |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 CUsbStateHostAPeripheral::CUsbStateHostAPeripheral(CUsbOtgWatcher* aWatcher) : |
|
40 CUsbStateHostABase(aWatcher) |
|
41 { |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 void CUsbStateHostAPeripheral::ConstructL() |
|
49 { |
|
50 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::ConstructL" ) ); |
|
51 |
|
52 CUsbStateHostABase::ConstructL(); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CUsbStateHostAPeripheral* CUsbStateHostAPeripheral::NewL( |
|
60 CUsbOtgWatcher* aWatcher) |
|
61 { |
|
62 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::NewL" ) ); |
|
63 |
|
64 CUsbStateHostAPeripheral* self = new (ELeave) CUsbStateHostAPeripheral( |
|
65 aWatcher); |
|
66 CleanupStack::PushL(self); |
|
67 self->ConstructL(); |
|
68 CleanupStack::Pop(self); |
|
69 return self; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CUsbStateHostAPeripheral::~CUsbStateHostAPeripheral() |
|
77 { |
|
78 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::~CUsbStateHostAPeripheral" ) ); |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 void CUsbStateHostAPeripheral::JustAdvancedToThisStateL() |
|
86 { |
|
87 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::JustAdvancedToThisStateL" ) ); |
|
88 iWatcher->PrintStateToLog(); |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 TUsbStateIds CUsbStateHostAPeripheral::Id() |
|
96 { |
|
97 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::Id" ) ); |
|
98 return EUsbStateHostAPeripheral; |
|
99 } |
|
100 |
|
101 // From OTG state observer |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 // --------------------------------------------------------------------------- |
|
106 // |
|
107 void CUsbStateHostAPeripheral::AHostL() |
|
108 { |
|
109 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAPeripheral::AHostL" ) ); |
|
110 ChangeHostStateL(EUsbStateHostAInitiate); |
|
111 } |
|
112 |