bearermanagement/mpm/src/mpmserver.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:59:48 +0300
branchRCL_3
changeset 69 cf1b3ddbe9a1
parent 65 14754bf06654
permissions -rw-r--r--
Revision: 201039 Kit: 201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5a93021fdf25 Revision: 200949
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".
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description: MPM server implementation
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
/**
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
@file mpmserver.cpp
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
Mobility Policy Manager server implementation.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
*/
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
// INCLUDE FILES
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <commdb.h>
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <etel3rdparty.h>                // Voice call notification
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <mmtsy_names.h>                 // KMmTsyModuleName
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <centralrepository.h>
12
ea6e024ea6f9 Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 8
diff changeset
    28
#include <es_sock_partner.h>
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    29
#include <CoreApplicationUIsSDKCRKeys.h>
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include "mpmserver.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include "mpmserversession.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include "mpmconnmonevents.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include "mpmlogger.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#include "mpmdtmwatcher.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
#include "mpmroamingwatcher.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    37
#include "mpmdisconnectdlg.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
#include "mpmconfirmdlgroaming.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include "mpmconfirmdlgstarting.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    40
#include "mpmdefaultconnection.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include "mpmcommsdataccess.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    42
#include "mpmwlanquerydialog.h"
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    43
#include "mpmdialog.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
#include "mpmprivatecrkeys.h"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
#include "mpmcsidwatcher.h"
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
    46
#include "mpmdatausagewatcher.h"
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
    47
#include "mpmpropertydef.h"
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    48
#include "mpmofflinewatcher.h"
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
    49
#include "mpmconnpermquerytimer.h"
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
// ============================= LOCAL FUNCTIONS ===============================
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
// PanicServer 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
// Panics the server in case of programming error.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
void PanicServer( TInt aPanic )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
    User::Panic( KMPMPanicCategory, aPanic );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
