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