author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:03:15 +0300 | |
branch | RCL_3 |
changeset 42 | 0aa8cc770c8a |
child 52 | 866b4af7ffbe |
permissions | -rw-r--r-- |
42
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Monitors for new data in RComm local media side |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include "DunTransporter.h" |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include "DunDataWaiter.h" |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include "DunSignalCopy.h" |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include "DunDebug.h" |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
// ======== MEMBER FUNCTIONS ======== |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
// Two-phased constructor. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
CDunDataWaiter* CDunDataWaiter::NewL( MDunChannelAllocator* aChannelCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
CDunDataWaiter* self = new (ELeave) CDunDataWaiter( aChannelCallback ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
CleanupStack::PushL( self ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
self->ConstructL(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
CleanupStack::Pop( self ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
return self; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
// Destructor. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
CDunDataWaiter::~CDunDataWaiter() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter()") )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
ResetData(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
FTRACE(FPrint( _L("CDunDataWaiter::~CDunDataWaiter() complete") )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
// Resets data to initial values |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
void CDunDataWaiter::ResetData() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
FTRACE(FPrint( _L("CDunDataWaiter::ResetData()") )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
Stop(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
// APIs affecting this: |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
// AddConnMonCallbackL() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
iCallbacks.Close(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
// Internal |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
Initialize(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
FTRACE(FPrint( _L("CDunDataWaiter::ResetData() complete") )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// Adds callback for RunL error controlling |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// The callback will be called when error is detected in asynchronous |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
// operation |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
TInt CDunDataWaiter::AddCallback( MDunConnMon* aCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
FTRACE(FPrint( _L("CDunDataWaiter::AddCallback()" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
if ( !aCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (ERROR) complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
return KErrGeneral; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
TInt retTemp = iCallbacks.Find( aCallback ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
if ( retTemp != KErrNotFound ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (already exists) complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
return KErrAlreadyExists; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
retTemp = iCallbacks.Append( aCallback ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
if ( retTemp != KErrNone ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() (append failed!) complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
return retTemp; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
FTRACE(FPrint( _L("CDunDataWaiter::AddCallback() complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
return KErrNone; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
// Sets media to use for this endpoint |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
TInt CDunDataWaiter::SetMedia( RComm* aComm ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
FTRACE(FPrint( _L("CDunDataWaiter::SetMedia(RComm) (addr=0x%08X)" ), aComm)); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
if ( !aComm ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (aComm) not initialized!" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
return KErrGeneral; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
TCommCaps2 caps; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
aComm->Caps( caps ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
if ( !(caps().iNotificationCaps & KNotifyDataAvailableSupported) ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (RComm) (not supported) complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
return KErrNotSupported; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
iComm = aComm; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
FTRACE(FPrint( _L("CDunDataWaiter::SetMedia() (RComm) complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
return KErrNone; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
// Issues request to start waiting for new data in RComm |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
TInt CDunDataWaiter::IssueRequest() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest()" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
if ( iDataWaiterState != EDunStateIdle ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() (not ready) complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
return KErrNotReady; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
if ( !iComm ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() (iComm) not initialized!" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
return KErrGeneral; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
iStatus = KRequestPending; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
iComm->ResetBuffers(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
iComm->NotifyDataAvailable( iStatus ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
SetActive(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
iDataWaiterState = EDunStateDataWaiting; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
return KErrNone; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
// Stops monitoring for new data |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
TInt CDunDataWaiter::Stop() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
FTRACE(FPrint( _L("CDunDataWaiter::Stop()" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
if ( iDataWaiterState != EDunStateDataWaiting ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
FTRACE(FPrint( _L("CDunDataWaiter::Stop() (not ready) complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
return KErrNotReady; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
if ( !iComm ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
FTRACE(FPrint( _L("CDunDataWaiter::Stop() (iComm) not initialized!" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
return KErrGeneral; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
iComm->NotifyDataAvailableCancel(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
Cancel(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
iDataWaiterState = EDunStateIdle; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
FTRACE(FPrint( _L("CDunDataWaiter::Stop() complete" ))); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
return KErrNone; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
// CDunDataWaiter::CDunDataWaiter |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
CDunDataWaiter::CDunDataWaiter( MDunChannelAllocator* aChannelCallback ) : |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
CActive( EPriorityHigh ), |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
iChannelCallback( aChannelCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
Initialize(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
// CDunDataWaiter::ConstructL |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
void CDunDataWaiter::ConstructL() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
FTRACE(FPrint( _L("CDunDataWaiter::ConstructL()" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
if ( !iChannelCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
User::Leave( KErrGeneral ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
CActiveScheduler::Add( this ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
FTRACE(FPrint( _L("CDunDataWaiter::ConstructL() complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
// Initializes this class |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
void CDunDataWaiter::Initialize() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
FTRACE(FPrint( _L("CDunDataWaiter::Initialize()" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
// Don't initialize iChannelCallback here (it is set through NewL) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
iDataWaiterState = EDunStateIdle; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
205 |
iComm = NULL; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
FTRACE(FPrint( _L("CDunDataWaiter::Initialize() complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
// From class CActive. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
// Gets called when new data in RComm object |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
void CDunDataWaiter::RunL() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
FTRACE(FPrint( _L("CDunDataWaiter::RunL()" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
iDataWaiterState = EDunStateIdle; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
TInt retTemp = iStatus.Int(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
if ( retTemp != KErrNone ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
FTRACE(FPrint( _L("CDunDataWaiter::RunL() (failed) complete (%d)"), retTemp)); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
TInt count = iCallbacks.Count(); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
TDunConnectionReason connReason; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
connReason.iReasonType = EDunReasonTypeRunL; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
connReason.iContext = EDunMediaContextLocal; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
connReason.iSignalType = 0; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
connReason.iSignalHigh = EFalse; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
connReason.iDirection = EDunDirectionUndefined; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
connReason.iErrorCode = retTemp; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
for ( TInt i=0; i<count; i++ ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
TRAP_IGNORE( |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
iCallbacks[i]->NotifyProgressChangeL( iComm, connReason ) ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
return; |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
if ( iChannelCallback ) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
iChannelCallback->NotifyNewChannelRequest( iComm ); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
// Don't check other iMediaInUse values here |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
// They can't be other than EDunMediaRComm (checked in IssueRequest()) |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
FTRACE(FPrint( _L("CDunDataWaiter::RunL() complete" ) )); |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
} |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
|
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
// From class CActive. |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
// Gets called on cancel |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
// --------------------------------------------------------------------------- |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
// |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
void CDunDataWaiter::DoCancel() |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
{ |
0aa8cc770c8a
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
} |