// ============================ MEMBER FUNCTIONS ===============================
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
// CMPMServer::NewL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
CMPMServer* CMPMServer::NewL()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    CMPMServer* self = new ( ELeave ) CMPMServer();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    CleanupStack::PushL( self );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    self->ConstructL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    CleanupStack::Pop( self );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    return self;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
// CMPMServer::CMPMServer
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
CMPMServer::CMPMServer()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
    : CPolicyServer( CPolicyServer::EPriorityStandard, KMPMPolicy ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
      iEvents( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
      iTSYLoaded( EFalse ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
      iPacketServLoaded( EFalse ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
      iDtmWatcher( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
      iWLANScanRequired( EFalse ), 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    91
      iDisconnectQueue( NULL ), 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
      iRoamingQueue( NULL ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
      iStartingQueue( NULL ),
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    94
      iWlanQueryQueue( NULL ),
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    95
      iConnectDialogQueue( NULL ),
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    96
      iDefaultConnection( NULL ), 
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    97
      iConnectionCounter( 0 ),
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
    98
      iOfflineMode( ECoreAppUIsNetworkConnectionAllowed )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
// CMPMServer::ConstructL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
void CMPMServer::ConstructL()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
    // identify ourselves and open for service
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    MPMLOGSTRING( "MPMServer is starting" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
    StartL( KMPMServerName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    // Connect to ETel server
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
    // The RTelServer::Connect() might not always work with the first trial,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
    // because of a coding error related to using semaphores in the method.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
    TInt err( KErrNotReady );
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   117
    err = iTelServer.Connect();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
    TInt a = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
    while( a < KPhoneRetryCount && err != KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
        User::After( KPhoneRetryTimeout );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
        err = iTelServer.Connect();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
        a++;       
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
    User::LeaveIfError( err );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
       
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    // Try to load phone.tsy
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
    TBuf< KCommsDbSvrMaxColumnNameLength > tsyName;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    tsyName.Copy( KMmTsyModuleName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
    err = iTelServer.LoadPhoneModule( tsyName );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
    if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
        iTSYLoaded = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
        // Phone info can be retrieved with value 0 if there is only 1 phone
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
        RTelServer::TPhoneInfo info;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
        User::LeaveIfError( iTelServer.GetPhoneInfo( 0, info ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
        User::LeaveIfError( iMobilePhone.Open( iTelServer, info.iName ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
        // Open packet service
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
        err = iPacketService.Open( iMobilePhone );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
        if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
            iPacketServLoaded = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
            iDtmWatcher = CMPMDtmWatcher::NewL( iPacketService );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
            MPMLOGSTRING2( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
                "CMPMServer::ConstructL iPacketService.Open error: %d", err )  
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
    iRoamingWatcher = CMPMRoamingWatcher::NewL(iMobilePhone);
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
    iCommsDatAccess = CMPMCommsDatAccess::NewL( );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   159
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   160
    iDisconnectQueue = new ( ELeave ) CArrayPtrFlat<CMPMDisconnectDlg>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   161
    iDisconnectQueue->Reset();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
    iRoamingQueue = new ( ELeave ) CArrayPtrFlat<CMPMConfirmDlgRoaming>( KGranularity );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
    iRoamingQueue->Reset();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    iStartingQueue = new ( ELeave ) CArrayPtrFlat<CMPMConfirmDlgStarting>( KGranularity ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
    iStartingQueue->Reset();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   169
    iWlanQueryQueue = new ( ELeave ) CArrayPtrFlat<CMPMWlanQueryDialog>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   170
    iWlanQueryQueue->Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   171
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   172
    iConnectDialogQueue = new ( ELeave ) CArrayPtrFlat<CMPMDialog>( KGranularity );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   173
    iConnectDialogQueue->Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   174
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   175
    iDefaultConnection = CMPMDefaultConnection::NewL( this );    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   176
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
    // Create central repository watcher and start it
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
    iMpmCsIdWatcher = CMpmCsIdWatcher::NewL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
    iMpmCsIdWatcher->StartL();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   181
    // Create another central repository watcher and start it
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   182
    TRAPD( duwErr, iMpmDataUsageWatcher = CMpmDataUsageWatcher::NewL( this ) );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   183
    if (duwErr == KErrNone)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   184
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   185
        iMpmDataUsageWatcher->StartL();
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   186
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   187
    else
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   188
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   189
        iMpmDataUsageWatcher = NULL;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   190
        MPMLOGSTRING( "CMPMServer::ConstructL: CMpmDataUsageWatcher::NewL() failed!" )
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   191
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   192
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   193
    // Create another central repository watcher and start it
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   194
    TRAPD( owErr, iMpmOfflineWatcher = CMpmOfflineWatcher::NewL( this ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   195
    if (owErr == KErrNone)
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   196
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   197
        iMpmOfflineWatcher->StartL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   198
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   199
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   200
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   201
        iMpmOfflineWatcher = NULL;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   202
        MPMLOGSTRING( "CMPMServer::ConstructL: CMpmOfflineWatcher::NewL() failed!" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   203
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   204
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   205
    // Define P&S keys (snap & iap) for the user connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   206
    TInt ret = RProperty::Define( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   207
                                  KMPMPSKeyUserConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   208
                                  KMPMUserConnectionSnapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   209
                                  KMPMUserConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   210
                                  KMPMUserConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   211
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   212
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   213
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   214
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   215
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   216
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   217
    ret = RProperty::Define( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   218
                             KMPMPSKeyUserConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   219
                             KMPMUserConnectionIapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   220
                             KMPMUserConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   221
                             KMPMUserConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   222
                                          
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   223
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   224
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   225
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   226
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   227
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   228
    // Set initial values for the keys
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   229
    User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   230
                                       KMPMPSKeyUserConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   231
                                       0 ));
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   232
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   233
    User::LeaveIfError(RProperty::Set( KMPMUserConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   234
                                       KMPMPSKeyUserConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   235
                                       0 ));
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   236
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
    // Read dedicated clients from the central repository
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
    CRepository* repository = CRepository::NewL( KCRUidMPM );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    CleanupStack::PushL( repository );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
    TUint32 baseKey = KMpmDedicatedClientBase;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
    TInt value;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   244
    ret = KErrNone;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
    while ( ret == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
        ret = repository->Get ( baseKey, value );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
        if ( ret == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
            iDedicatedClients.AppendL( value );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
            MPMLOGSTRING2( "CMPMServer::ConstructL: Dedicated client id: %d", value)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
        baseKey++;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
    CleanupStack::PopAndDestroy ( repository );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   260
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   261
    // Define P&S keys for the connection dialogs
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   262
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   263
                             KMPMPSKeyActiveConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   264
                             KMPMActiveConnectionIapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   265
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   266
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   267
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   268
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   269
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   270
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   271
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   272
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   273
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   274
                             KMPMPSKeyActiveConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   275
                             KMPMActiveConnectionSnapType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   276
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   277
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   278
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   279
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   280
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   281
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   282
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   283
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   284
    ret = RProperty::Define( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   285
                             KMPMPSKeyActiveConnectionBearer,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   286
                             KMPMActiveConnectionBearerType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   287
                             KMPMActiveConnectionReadPolicy,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   288
                             KMPMActiveConnectionWritePolicy );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   289
                                          
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   290
    if ( (ret != KErrNone) && (ret != KErrAlreadyExists) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   291
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   292
        User::Leave(err);
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   293
        }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
        
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   295
    PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   296
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   297
    iRoamingToWlanPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   298
    iRoamingToHotspotWlanPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   299
            
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
// CMPMServer::~CMPMServer
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
CMPMServer::~CMPMServer()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
    {
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   309
	if ( iRoamingToWlanPeriodic )
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   310
        {
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   311
        iRoamingToWlanPeriodic->Cancel();
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   312
		delete iRoamingToWlanPeriodic;
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
   313
        }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   314
    if ( iRoamingToHotspotWlanPeriodic )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   315
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   316
        iRoamingToHotspotWlanPeriodic->Cancel();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   317
        delete iRoamingToHotspotWlanPeriodic;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   318
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   319
    if ( iDisconnectQueue )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   320
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   321
        iDisconnectQueue->ResetAndDestroy();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   322
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   323
    delete iDisconnectQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   324
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
    if ( iRoamingQueue )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
        iRoamingQueue->ResetAndDestroy();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
    delete iRoamingQueue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
    if ( iStartingQueue )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
        iStartingQueue->ResetAndDestroy();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
    delete iStartingQueue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   337
    while ( iWlanQueryQueue && iWlanQueryQueue->Count() > 0 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   338
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   339
        iWlanQueryQueue->Delete( 0 );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   340
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   341
    delete iWlanQueryQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   342
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   343
    if ( iConnectDialogQueue )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   344
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   345
        iConnectDialogQueue->ResetAndDestroy();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   346
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   347
    delete iConnectDialogQueue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   348
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
    delete iEvents;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
    for ( TInt i = 0; i < iBlackListIdList.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
        iBlackListIdList[i].Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
    iActiveBMConns.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
    iSessions.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
    delete iDtmWatcher;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
    delete iRoamingWatcher;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
    // Close "global" ETEL objects
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
    if ( iPacketServLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
        iPacketService.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
        }    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
    iMobilePhone.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
    iTelServer.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
    
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   371
    delete iDefaultConnection;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   372
    
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
    delete iMpmCsIdWatcher;    
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   374
    
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
   375
    delete iMpmDataUsageWatcher;    
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
   376
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   377
    delete iMpmOfflineWatcher;    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   378
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
    iDedicatedClients.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   381
    delete iCommsDatAccess;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   382
    
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   383
    delete iConnPermQueryTimer;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
// CMPMServer::NewSessionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
CSession2* CMPMServer::NewSessionL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
    const TVersion& aVersion,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
    const RMessage2& /*aMessage*/) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
    MPMLOGSTRING( "CMPMServer::NewSessionL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
    // Check we're the right version
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
    if ( !User::QueryVersionSupported(TVersion(KMPMServerMajorVersionNumber,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
                                               KMPMServerMinorVersionNumber,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
                                               KMPMServerBuildVersionNumber ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
                                     aVersion ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
        User::Leave( KErrNotSupported );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
    CSession2* session = CMPMServerSession::NewL( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
                             *const_cast<CMPMServer*>( this ));
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
    return session;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
// CMPMServer::PanicClient
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
void CMPMServer::PanicClient(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
    const TInt aPanic) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
    // let's have a look before we panic the client
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
    __DEBUGGER()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
    // ok, go for it
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
    RThread clientThread;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
    TInt err = Message().Client( clientThread );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
    if ( err == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
        clientThread.Panic( KMPMServerName, aPanic );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
        clientThread.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
// CMPMServer::AppendBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
void CMPMServer::AppendBMConnection( const TConnectionId aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
                                     const TUint32       aSnap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
                                     const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
                                     TConnectionState    aState,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
                                     CMPMServerSession&  aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
        "CMPMServer::AppendBMConnection - aConnId = 0x%x, aSnap = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
        aConnId, aSnap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   446
    // Set the Connection Id, SNAP, Iap Id and connection state, into TActiveBMConn
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
    TActiveBMConn conn;
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   448
    conn.iConnInfo.iConnId = aConnId;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   449
    conn.iConnInfo.iSnap   = aSnap;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   450
    conn.iConnInfo.iIapId  = aIapId;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   451
    conn.iConnInfo.iState  = aState;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
   452
    conn.iConnInfo.iAppUid = aSession.AppUid();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
    if ( index1 == KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
        // If this connInfo is not yet there, insert it at the end of array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
        iActiveBMConns.Append( conn );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
        // connInfo already active, check whether Connection Id is there
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
        if ( index1 < iActiveBMConns.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
            // Set the Iap Id and connection state
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
            iActiveBMConns[index1].iConnInfo.iIapId = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
            iActiveBMConns[index1].iConnInfo.iState = aState;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
            iActiveBMConns[index1].iConnInfo.iAppUid = aSession.AppUid();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   476
    if ( aState == EStarted && aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   477
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   478
        UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   479
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   480
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
// CMPMServer::ResetBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
void CMPMServer::ResetBMConnection( const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
                                    const TUint32       aIapId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   495
                                    CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
        "CMPMServer::ResetBMConnection - aConnId = 0x%x, aIapId = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
        aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
    // Get the current connection SNAP for this Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
    //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
    TUint32 snap = GetBMSnap( aConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
    // Set the Connection Id and SNAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
    connInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
    connInfo.iSnap   = snap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
    // Set the Iap Id 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
    conn.iConnInfo          = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
    conn.iConnInfo.iIapId   = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
//       && ( aIapId == iActiveBMConns[index1].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
        // If connInfo found, reset the Iap Id as zero and 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
        // update connection state as EIdle.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
        // It is expected that MPM keeps the Connection Id and SNAP 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
        // relationship in a database entry and that this entry survives 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
        // a roaming event (an ApplicationLeavesConnection call).
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
        iActiveBMConns[index1].iConnInfo.iIapId = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
        iActiveBMConns[index1].iConnInfo.iState = EIdle;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   531
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   532
        // Change state of P&S keys if needed
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   533
        if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   534
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   535
            UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   536
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
// CMPMServer::RemoveBMConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
void CMPMServer::RemoveBMConnection( const TConnectionId aConnId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   551
                                     CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
    MPMLOGSTRING2( "CMPMServer::RemoveBMConnection - aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
        aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   556
    TInt count = iActiveBMConns.Count();
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   557
    
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   558
    // Decrement by one, because count is n, 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   559
    // but indexes in array are 0 .. n-1.
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   560
    // 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   561
    count--;
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   562
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
    // This time we are browsing the array from the end to the beginning, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
    // because removing one element from array affects index numbering.
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   565
    // 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   566
    for ( TInt i = count; i >= 0; i-- )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
        if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
            {
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   570
            // If Connection Id found, remove it. 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   571
            //
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   572
            iActiveBMConns.Remove( i );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   573
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   574
            // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   575
            if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   576
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   577
                UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   578
                }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
        }
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   581
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
// CMPMServer::GetBMIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
TUint32 CMPMServer::GetBMIap( const TConnectionId aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
    MPMLOGSTRING2( "CMPMServer::GetBMIap - aConnId = 0x%x", aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
    TUint32 connectionIapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
    // Set the Connection Id and SNAP
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   600
    // 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
    connInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
    conn.iConnInfo = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
        // If connInfo found, set the Iap Id as connectionIapId
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   612
        //
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
        connectionIapId = iActiveBMConns[index1].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
    MPMLOGSTRING2( "CMPMServer::GetBMIap - connectionIapId = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
        connectionIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
    return connectionIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
// CMPMServer::GetBMSnap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
TUint32 CMPMServer::GetBMSnap( const TConnectionId aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
    MPMLOGSTRING2( "CMPMServer::GetBMSnap - aConnId = 0x%x", aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
    TUint32 snap( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
    TBool   snapFound( EFalse );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
    for ( TInt i = 0; ( ( i < iActiveBMConns.Count() ) && !snapFound ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
        if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
            snap = iActiveBMConns[i].iConnInfo.iSnap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
            snapFound = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
    MPMLOGSTRING2( "CMPMServer::GetBMSnap - SNAP = %i", snap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
    return snap;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
// CMPMServer::GetConnectionState
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
void CMPMServer::GetConnectionState( const TConnectionId    aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
                                     TConnectionState&      aState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
    MPMLOGSTRING2( "CMPMServer::GetConnectionState - aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
        aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
    TConnectionInfo connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
    connInfo.iConnId = aConnId; 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
    conn.iConnInfo = connInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchConnInfo );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
    if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
        // If connInfo found
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
        aState = iActiveBMConns[index1].iConnInfo.iState;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
        // Since connInfo has no entry in iActiveBMConns, then 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
        // the state of connection must be EStarting.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
        aState = EStarting;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
    switch( aState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
        case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Starting" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
        case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Started" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
        case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Idle" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
        case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Roaming" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
        default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
            MPMLOGSTRING( "CMPMServer::GetConnectionState - Unknown" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   710
// CMPMServer::CheckUsageOfIap
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
//
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   713
TConnectionState CMPMServer::CheckUsageOfIap( const TUint32 aIapId , 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   714
                                  const TConnectionId aOwnConnId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   716
    MPMLOGSTRING3( "CMPMServer::CheckUsageOfIap - aIapId = %i, aOwnConnId = 0x%x", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   717
                  aIapId, aOwnConnId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   719
    TConnectionState state = EIdle;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
    // 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   723
    for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
        {
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   725
        // Check if IAP Id matches; exclude matching with own connection
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
        // 
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   727
        if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId && 
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   728
             iActiveBMConns[i].iConnInfo.iConnId != aOwnConnId)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
            state = iActiveBMConns[i].iConnInfo.iState;  
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
            // Stop looping if EStarted found
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
            if ( state == EStarted )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
                {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   736
                break; // Breaks the for loop
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
    switch( state )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
        case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   746
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Starting" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
        case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   751
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Started" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
        case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   756
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Idle" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
        case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   761
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Roaming" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
        default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   766
            MPMLOGSTRING( "CMPMServer::CheckUsageOfIap - Unknown" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
#endif // _DEBUG
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   771
        
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   772
    return state;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
// CMPMServer::IsWlanConnectionStartedL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
TUint32 CMPMServer::IsWlanConnectionStartedL( const CMPMCommsDatAccess* aCdbAccess )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
    TUint32 iapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
    MPMLOGSTRING( "CMPMServer::IsWlanConnectionStartedL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
    TBool stopLoop( EFalse );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
    for ( TInt i = 0; ( ( i < iActiveBMConns.Count() ) && !stopLoop ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
        // Check if IAP Id matches
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
        // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
        if ( iActiveBMConns[i].iConnInfo.iState == EStarting ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
             iActiveBMConns[i].iConnInfo.iState == EStarted )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
            {
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   796
            TWlanIapType iapType( ENotWlanIap );             	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   797
            TRAPD ( leave, iapType = aCdbAccess->CheckWlanL( iActiveBMConns[i].iConnInfo.iIapId ) )             	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   798
            if ( ( leave == KErrNone ) && ( iapType != ENotWlanIap ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
                stopLoop = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
                iapId = iActiveBMConns[i].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
                MPMLOGSTRING2( "CMPMServer::IsWlanConnectionStartedL, found wlan iap %d", iapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
    return iapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
// CMPMServer::AppendBMIAPConnectionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
void CMPMServer::AppendBMIAPConnectionL( const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
                                         const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
                                         CMPMServerSession& aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
        "CMPMServer::AppendBMIAPConnectionL - aIapId = %i, aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
        aIapId, aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
    TActiveBMConn conn;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
    conn.iConnInfo.iIapId = aIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
    conn.iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
    conn.iConnInfo.iAppUid = aSession.AppUid();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
    TInt index1 = iActiveBMConns.Find( conn, TActiveBMConn::MatchIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
    if ( index1 == KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
        // If this Iap is not yet there, insert it at the end of array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
        iActiveBMConns.AppendL( conn );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
        // Iap already active, update connection state as started. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
        // This Iap could be shared by multiple applications, but 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
        // update only the one with matching connection id.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
        for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
            if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
                iActiveBMConns[i].iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
            else if ( iActiveBMConns[i].iConnInfo.iSnap == 0 &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
                    iActiveBMConns[i].iConnInfo.iIapId == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
                iActiveBMConns[i].iConnInfo.iState = EStarted;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   856
    if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   857
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   858
        UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   859
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   860
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   863
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
// CMPMServer::RemoveBMIAPConnection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
void CMPMServer::RemoveBMIAPConnection( const TUint32       aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
                                        const TConnectionId aConnId,
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   875
                                        CMPMServerSession&  aSession )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
        "CMPMServer::RemoveBMIAPConnection - aIapId = %i, aConnId = 0x%x", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
        aIapId, aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   881
    TActiveBMConn conn;
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   882
    conn.iConnInfo.iIapId = aIapId;
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   883
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
    // The IAP connection lifetime is determined by the two calls 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
    // IAPConnectionStarted and IAPConnectionStopped. 
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   886
    //
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   887
    TInt count = iActiveBMConns.Count();
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   888
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   889
    // Decrement by one, because count is n, 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   890
    // but indexes in array are 0 .. n-1.
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   891
    // 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   892
    count--;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
    // This time we are browsing the array from the end to the beginning, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
    // because removing one element from array affects index numbering.
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   896
    // 
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   897
    for ( TInt i = count; i >= 0; i-- )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
        if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
            if ( iActiveBMConns[i].iConnInfo.iSnap == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
                // If IAPConnectionStopped has been called and SNAP is zero,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
                // then this entry can be removed from database.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
                // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
                iActiveBMConns.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
            else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
                // If IAP found, reset the Iap Id as zero and 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
                // update connection state as idle.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
                // This Iap could be shared by multiple applications, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
                // but update only the one with matching connection id.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
                // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
                if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
                    iActiveBMConns[i].iConnInfo.iIapId = 0;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
                    iActiveBMConns[i].iConnInfo.iState = EIdle;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   919
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   920
                }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   921
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   922
            // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   923
            if ( aSession.ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   924
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   925
                UpdateActiveConnection( aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   926
                }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
    DumpActiveBMConns();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
// CMPMServer::AppendSessionL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
void CMPMServer::AppendSessionL( const CMPMServerSession* aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
    MPMLOGSTRING( "CMPMServer::AppendSession" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
    iSessions.AppendL( aSession );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
// CMPMServer::RemoveSession
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
void CMPMServer::RemoveSession( const CMPMServerSession* aSession )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
    MPMLOGSTRING( "CMPMServer::RemoveSession" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
    TInt index = iSessions.Find( aSession );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
    if ( index != KErrNotFound )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   960
        {
36
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   961
        if ( Events() )
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   962
            {
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   963
            // Cancel WLAN scan request if one exists
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   964
            TRAP_IGNORE( Events()->CancelScanL( iSessions[index] ) )
04408506c6e0 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   965
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   966
        iSessions.Remove( index );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   969
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   970
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
// CMPMServer::NotifyBMPrefIapL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
//
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   974
void CMPMServer::NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo, 
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
   975
                                   const TPrefIAPNotifCaller aCaller )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
    MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - IAPs count: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
        aIapInfo.iCount)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
    TConnMonIapInfo iapInfo = aIapInfo;
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   980
    iConnMonIapInfo = aIapInfo;
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
    for (TUint i = 0; i < iapInfo.Count(); i++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   984
        MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIap - IAP: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   985
            iapInfo.iIap[i].iIapId) 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   986
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   987
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   988
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   989
    // Read info for forced roaming from Commdat
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
   990
    TUint32 maxOpenTransAttempts ( KMaxOpenTransAttempts );
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   991
    TUint32 retryAfter ( KRetryAfter );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   992
    TInt err;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   993
    // CommDat reading might fail because CommDat session could be locked by another process at the moment
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   994
    // So, we may wait/retry to read from CommDat a bit later.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   995
    TCmUsageOfWlan usageOfWlan ( ECmUsageOfWlanKnown );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   996
    do
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   997
        {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   998
        TRAP ( err, usageOfWlan = CommsDatAccess()->ForcedRoamingL() );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
   999
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1000
        if( err )
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1001
            {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1002
            User::After( retryAfter );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1003
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1004
        } while( err && maxOpenTransAttempts-- );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1005
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1006
    // Start possible forced roaming
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1007
    if ( !err )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1008
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1009
        if ( usageOfWlan == ECmUsageOfWlanKnown || usageOfWlan == ECmUsageOfWlanKnownAndNew )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1010
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1011
            if ( IsWlanConnectionStartedL( CommsDatAccess() ) )
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1012
                {
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1013
                iRoamingToWlanPeriodic->Cancel();
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1014
                iRoamingToHotspotWlanPeriodic->Cancel();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1015
                        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1016
                // Start periodic object that calls StartForcedRoamingToWlanL after 10s. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1017
                // this handles the case when new wlan connection is 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1018
                // started from e.g. wlan sniffer but IAP is not yet in Internet SNAP 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1019
                iRoamingToWlanPeriodic->Start( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1020
                        TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1021
                        TTimeIntervalMicroSeconds32( KRoamingToWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1022
                        TCallBack( StartForcedRoamingToConnectedWlanL, this ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1023
                
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1024
                // Start periodic object that calls StartForcedRoamingToWlanL after 120s. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1025
                // this handles the case when new captive portal hotspot wlan 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1026
                // connection is started. IAP will be moved to Internet SNAP after 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1027
                // successful login only. 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1028
                iRoamingToHotspotWlanPeriodic->Start( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1029
                        TTimeIntervalMicroSeconds32( KRoamingToHotspotWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1030
                        TTimeIntervalMicroSeconds32( KRoamingToHotspotWlanUpdateInterval ), 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1031
                        TCallBack( StartForcedRoamingToConnectedHotspotWlanL, this ) );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1032
                }
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1033
            else
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1034
                {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1035
                StartForcedRoamingToWlanL( iapInfo );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1036
                }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1037
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1038
            StartForcedRoamingFromWlanL( iapInfo );
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1039
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1040
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1041
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1042
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1043
        MPMLOGSTRING2( "CMPMServer::NotifyBMPrefIapL - \
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1044
reading info for forced roaming fails with err %d, forced roaming fails", err )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
    MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
    "CMPMServer::NotifyBMPrefIapL - Send notifications for %d sessions", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
        iSessions.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1051
    for ( TInt i = 0; i < iSessions.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
        iapInfo = iSessions[i]->GetAvailableIAPs( );
15
4dc3bb0099b0 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 12
diff changeset
  1054
        iSessions[i]->PrefIAPNotificationL( iapInfo, aCaller );
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
        }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1056
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1057
    // If a session is displaying connection selection dialog 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1058
    // the contents of the dialog should be updated according to the 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1059
    // current iap availability
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1060
    //
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1061
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1062
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1063
        iSessions[i]->UpdateConnectionDialogL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1064
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1065
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1066
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1067
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1068
// CMPMServer::UpdateSessionConnectionDlgL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1069
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1070
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1071
void CMPMServer::UpdateSessionConnectionDlgL()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1072
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1073
    MPMLOGSTRING( "CMPMServer::UpdateSessionConnectionDlgL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1074
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1075
    // If a session is displaying connection selection dialog 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1076
    // the contents of the dialog should be updated according to the 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1077
    // current iap availability
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1078
    //
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1079
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1080
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1081
        iSessions[i]->UpdateConnectionDialogL();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1082
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1083
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1084
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1085
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1086
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1087
// CMPMServer::HandlePendingMsgs
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1088
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1089
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1090
void CMPMServer::HandlePendingMsgs( TUint            aIapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1091
                                    TInt             aError, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1092
                                    TInt*            aErrorReturned,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1093
                                    TBMNeededAction* aNeededAction )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1094
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1095
    MPMLOGSTRING3( "CMPMServer::HandlePendingMsgs aError = %d iapId = %d", 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1096
                   aError, aIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1097
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1098
    for ( TInt i( 0 ); i < iSessions.Count(); i++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1099
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1100
        // Read the Connection Id of the application
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1101
        TConnectionId connId = iSessions[i]->ConnectionId();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1102
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1103
        // Get the current connection IapId for this connId 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1104
        TUint32 currentIap = iSessions[i]->MyServer().GetBMIap( connId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1105
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1106
        MPMLOGSTRING2( "Session IapId = %d", currentIap );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1107
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1108
        if ( currentIap == aIapId && !iSessions[i]->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1109
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1110
            iSessions[i]->ProcessErrorComplete( aError, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1111
                                                aErrorReturned, 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1112
                                                aNeededAction );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1113
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1114
        }
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1115
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1116
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1117
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
// CMPMServer::HandleServerBlackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
TInt CMPMServer::HandleServerBlackListIap( const TConnectionId  aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
                                           TUint32              aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
                                           TBlacklistCategory   aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
        "CMPMServer::HandleServerBlackListIap - aConnId = 0x%x, iapId = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
        aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
    MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
        "CMPMServer::HandleServerBlackListIap - aCategory = %i", aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
    BlackListIap( aConnId, aIapId, aCategory ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1135
    TUint32 presumedIap = Events()->PresumedIapId( aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
                                                   aIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
    if ( ( presumedIap != 0 ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
         ( presumedIap != aIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
            "CMPMServer::HandleServerBlackListIap - presumedIap = %i",
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
            presumedIap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
        BlackListIap( aConnId, presumedIap, aCategory ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
// CMPMServer::BlackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
TInt CMPMServer::BlackListIap( const TConnectionId  aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
                               TUint32              aIapId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
                               TBlacklistCategory   aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
    TInt i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
    if ( found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
        connIdInfo.Append( aIapId, aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
        iBlackListIdList.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
        iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
        TMPMBlackListConnId connIdInfo;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
        connIdInfo.iConnId = aConnId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
        connIdInfo.Append( aIapId, aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
        iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
// CMPMServer::HandleServerUnblackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
TInt CMPMServer::HandleServerUnblackListIap( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
    const TConnectionId aConnId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
    TUint32             aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
    MPMLOGSTRING3(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
        "CMPMServer::HandleServerUnblackListIap - aConnId = 0x%x, iapId = %i"
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
        ,aConnId, aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
    TInt i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1197
    if ( found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
        // found blacklisted Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
        iBlackListIdList.Remove( i ); // remove from the list 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1202
        
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1203
        MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1204
connIdInfo count: %d", connIdInfo.Count() )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1205
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
        if ( aIapId == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
            { // 0 will reset Connection Id blacklisted iap list 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1208
            MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1209
reset Connection Id blacklisted iap list" )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1210
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1211
            connIdInfo.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1212
            return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1213
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1214
        
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1215
        found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1216
        for (TInt j = 0; j < connIdInfo.Count(); j++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1217
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1218
            if ( connIdInfo.Iap( j ) == aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1219
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1220
                // found and remove blacklisted iap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1221
                connIdInfo.Remove( j ); 
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1222
                MPMLOGSTRING2( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1223
removed blacklisted iap in index = %d", j )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1224
                
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
                if ( connIdInfo.Count() == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
                    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
                // reinsert connIdInfo at the beginning to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
                iBlackListIdList.Insert( connIdInfo, 0 ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
                return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
        // nothing found and reinsert at the beginning 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
        // connIdInfo to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
        iBlackListIdList.Insert( connIdInfo, 0 ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
        {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1242
        MPMLOGSTRING( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1243
not found blacklisted Connection Id" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
// CMPMServer::HandleServerUnblackListIap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1252
void CMPMServer::HandleServerUnblackListIap( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
    TBlacklistCategory  aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
    {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1255
    MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap -\
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1256
aCategory = %i blacklisted Id count = %d", 
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1257
                   aCategory, iBlackListIdList.Count() )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1259
    for (TInt i = iBlackListIdList.Count()-1; i >= 0; i--)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1260
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
        // found blacklisted Connection Id
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
        TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
        iBlackListIdList.Remove( i ); // remove from the list 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1265
        MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1266
aConnId = 0x%x, blacklisted IapId count = %d", connIdInfo.iConnId, 
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1267
        connIdInfo.Count() )
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1268
        
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  1269
        for (TInt j = connIdInfo.Count()-1; j >= 0; j--)
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1271
            if ( connIdInfo.Category( j ) == aCategory ) 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
                // found and remove blacklisted iap
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1274
                MPMLOGSTRING3( "CMPMServer::HandleServerUnblackListIap - \
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1275
removed blacklisted iap id %i in index: %d", connIdInfo.Iap( j ), j )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
                connIdInfo.Remove( j ); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1279
        // If any blacklisted iaps remain reinsert at the 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
        // beginning connIdInfo to reflect activeness
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
        //
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
        if( connIdInfo.Count() > 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
            {
19
22c3c67e5001 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 17
diff changeset
  1284
            MPMLOGSTRING( "reinsert connIdInfo to reflect activeness" )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
            iBlackListIdList.Insert( connIdInfo, 0 );             
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
// CMPMServer::GetBlacklistedIAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
TInt CMPMServer::GetBlacklistedIAP( TConnectionId    aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
                                    RArray<TUint32> &aBlacklistedIAP )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
    TInt  i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
    found = FindBlacklistedConnIndex( aConnId, i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
    if ( !found )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1306
    TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1307
    iBlackListIdList.Remove( i );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
    iBlackListIdList.Insert( connIdInfo, 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1309
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1310
    for (TInt j = 0; j < connIdInfo.Count(); j++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
        aBlacklistedIAP.Append( connIdInfo.Iap( j ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1313
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1319
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
// CMPMServer::GetBlacklistedIAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
TInt CMPMServer::GetBlacklistedIAP( RArray<TUint32> &aBlacklistedIAP )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
    // Returns all blacklisted IAPs regardless of Connection Id 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
    for ( TInt i( 0 ); i < iBlackListIdList.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1329
        for ( TInt j( 0 ); j < iBlackListIdList[i].Count(); 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
              j++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
            // Inserts an object into the array in ascending unsigned 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
            // key order. No duplicate entries are permitted. 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
            // The array remains unchanged following an attempt to 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1336
            // insert a duplicate entry.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
            // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
            aBlacklistedIAP.InsertInUnsignedKeyOrder( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
                                    iBlackListIdList[i].Iap( j ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1342
    return KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
// CMPMServer::FindId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
TBool CMPMServer::FindBlacklistedConnIndex( const TConnectionId aConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
                                            TInt                &aIndex )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
    TInt  i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
    TBool found = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
    for (i = 0;( (i < iBlackListIdList.Count()) && !found ); i++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
        if ( iBlackListIdList[i].iConnId == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
            found = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
    i--; // Since i is incremented after finding the correct iConnId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
    aIndex = i;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
    return found;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
// CMPMServer::IsVoiceCallActiveL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
// Checks if voice call is active or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
// Return ETrue if voice call is active.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
// Return EFalse if voice call is not active.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
TBool CMPMServer::IsVoiceCallActiveL() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
    MPMLOGSTRING( "CMPMServer::IsVoiceCallActiveL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
    CTelephony*                   telephony = CTelephony::NewLC();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
    CTelephony::TCallStatusV1     callStatusV1;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
    CTelephony::TCallStatusV1Pckg callStatusV1Pckg( callStatusV1 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
    CTelephony::TPhoneLine        line = CTelephony::EVoiceLine;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
    telephony->GetLineStatus( line, callStatusV1Pckg );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
    CTelephony::TCallStatus voiceLineStatus = callStatusV1.iStatus;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
    CleanupStack::PopAndDestroy( telephony );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
    if ( voiceLineStatus == CTelephony::EStatusDialling         ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
         voiceLineStatus == CTelephony::EStatusRinging          ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
         voiceLineStatus == CTelephony::EStatusAnswering        ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
         voiceLineStatus == CTelephony::EStatusConnecting       ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
         voiceLineStatus == CTelephony::EStatusConnected        ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
         voiceLineStatus == CTelephony::EStatusReconnectPending ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
         voiceLineStatus == CTelephony::EStatusDisconnecting    ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
         voiceLineStatus == CTelephony::EStatusHold             ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
         voiceLineStatus == CTelephony::EStatusTransferring     ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
         voiceLineStatus == CTelephony::EStatusTransferAlerting  )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
            "CMPMServer::IsVoiceCallActiveL Voice call is active: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
    else if ( voiceLineStatus == CTelephony::EStatusIdle ||
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
              voiceLineStatus == CTelephony::EStatusUnknown )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
            "CMPMServer::IsVoiceCallActiveL Voice call is not active: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
        MPMLOGSTRING2(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
            "CMPMServer::IsVoiceCallActiveL Unknown voice line status: %d", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
            voiceLineStatus )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
// CMPMServer::IsModeGSM
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
// Checks if mode is GSM or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
// Return ETrue if mode is GSM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
// Return EFalse if mode is something else.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
TBool CMPMServer::IsModeGSM() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
    MPMLOGSTRING( "CMPMServer::IsModeGSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
    if ( iTSYLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
        RMobilePhone::TMobilePhoneNetworkMode mode( 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
            RMobilePhone::ENetworkModeUnknown );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
        TInt ret = iMobilePhone.GetCurrentMode( mode );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
        if ( ( ret == KErrNone ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
             ( mode == RMobilePhone::ENetworkModeGsm ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
            MPMLOGSTRING( "CMPMServer::IsModeGSM Mode is GSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
            return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
            MPMLOGSTRING( "CMPMServer::IsModeGSM Mode is not GSM" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
            return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
    MPMLOGSTRING( "CMPMServer::IsModeGSM phone.tsy not loaded" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
    return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
// CMPMServer::IsDTMSupported
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
// Checks if phone supports Dual Transfer Mode or not.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
// Return ETrue if phone supports DTM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
// Return EFalse if phone does not support DTM.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
TBool CMPMServer::IsDTMSupported() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
    MPMLOGSTRING( "CMPMServer::IsDTMSupported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
    if ( iPacketServLoaded )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
        TBool rv = iDtmWatcher->IsInDualMode();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
        if ( rv )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
            MPMLOGSTRING( "CMPMServer::IsDTMSupported DTM is supported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
        else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
            MPMLOGSTRING( "CMPMServer::IsDTMSupported DTM is not supported" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
        return rv;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
    MPMLOGSTRING( "CMPMServer::IsDTMSupported Packet service not loaded" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
    return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
// CMPMServer::DumpActiveBMConns
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
void CMPMServer::DumpActiveBMConns()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
#ifdef _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
    // Dump array of active connections to log in order to support testing.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
    MPMLOGSTRING( "Display array of active connections - Start" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
    MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
    if ( iActiveBMConns.Count() == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
        MPMLOGSTRING( "Array of active connections is empty" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
        MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
    for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
        MPMLOGSTRING3( "Connection Id = 0x%x Snap = %i", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
            iActiveBMConns[i].iConnInfo.iConnId, 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
            iActiveBMConns[i].iConnInfo.iSnap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
        switch( iActiveBMConns[i].iConnInfo.iState )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
            case EStarting:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1520
                MPMLOGSTRING2( "IAP %i: Connection state = Starting", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1523
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
            case EStarted:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
                MPMLOGSTRING2( "IAP %i: Connection state = Started", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
            case EIdle:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
                MPMLOGSTRING2( "IAP %i: Connection state = Idle", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
            case ERoaming:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
                MPMLOGSTRING2( "IAP %i: Connection state = Roaming", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
            default:
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
                MPMLOGSTRING2( "IAP %i: Unknown connection state", 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
                    iActiveBMConns[i].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
        MPMLOGSTRING( "" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1553
    MPMLOGSTRING( "Display array of active connections - End" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1554
#endif // _DEBUG
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1555
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1556
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1557
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1558
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1559
// CMPMServer::DefaultConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1560
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1561
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1562
CMPMDefaultConnection* CMPMServer::DefaultConnection()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1563
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1564
    MPMLOGSTRING( "CMPMServer::DefaultConnection:\
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1565
 Default Connection" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1566
    return iDefaultConnection;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1567
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1568
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
// CMPMServer::StartedConnectionExists
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
TInt CMPMServer::StartedConnectionExists( TInt aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
    MPMLOGSTRING( "CMPMServer::StartedConnectionExists" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
    // Loop all connections until EStarted is found or no more connections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
    for ( TInt i = 0; ( i < iActiveBMConns.Count() ); i++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1581
        if ( iActiveBMConns[i].iConnInfo.iState == EStarted &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
                ( aIapId == KErrNotFound || aIapId == iActiveBMConns[i].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
            MPMLOGSTRING( "CMPMServer::StartedConnectionExists: True" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
            return iActiveBMConns[i].iConnInfo.iIapId;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
    // Modem connection may exist, check from connection counter
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
    // 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
    if ( ConnectionCounter() > 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1591
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
        MPMLOGSTRING( "CMPMServer::StartedConnectionExists: True (modem connection)" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
        return KMaxTInt; // arbitrary high number that is NOT from Iap range[0:255] 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
        MPMLOGSTRING( "CMPMServer::StartedConnectionExists: False" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
        return KErrNotFound;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1600
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1601
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1602
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1603
// CMPMServer::AppendWlanQueryQueueL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1604
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1605
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1606
void CMPMServer::AppendWlanQueryQueueL( CMPMWlanQueryDialog* aDlg )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1607
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1608
    if( aDlg )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1609
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1610
        iWlanQueryQueue->AppendL( aDlg );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1611
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1612
    else
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1613
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1614
        MPMLOGSTRING( "CMPMServer::AppendWlanQueryQueueL argument NULL, Error" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1615
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1616
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1617
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1618
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1619
// CMPMServer::StopConnections
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1622
void CMPMServer::StopConnections( TInt aIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
    {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1624
    MPMLOGSTRING2( "CMPMServer::StopConnections aIapId = %d", aIapId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
    for (TInt index = 0; index < iSessions.Count(); index++)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
        {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1627
        CMPMServerSession* session = iSessions[index];
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1628
        // Stop connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
        if ( aIapId == 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
            {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1631
            session->StopConnection();
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
            }
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1633
        else if ( GetBMIap( session->ConnectionId() ) == aIapId )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
            {
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1635
            TRAP_IGNORE( session->StopIAPNotificationL( aIapId ));
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  1636
            }     
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1637
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1639
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
// -----------------------------------------------------------------------------
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1641
// CMPMServer::UpdateActiveConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1642
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1643
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1644
void CMPMServer::UpdateActiveConnection( CMPMServerSession& aSession )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1645
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1646
    // Update active connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1647
    TInt ret = KErrNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1648
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1649
    TRAP ( ret, UpdateActiveConnectionL( aSession ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1650
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1651
    if ( ret != KErrNone )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1652
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1653
        iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1654
        iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1655
        iActiveSnapId = 0;            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1656
        }   
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1657
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1658
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1659
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1660
// CMPMServer::UpdateActiveConnectionL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1661
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1662
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1663
void CMPMServer::UpdateActiveConnectionL( CMPMServerSession& aSession )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1664
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1665
    MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1666
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1667
    TBool keysUpToDate( ETrue );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1668
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1669
    // number of active iaps
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1670
    TInt numberOfActive = NumberOfActiveConnections( keysUpToDate );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1671
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1672
    if ( numberOfActive == 0 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1673
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1674
        // If no active connections then just reset keys and publish
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1675
        iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1676
        iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1677
        iActiveSnapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1678
        PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1679
        return;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1680
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1681
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1682
    if ( keysUpToDate )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1683
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1684
        MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: already up-to-date" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1685
        return;   
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1686
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1687
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1688
    if ( numberOfActive > 1 )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1689
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1690
        // Check if all active connections are in same snap
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1691
        TUint32 snapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1692
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1693
        if ( CommsDatAccess()->AreActiveIapsInSameSnapL(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1694
             iActiveBMConns, snapId, *this ) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1695
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1696
            MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: Active iaps are in one SNAP" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1697
            // Select active connection according to priority
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1698
            CommsDatAccess()->SelectActiveConnectionL (
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1699
                snapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1700
                iActiveBMConns,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1701
                iActiveIapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1702
                iActiveSnapId,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1703
                iActiveBearerType,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1704
                aSession );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1705
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1706
            PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1707
            return;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1708
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1709
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1710
        MPMLOGSTRING( "CMPMServer::UpdateActiveConnectionL: Active iaps are in different SNAPs" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1711
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1712
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1713
    // Reset active connections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1714
    iActiveBearerType = EMPMBearerTypeNone;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1715
    iActiveIapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1716
    iActiveSnapId = 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1717
                
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1718
    // Active connections locating in different snaps
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1719
    // Use priority order vpn, wlan and packet
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1720
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1721
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1722
        CMPMServerSession* serverSession = GetServerSession(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1723
            iActiveBMConns[index].iConnInfo.iConnId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1724
                     	
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1725
        // Do check only for active connections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1726
        if ( iActiveBMConns[index].iConnInfo.iState == EStarted &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1727
        	   serverSession->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1728
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1729
            TMPMBearerType bearerType = EMPMBearerTypeOther;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1730
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1731
            TInt ret = iDedicatedClients.Find( iActiveBMConns[index].iConnInfo.iAppUid );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1732
            if ( ret != KErrNotFound )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1733
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1734
                // Skip dedicated client
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1735
                MPMLOGSTRING2( "Skip dedicated client = %d", iActiveBMConns[index].iConnInfo.iAppUid )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1736
                continue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1737
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1738
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1739
            bearerType = CommsDatAccess()->GetBearerTypeL( 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1740
                         iActiveBMConns[index].iConnInfo.iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1741
        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1742
            if ( bearerType == EMPMBearerTypeOther )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1743
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1744
                // Don't publish this connection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1745
                continue;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1746
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1747
                    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1748
            // This is true if,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1749
            // bearer type is smaller or different than none
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1750
            // or
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1751
            // bearer type is same and iap is different.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1752
            if ( ( bearerType < iActiveBearerType ) || 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1753
                 ( iActiveBearerType == EMPMBearerTypeNone ) ||
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1754
                 ( ( bearerType == iActiveBearerType) &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1755
                   ( iActiveIapId != iActiveBMConns[index].iConnInfo.iIapId ) ) )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1756
                {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1757
                iActiveBearerType = bearerType;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1758
                iActiveIapId = iActiveBMConns[index].iConnInfo.iIapId;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1759
                iActiveSnapId = iActiveBMConns[index].iConnInfo.iSnap;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1760
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1761
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1762
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1763
    PublishActiveConnection();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1764
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1765
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1766
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1767
// CMPMServer::MapBearerType
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1768
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1769
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1770
TUint32 CMPMServer::MapBearerType(TMPMBearerType aBearerType)
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1771
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1772
    MPMLOGSTRING( "CMPMServer::MapBearerType" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1773
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1774
    switch ( aBearerType )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1775
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1776
        case EMPMBearerTypeNone:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1777
            return 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1778
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1779
        case EMPMBearerTypeVpn:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1780
            return KCommDbBearerVirtual;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1781
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1782
        case EMPMBearerTypeWlan:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1783
            return KCommDbBearerWLAN;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1784
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1785
        case EMPMBearerTypePacketData:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1786
            return KCommDbBearerWcdma;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1787
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1788
        case EMPMBearerTypeOther:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1789
            return KCommDbBearerUnknown;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1790
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1791
        default:
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1792
            MPMLOGSTRING( "CMPMServer::MapBearerType: Unknown bearer type" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1793
            break;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1794
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1795
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1796
    return KCommDbBearerUnknown;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1797
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1798
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1799
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1800
// CMPMServer::PublishActiveConnection
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1801
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1802
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1803
void CMPMServer::PublishActiveConnection()
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1804
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1805
    MPMLOGSTRING( "CMPMServer::PublishActiveConnection" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1806
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1807
    // update active connection keys
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1808
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1809
                    KMPMPSKeyActiveConnectionIap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1810
                    iActiveIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1811
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1812
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1813
                    KMPMPSKeyActiveConnectionSnap,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1814
                    iActiveSnapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1815
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1816
    RProperty::Set( KMPMActiveConnectionCategory,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1817
                    KMPMPSKeyActiveConnectionBearer,
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1818
                    MapBearerType( iActiveBearerType ) );    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1819
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1820
    MPMLOGSTRING4( "CMPMServer::PublishActiveConnection: Set to: %d, %d, %d",
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1821
                   iActiveIapId, iActiveSnapId, iActiveBearerType )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1822
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1823
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1824
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1825
// CMPMServer::NumberOfActiveConnections
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1826
// Returns number of active iaps.
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1827
// -----------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1828
//
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1829
TInt CMPMServer::NumberOfActiveConnections( TBool& aKeysUpToDate )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1830
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1831
    MPMLOGSTRING( "CMPMServer::NumberOfActiveConnections" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1832
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1833
    aKeysUpToDate = ETrue; 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1834
    TInt count( 0 );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1835
    RArray<TUint32> activeIaps;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1836
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1837
    activeIaps.Reset();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1838
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1839
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1840
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1841
        CMPMServerSession* serverSession = GetServerSession(
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1842
             iActiveBMConns[index].iConnInfo.iConnId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1843
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1844
        if ( iActiveBMConns[index].iConnInfo.iState == EStarted &&
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1845
             serverSession->ChooseBestIapCalled() )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1846
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1847
            TInt ret = activeIaps.Find( iActiveBMConns[index].iConnInfo.iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1848
 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1849
            if ( ret == KErrNotFound )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1850
                {        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1851
                activeIaps.Append ( iActiveBMConns[index].iConnInfo.iIapId ); 
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1852
                count++;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1853
                }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1854
            
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1855
            if ( iActiveIapId != iActiveBMConns[index].iConnInfo.iIapId )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1856
                 {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1857
                 // iap that is different from current active iap was found
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1858
                 aKeysUpToDate = EFalse;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1859
                 }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1860
            }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1861
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1862
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1863
    activeIaps.Close();
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1864
    MPMLOGSTRING2( "CMPMServer::NumberOfActiveConnections: count = %d", count )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1865
    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1866
    return count;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1867
    }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1868
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1869
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1870
// CMPMServer::UserConnectionInInternet
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1871
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1872
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1873
TBool CMPMServer::UserConnectionInInternet() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1874
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1875
    TBool isInternet = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1876
    TInt ret = KErrNone;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1877
        
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1878
    TRAP( ret, isInternet = iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1879
          UserConnPref()->IapId(), UserConnPref()->SnapId() ) );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1880
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
    if ( ret != KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
        isInternet = EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1884
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1885
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
    return isInternet;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
// CMPMServer::StartForcedRoamingToWlanL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1891
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
void CMPMServer::StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToWlan" )
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1896
 
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1897
    // Copy all available wlan iap ids to own array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1898
    RArray<TUint32> wlanIapIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
    CleanupClosePushL( wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1900
    RAvailableIAPList iapList;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1901
    CleanupClosePushL( iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1902
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  1903
    for ( TUint index = 0; index < aIapInfo.iCount; index++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
        {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1905
        TWlanIapType iapType ( ENotWlanIap );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1906
        TRAPD (leave, iapType = CommsDatAccess()->CheckWlanL( aIapInfo.iIap[index].iIapId ) );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1907
        if ( ( iapType != ENotWlanIap ) && ( leave == KErrNone ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
            // Accept only wlan iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1910
            if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1911
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1912
                wlanIapIds.AppendL( aIapInfo.iIap[index].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1913
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1914
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1915
        // Fill iap list to be used later to check best iap;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1916
        if ( leave == KErrNone )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1917
            {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1918
            iapList.AppendL( aIapInfo.iIap[index].iIapId );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1919
            }
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1920
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
    // No wlans available -> no reason to continue
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
    if ( !wlanIapIds.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
        CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1925
        CleanupStack::PopAndDestroy( &wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
        return;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1928
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1929
    // Go through all active connections and start roaming for the ones connected
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
    // to snap containing wlan and not using mobility api
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1931
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
        // Check if snap is internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
        TBool internetSnap =
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
            iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1936
                iActiveBMConns[index].iConnInfo.iIapId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1937
                iActiveBMConns[index].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1939
        CMPMServerSession* serverSession = GetServerSession(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1940
                iActiveBMConns[index].iConnInfo.iConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1942
        // Check that connection is started, established to snap and
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1943
        // choose best iap is called for the connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1944
        if ( ( iActiveBMConns[index].iConnInfo.iState == EStarted ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1945
             ( iActiveBMConns[index].iConnInfo.iSnap ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1946
             ( serverSession->ChooseBestIapCalled() ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1947
             ( internetSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
            // Notify client to disconnect
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1950
            NotifyDisconnectL( index, wlanIapIds, iapList, ETrue,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1951
                EMPMBearerTypeWlan );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1952
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1953
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1954
    CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1955
    CleanupStack::PopAndDestroy( &wlanIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1956
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1957
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1958
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1959
// ---------------------------------------------------------------------------
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1960
// CMPMServer::StartForcedRoamingToConnectedWlanL
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1961
// ---------------------------------------------------------------------------
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1962
//    
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1963
TInt CMPMServer::StartForcedRoamingToConnectedWlanL( TAny* aUpdater )
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1964
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1965
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedWlanL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1966
    CMPMServer* self = static_cast<CMPMServer*>( aUpdater );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1967
    if ( self )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1968
        {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1969
        // cancel the periodic object        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1970
        self->iRoamingToWlanPeriodic->Cancel();
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1971
        TRAPD( error, self->StartForcedRoamingToWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1972
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1973
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1974
            MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error1 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1975
            return 0;
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1976
            }
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1977
            
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1978
        // Added also execution of policy based roaming logic because
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1979
        // connections that are in EStarting state, when WLAN signal
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  1980
        // gets weak, would remain in WLAN as long as signal is weak. 
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1981
        TRAP( error, self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1982
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1983
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1984
            MPMLOGSTRING2("CMPMServer::StartForcedRoamingToConnectedWlan error2 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1985
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1986
        }
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1987
    return 0;
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1988
    }
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  1989
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1990
// ---------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1991
// CMPMServer::StartForcedRoamingToConnectedHotspotWlanL
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1992
// ---------------------------------------------------------------------------
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1993
//    
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1994
TInt CMPMServer::StartForcedRoamingToConnectedHotspotWlanL( TAny* aUpdater )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1995
    {
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1996
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingToConnectedHotspotWlanL" )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1997
    CMPMServer* self = static_cast<CMPMServer*>( aUpdater );
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1998
    if ( self )
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  1999
        {        
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2000
        // cancel the periodic object
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2001
        self->iRoamingToHotspotWlanPeriodic->Cancel();
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2002
        TRAPD( error, self->StartForcedRoamingToWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2003
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2004
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2005
            MPMLOGSTRING2("StartForcedRoamingToConnectedHotspotWlanL error1 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2006
            return 0;
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2007
            }
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2008
            
62
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2009
        // Added also execution of policy based roaming logic because
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2010
        // connections that are in EStarting state, when WLAN signal
bb1f80fb7db2 Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 58
diff changeset
  2011
        // gets weak, would remain in WLAN as long as signal is weak. 
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2012
        TRAP( error, self->StartForcedRoamingFromWlanL( self->iConnMonIapInfo ) )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2013
        if ( error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2014
            {        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2015
            MPMLOGSTRING2("StartForcedRoamingToConnectedHotspotWlanL error2 = %d, ", error )
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2016
            }
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2017
        }
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2018
    return 0;
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2019
    }
26
0a9e01492035 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 19
diff changeset
  2020
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2022
// CMPMServer::StartForcedRoamingFromWlanL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2023
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2024
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
void CMPMServer::StartForcedRoamingFromWlanL( const TConnMonIapInfo& aIapInfo )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
    MPMLOGSTRING( "CMPMServer::StartForcedRoamingFromWlan" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2028
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
    // Copy all available packet data iap ids to own array
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
    RArray<TUint32> packetDataIapIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2031
    CleanupClosePushL( packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2033
    for ( TUint index = 0; index < aIapInfo.iCount; index++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
        if ( CommsDatAccess()->GetBearerTypeL( aIapInfo.iIap[index].iIapId ) ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
            EMPMBearerTypePacketData )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2038
            // Accept only packet data iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2039
            if ( iCommsDatAccess->IsInternetSnapL( aIapInfo.iIap[index].iIapId, 0 ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2040
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
                packetDataIapIds.AppendL( aIapInfo.iIap[index].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
    // No packet data iaps available -> no reason to continue
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
    if ( !packetDataIapIds.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
        CleanupStack::PopAndDestroy( &packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
        return;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2051
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2052
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2053
    // Go through all active connections and start roaming for the ones connected
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2054
    // to a wlan not anymore listed in available iaps and not using mobility api
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2055
    for ( TInt index = 0; index < iActiveBMConns.Count(); index++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2056
        {
65
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2057
        TWlanIapType iapType( ENotWlanIap );
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2058
        TRAPD( leave, iapType = iCommsDatAccess->CheckWlanL( iActiveBMConns[index].iConnInfo.iIapId ) )        	
14754bf06654 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  2059
        if ( ( leave == KErrNone ) && ( iapType == EWlanIap ) )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2060
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2061
            // Check if used WLAN is still available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2062
            TBool currentWlanIapAvailable = EFalse;
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2063
            for ( TUint iapIndex = 0; iapIndex < aIapInfo.iCount; iapIndex++ )
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2064
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2065
                if ( aIapInfo.iIap[iapIndex].iIapId ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2066
                    iActiveBMConns[index].iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2067
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2068
                    // Current WLAN IAP found from list of available IAPs
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2069
                    currentWlanIapAvailable = ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2070
                    break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2071
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2072
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2073
            
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2074
            if ( !currentWlanIapAvailable )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2075
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2076
                // Current WLAN not available anymore
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2077
                // Check if snap is internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2078
                TBool internetSnap = iCommsDatAccess->IsInternetSnapL(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2079
                    iActiveBMConns[index].iConnInfo.iIapId,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2080
                    iActiveBMConns[index].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2081
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2082
                CMPMServerSession* serverSession = GetServerSession(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2083
                    iActiveBMConns[index].iConnInfo.iConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2084
                
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2085
                // Check that connection is started, established to snap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2086
                // choose best iap is called for the connection
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2087
                if ( ( iActiveBMConns[index].iConnInfo.iState == EStarted ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2088
                    ( iActiveBMConns[index].iConnInfo.iSnap ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2089
                    ( serverSession->ChooseBestIapCalled() ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2090
                    ( internetSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2091
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2092
                    // Notify client to disconnect, don't check if current
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2093
                    // WLAN IAP is the best because we want to disconnect
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2094
                    // it anyway (it was not included in available IAP
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2095
                    // list anymore)
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2096
                    RAvailableIAPList iapList;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2097
                    CleanupClosePushL( iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2098
                    NotifyDisconnectL( index, packetDataIapIds, iapList, EFalse,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2099
                        EMPMBearerTypePacketData );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2100
                    CleanupStack::PopAndDestroy( &iapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2101
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2102
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2103
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2104
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2105
    CleanupStack::PopAndDestroy( &packetDataIapIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2106
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2107
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2108
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2109
// CMPMServer::NotifyDisconnectL
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2110
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2111
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2112
void CMPMServer::NotifyDisconnectL( TInt aConnIndex,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2113
                                    RArray<TUint32>& aAvailIapIds,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2114
                                    RAvailableIAPList& aIapList,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2115
                                    TBool aCheckForBestIap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2116
                                    TMPMBearerType aDestinationBearerType )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2117
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2118
    MPMLOGSTRING( "CMPMServer::NotifyDisconnectL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2119
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2120
    // Get iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2121
    RArray<TNetIap> destNetIds;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2122
    CleanupClosePushL( destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2123
    CommsDatAccess()->SearchDNEntriesL( iActiveBMConns[aConnIndex].iConnInfo.iSnap,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2124
                                        destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2125
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2126
    // Save available iaps in internet snap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2127
    RArray<TUint32> iapIdsInInternet;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2128
    CleanupClosePushL( iapIdsInInternet );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2129
                        
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2130
    for ( TInt iIndex = 0; iIndex < destNetIds.Count(); iIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2131
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2132
        for ( TInt wIndex = 0; wIndex < aAvailIapIds.Count(); wIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2133
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2134
            if ( destNetIds[iIndex].iIapId == aAvailIapIds[wIndex] )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2135
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2136
                iapIdsInInternet.AppendL( destNetIds[iIndex].iIapId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2137
                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2138
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2139
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2140
                    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2141
        if ( iapIdsInInternet.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2142
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2143
            // Leave loop when count is non-zero
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2144
            break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2145
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2146
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2147
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2148
    // Check if an iap in internet snap is available
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2149
    if ( iapIdsInInternet.Count() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2150
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2151
        // Find session and notify error
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2152
        for (TInt sIndex = 0; sIndex < iSessions.Count(); sIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2153
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2154
            // Check that CMPMIapSelection object exists for the session.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2155
            TRAPD( error, iSessions[sIndex]->IapSelectionL() );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2156
            if ( error == KErrNone )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2157
                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2158
                MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: IapSelectionL() != NULL" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2159
                // Check the connection preferences for forced roaming
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2160
                if ( iSessions[sIndex]->ForcedRoaming() )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2161
                    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2162
                    MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: ForcedRoaming == ETrue" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2163
                    // Notify disconnect error for session,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2164
                    // if mobility api is not used
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2165
                    if ( ( iSessions[sIndex]->ConnectionId() ==
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2166
                        iActiveBMConns[aConnIndex].iConnInfo.iConnId ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2167
                        !iSessions[sIndex]->PreferredIapRequested() &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2168
                        iSessions[sIndex]->IsBearerAccepted( aDestinationBearerType ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2169
                        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2170
                        if ( aCheckForBestIap )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2171
                            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2172
                            // Check whether current IAP and the best IAP are the same.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2173
                            // Disconnection not done if IAPs are the same   
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2174
                            TMpmConnPref connPref;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2175
                            connPref.SetIapId( 0 );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2176
                            connPref.SetSnapId(
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2177
                                iActiveBMConns[aConnIndex].iConnInfo.iSnap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2178
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2179
                            iSessions[sIndex]->IapSelectionL()->ChooseBestIAPL( connPref, aIapList );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2180
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2181
                            // if the best iap is the current iap, don't roam, move to next item
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2182
                            if ( ( aIapList.Count() > 0 ) && 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2183
                                ( connPref.IapId() == iActiveBMConns[aConnIndex].iConnInfo.iIapId ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2184
                                {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2185
                                MPMLOGSTRING( "CMPMServer::NotifyDisconnectL: Same IAP selected. Disconnection not done." )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2186
                                break;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2187
                                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2188
                            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2189
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2190
                        MPMLOGSTRING2( "CMPMServer::NotifyDisconnectL: \
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2191
Disconnected Connection Id = 0x%x", iSessions[sIndex]->ConnectionId() )
12
ea6e024ea6f9 Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 8
diff changeset
  2192
                        iSessions[sIndex]->ClientErrorNotificationL( KErrForceDisconnected );
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2193
                        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2194
                    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2195
                }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2196
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2197
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2198
            
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2199
    CleanupStack::PopAndDestroy( &iapIdsInInternet );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2200
    CleanupStack::PopAndDestroy( &destNetIds );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2201
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2202
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2203
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2204
// CMPMServer::IsVisitorNetwork
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2205
// 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2206
// Checks if phone is in visitor network or in home network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2207
// Return ETrue if phone is in visitor network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2208
// Return EFalse if phone is not in visitor network.
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2209
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2210
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2211
TBool CMPMServer::IsVisitorNetwork() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2212
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2213
    MPMLOGSTRING( "CMPMServer::IsVisitorNetwork" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2214
    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2215
    if ( iRoamingWatcher->RoamingStatus()== EMPMInternationalRoaming )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2216
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2217
        MPMLOGSTRING( "CMPMServer::IsVisitorNetwork: TRUE" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2218
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2219
        } 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2220
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2221
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2222
        MPMLOGSTRING( "CMPMServer::IsVisitorNetwork: FALSE" )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2223
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2224
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2225
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2226
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2227
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2228
// CMPMServer::GetServerSession
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2229
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2230
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2231
CMPMServerSession* CMPMServer::GetServerSession( TConnectionId aConnId ) const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2232
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2233
    MPMLOGSTRING2( "CMPMServer::GetServerSession: \
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2234
Connection Id = 0x%x", aConnId );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2235
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2236
    CMPMServerSession* serverSession = NULL;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2237
    for ( TInt sIndex = 0; sIndex < iSessions.Count(); sIndex++ )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2238
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2239
        if ( iSessions[sIndex]->ConnectionId() == aConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2240
            {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2241
            serverSession = iSessions[sIndex];
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2242
            }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2243
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2244
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2245
    ASSERT( serverSession != NULL );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2246
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2247
    return serverSession;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2248
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2249
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2250
// ---------------------------------------------------------------------------
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2251
// CMPMServer::StopCellularConns
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2252
// Stop all cellular connections except MMS
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2253
// ---------------------------------------------------------------------------
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2254
//
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
  2255
void CMPMServer::StopCellularConns()
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2256
    {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2257
    MPMLOGSTRING( "CMPMServer::StopCellularConns" )
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2258
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2259
    TUint32 iapId;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2260
	TMPMBearerType bearerType = EMPMBearerTypeNone;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2261
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2262
	// No cleanup stack used cause this function doesn't leave.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2263
    RArray<TUint32> stoppedIaps;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2264
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2265
    // Check through active connections
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2266
    for (TInt i = 0; i < iActiveBMConns.Count(); i++)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2267
        {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2268
        iapId = iActiveBMConns[i].iConnInfo.iIapId;
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2269
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2270
        // Don't stop the same IAP twice.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2271
        if (stoppedIaps.Find( iapId ) == KErrNotFound)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2272
            {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2273
            TRAPD( err, bearerType = CommsDatAccess()->GetBearerTypeL( iapId ) );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2274
            if (err == KErrNone &&
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2275
                    iapId != 0 &&
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2276
                    bearerType == EMPMBearerTypePacketData)
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2277
                {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2278
                TInt mmsIap( 0 );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2279
                err = RProperty::Get( KMPMCathegory, KMPMPropertyKeyMMS, mmsIap );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2280
                // Check that it's not MMS IAP.
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2281
                if (!(err == KErrNone && iapId == mmsIap))
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2282
                    {
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2283
                    // Stop the conn / IAP.
69
cf1b3ddbe9a1 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 65
diff changeset
  2284
                    StopConnections( iapId );
8
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2285
                    stoppedIaps.Append( iapId );
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2286
                    }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2287
                }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2288
            }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2289
        }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2290
    stoppedIaps.Close();
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2291
    }
2e6c4614c58e Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 3
diff changeset
  2292
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2293
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2294
// CMPMServer::UpdateOfflineMode
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2295
// Offline watcher listens the offline mode and calls this when it's changed.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2296
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2297
//
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2298
void CMPMServer::UpdateOfflineMode( TInt newModeValue )
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2299
    {
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2300
    MPMLOGSTRING2( "CMPMServer::UpdateOfflineMode: Value %d", newModeValue )
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2301
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2302
    iOfflineMode = newModeValue;
17
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2303
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2304
    if ( iOfflineMode == ECoreAppUIsNetworkConnectionAllowed )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2305
        {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2306
        // Offline mode finished, reset the QueryResponse variable.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2307
        iOfflineWlanQueryResponse = EOfflineResponseUndefined;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2308
        }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2309
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2310
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2311
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2312
// CMPMServer::IsPhoneOffline
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2313
// Returns the current offline mode.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2314
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2315
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2316
TBool CMPMServer::IsPhoneOffline()
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2317
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2318
    MPMLOGSTRING( "CMPMServer::IsPhoneOffline" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2319
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2320
    TBool retval = EFalse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2321
    if ( iOfflineMode == ECoreAppUIsNetworkConnectionNotAllowed)
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2322
        {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2323
        retval = ETrue;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2324
        MPMLOGSTRING( "CMPMServer::IsPhoneOffline: Yes." )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2325
        }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2326
    return retval;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2327
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2328
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2329
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2330
// CMPMServer::OfflineWlanQueryResponse
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2331
// Tells the "Use WLAN in offline mode" query's response during the
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2332
// current offline mode session.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2333
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2334
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2335
TOfflineWlanQueryResponse CMPMServer::OfflineWlanQueryResponse()
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2336
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2337
    MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2338
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2339
#ifndef _PLATFORM_SIMULATOR_
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2340
    MPMLOGSTRING2( "CMPMServer::IsOfflineWlanQueryAccepted: %d", iOfflineWlanQueryResponse )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2341
    return iOfflineWlanQueryResponse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2342
#else
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2343
    // Platsim simulates WLAN and offline-mode. To ease automated testing,
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2344
    // offline connection confirmation is not asked in Platsim-variant
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2345
    MPMLOGSTRING( "CMPMServer::OfflineWlanQueryResponse: yes for Platsim" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2346
    return EOfflineResponseYes;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2347
#endif
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2348
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2349
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2350
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2351
// CMPMServer::SetOfflineWlanQueryResponse
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2352
// Called when the "Use WLAN in offline mode" note has been responded.
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2353
// ---------------------------------------------------------------------------
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2354
//
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2355
void CMPMServer::SetOfflineWlanQueryResponse( TOfflineWlanQueryResponse aResponse)
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2356
    {
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2357
    MPMLOGSTRING( "CMPMServer::SetOfflineWlanQueryResponse" )
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2358
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2359
    iOfflineWlanQueryResponse = aResponse;
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2360
    }
c14618f9de99 Revision: 201013
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
  2361
55
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2362
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2363
// CMPMServer::StartConnPermQueryTimer
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2364
// Starts the connection permission query timer.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2365
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2366
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2367
void CMPMServer::StartConnPermQueryTimer()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2368
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2369
    MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2370
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2371
    if ( !iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2372
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2373
        TRAPD( err, iConnPermQueryTimer = CMPMConnPermQueryTimer::NewL( this ) );
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2374
        if ( err == KErrNone )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2375
            {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2376
            iConnPermQueryTimer->StartTimer();
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2377
            MPMLOGSTRING( "CMPMServer::StartConnPermQueryTimer: Ok." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2378
            }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2379
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2380
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2381
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2382
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2383
// CMPMServer::ResetConnPermQueryTimer
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2384
// Resets the connection permission query timer.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2385
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2386
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2387
void CMPMServer::ResetConnPermQueryTimer()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2388
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2389
    MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2390
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2391
    if ( iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2392
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2393
        delete iConnPermQueryTimer;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2394
        iConnPermQueryTimer = NULL;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2395
        MPMLOGSTRING( "CMPMServer::ResetConnPermQueryTimer: Ok." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2396
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2397
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2398
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2399
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2400
// CMPMServer::IsConnPermQueryTimerOn
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2401
// Tells if the connection permission query timer is on.
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2402
// ---------------------------------------------------------------------------
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2403
//
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2404
TBool CMPMServer::IsConnPermQueryTimerOn()
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2405
    {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2406
    MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn" )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2407
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2408
    TBool retval = EFalse;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2409
    if ( iConnPermQueryTimer )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2410
        {
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2411
        retval = ETrue;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2412
        MPMLOGSTRING( "CMPMServer::IsConnPermQueryTimerOn: Yes." )
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2413
        }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2414
    return retval;
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2415
    }
fc7b30ed2058 Revision: 201030
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 45
diff changeset
  2416
58
83ca720e2b9a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 57
diff changeset
  2417
// -----------------------------------------------------------------------------
0
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2418
// TMPMBlackListConnId::Append
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2419
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2420
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2421
void TMPMBlackListConnId::Append( TUint32 aIap, TBlacklistCategory aCategory )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2422
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2423
    iBlackListIap.Append( aIap );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2424
    iCategory.Append( aCategory );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2425
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2426
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2427
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2428
// TMPMBlackListConnId::Remove
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2429
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2430
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2431
void TMPMBlackListConnId::Remove( TInt aIndex )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2432
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2433
    iBlackListIap.Remove( aIndex );
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2434
    iCategory.Remove( aIndex );    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2435
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2436
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2437
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2438
// TMPMBlackListConnId::Close
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2439
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2440
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2441
void TMPMBlackListConnId::Close()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2442
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2443
    iBlackListIap.Close();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2444
    iCategory.Close();    
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2445
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2446
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2447
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2448
// TMPMBlackListConnId::Count
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2449
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2450
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2451
TInt TMPMBlackListConnId::Count() const
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2452
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2453
    return iBlackListIap.Count();
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2454
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2455
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2456
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2457
// TConnectionInfo::TConnectionInfo
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2458
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2459
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2460
TConnectionInfo::TConnectionInfo() 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2461
    : iConnId( 0 ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2462
      iSnap( 0 ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2463
      iIapId( 0 ), 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2464
      iState( EIdle ),
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2465
      iAppUid( 0 )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2466
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2467
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2468
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2469
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2470
// TConnectionInfo::MatchId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2471
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2472
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2473
TBool TConnectionInfo::MatchId( const TConnectionInfo& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2474
                                       const TConnectionInfo& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2475
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2476
    if ( aFirst.iConnId == aSecond.iConnId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2477
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2478
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2479
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2480
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2481
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2482
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2483
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2484
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2485
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2486
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2487
// TConnectionInfo::MatchIdSnap
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2488
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2489
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2490
TBool TConnectionInfo::MatchIdSnap( const TConnectionInfo& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2491
                                    const TConnectionInfo& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2492
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2493
    if ( ( aFirst.iConnId  == aSecond.iConnId ) &&
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2494
         ( aFirst.iSnap    == aSecond.iSnap ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2495
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2496
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2497
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2498
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2499
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2500
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2501
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2502
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2503
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2504
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2505
// TActiveBMConn::TActiveBMConn
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2506
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2507
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2508
TActiveBMConn::TActiveBMConn() 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2509
    : iConnInfo()
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2510
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2511
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2512
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2513
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2514
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2515
// TActiveBMConn::MatchIapId
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2516
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2517
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2518
TBool TActiveBMConn::MatchIapId( const TActiveBMConn& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2519
                                 const TActiveBMConn& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2520
    {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2521
    if ( aFirst.iConnInfo.iIapId == aSecond.iConnInfo.iIapId )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2522
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2523
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2524
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2525
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2526
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2527
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2528
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2529
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2530
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2531
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2532
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2533
// TActiveBMConn::MatchConnInfo
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2534
// -----------------------------------------------------------------------------
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2535
//
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2536
TBool TActiveBMConn::MatchConnInfo( const TActiveBMConn& aFirst,
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2537
                                    const TActiveBMConn& aSecond )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2538
    { 
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2539
    if ( TConnectionInfo::MatchId( aFirst.iConnInfo, aSecond.iConnInfo ) )
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2540
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2541
        return ETrue;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2542
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2543
    else
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2544
        {
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2545
        return EFalse;
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2546
        }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2547
    }
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2548
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2549
5a93021fdf25 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2550
//  End of File