bluetoothengine/btmac/src/BTMonoCmdHandler/btmcnumber.cpp
author hgs
Sat, 24 Apr 2010 00:30:17 +0300
changeset 26 b78e66e88238
parent 22 4255033c5d30
permissions -rw-r--r--
201015
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
f63038272f30 Revision: 201001
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".
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  General Active Object offering asynchronous service
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "atcodec.h"
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "btmcprotocol.h"
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "btmcnumber.h"
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <mmtsy_names.h>
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "debug.h"
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
// CBtmcNumber::NewL
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
CBtmcNumber* CBtmcNumber::NewL(
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
    MBtmcActiveObserver& aObserver,
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
    CBtmcProtocol& aProtocol, 
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
    CActive::TPriority aPriority, 
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
    TInt aServiceId)
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
    CBtmcNumber* self = new (ELeave) CBtmcNumber(aObserver, aProtocol, aPriority, aServiceId);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
    CleanupStack::PushL(self);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
    self->ConstructL();
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
    CleanupStack::Pop(self);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    return self;
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
// CBtmcNumber::~CBtmcNumber
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
CBtmcNumber::~CBtmcNumber()
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    TRACE_FUNC_ENTRY
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    Cancel();
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    iStore.Close();
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    iPhone.Close();
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    iServer.UnloadPhoneModule(KMmTsyModuleName);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    iServer.Close();
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    TRACE_FUNC_EXIT
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
// CBtmcNumber::GoActive
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
void CBtmcNumber::GoActive()
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
    TRACE_ASSERT(!IsActive(), KErrGeneral);
22
hgs
parents: 0
diff changeset
    60
    GetMsisdnStoreInfo();
hgs
parents: 0
diff changeset
    61
    TRACE_FUNC
hgs
parents: 0
diff changeset
    62
    }
hgs
parents: 0
diff changeset
    63
hgs
parents: 0
diff changeset
    64
// -------------------------------------------------------------------------------
hgs
parents: 0
diff changeset
    65
// CBtmcNumber::GetMsisdnStoreInfo
hgs
parents: 0
diff changeset
    66
// -------------------------------------------------------------------------------
hgs
parents: 0
diff changeset
    67
void CBtmcNumber::GetMsisdnStoreInfo()
hgs
parents: 0
diff changeset
    68
    {
hgs
parents: 0
diff changeset
    69
    TRACE_FUNC_ENTRY
hgs
parents: 0
diff changeset
    70
    iState = EStateGettingMsisdnStoreInfo;
hgs
parents: 0
diff changeset
    71
    iStore.GetInfo(iStatus, iOnStoreInfoPckg);
hgs
parents: 0
diff changeset
    72
    SetActive();
hgs
parents: 0
diff changeset
    73
    TRACE_FUNC_EXIT
hgs
parents: 0
diff changeset
    74
    }
hgs
parents: 0
diff changeset
    75
hgs
parents: 0
diff changeset
    76
// -------------------------------------------------------------------------------
hgs
parents: 0
diff changeset
    77
// CBtmcNumber::GetMsisdnStoreEntry
hgs
parents: 0
diff changeset
    78
// -------------------------------------------------------------------------------
hgs
parents: 0
diff changeset
    79
void CBtmcNumber::GetMsisdnStoreEntry()
hgs
parents: 0
diff changeset
    80
    {
hgs
parents: 0
diff changeset
    81
    TRACE_FUNC_ENTRY
hgs
parents: 0
diff changeset
    82
    iState = EStateGettingMsisdnStoreEntry;
hgs
parents: 0
diff changeset
    83
    iEntry.iIndex = iUsedEntriesCount++;
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
    iStore.Read(iStatus, iPckg);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
    SetActive();
22
hgs
parents: 0
diff changeset
    86
    TRACE_FUNC_EXIT
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
// CBtmcNumber::RunL
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
void CBtmcNumber::RunL()
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    TRACE_FUNC_ENTRY
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    
22
hgs
parents: 0
diff changeset
    96
    switch (iState)
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
        {
22
hgs
parents: 0
diff changeset
    98
        case EStateGettingMsisdnStoreEntry:
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
            {
22
hgs
parents: 0
diff changeset
   100
            if (iStatus == KErrNone)
hgs
parents: 0
diff changeset
   101
                {
hgs
parents: 0
diff changeset
   102
                if(iEntry.iNumber.iTelNumber.Length() == 0)
hgs
parents: 0
diff changeset
   103
                    {
hgs
parents: 0
diff changeset
   104
                    GetMsisdnStoreEntry();
hgs
parents: 0
diff changeset
   105
                    break;
hgs
parents: 0
diff changeset
   106
                    }
hgs
parents: 0
diff changeset
   107
              
hgs
parents: 0
diff changeset
   108
                iCorrectNumbersCount++;
hgs
parents: 0
diff changeset
   109
hgs
parents: 0
diff changeset
   110
                RATResultPtrArray resarr;
hgs
parents: 0
diff changeset
   111
                ATObjArrayCleanupResetAndDestroyPushL(resarr);
hgs
parents: 0
diff changeset
   112
                
hgs
parents: 0
diff changeset
   113
                TBuf8<RMobileONStore::KOwnNumberTextSize> telnumberBuf;
hgs
parents: 0
diff changeset
   114
                telnumberBuf.Copy(iEntry.iNumber.iTelNumber);
hgs
parents: 0
diff changeset
   115
                
hgs
parents: 0
diff changeset
   116
                TRACE_INFO((_L8("ao status %d, phonebook returned %S"), iStatus.Int(), &telnumberBuf))
hgs
parents: 0
diff changeset
   117
                RATParamArray params;
hgs
parents: 0
diff changeset
   118
                CleanupClosePushL(params);
hgs
parents: 0
diff changeset
   119
                LEAVE_IF_ERROR(params.Append(TATParam()))
hgs
parents: 0
diff changeset
   120
                LEAVE_IF_ERROR(params.Append(TATParam(telnumberBuf, EATDQStringParam)))  
hgs
parents: 0
diff changeset
   121
                 
hgs
parents: 0
diff changeset
   122
                TBTMonoATPhoneNumberType numType;
hgs
parents: 0
diff changeset
   123
                if(telnumberBuf.Locate('+') == 0)
hgs
parents: 0
diff changeset
   124
                    {
hgs
parents: 0
diff changeset
   125
                    numType = EBTMonoATPhoneNumberInternational;
hgs
parents: 0
diff changeset
   126
                    }
hgs
parents: 0
diff changeset
   127
                else
hgs
parents: 0
diff changeset
   128
                    {
hgs
parents: 0
diff changeset
   129
                    numType = EBTMonoATPhoneNumberNational;
hgs
parents: 0
diff changeset
   130
                    }
hgs
parents: 0
diff changeset
   131
                LEAVE_IF_ERROR(params.Append(TATParam(numType)))
hgs
parents: 0
diff changeset
   132
                LEAVE_IF_ERROR(params.Append(TATParam()))
hgs
parents: 0
diff changeset
   133
                LEAVE_IF_ERROR(params.Append(TATParam(4)))
hgs
parents: 0
diff changeset
   134
                CATResult* code = CATResult::NewL(EATCNUM, EATActionResult, &params);
hgs
parents: 0
diff changeset
   135
                CleanupStack::PushL(code);
hgs
parents: 0
diff changeset
   136
                resarr.AppendL(code);
hgs
parents: 0
diff changeset
   137
                CleanupStack::Pop(code);
hgs
parents: 0
diff changeset
   138
                CleanupStack::PopAndDestroy(&params);
hgs
parents: 0
diff changeset
   139
                
hgs
parents: 0
diff changeset
   140
                if(iCorrectNumbersCount == iOnStoreInfo.iUsedEntries)
hgs
parents: 0
diff changeset
   141
                    {
hgs
parents: 0
diff changeset
   142
                    CATResult* okerr = CATResult::NewL(EATOK);
hgs
parents: 0
diff changeset
   143
                    CleanupStack::PushL(okerr);
hgs
parents: 0
diff changeset
   144
                    resarr.AppendL(okerr);
hgs
parents: 0
diff changeset
   145
                    CleanupStack::Pop(okerr);
hgs
parents: 0
diff changeset
   146
                    iProtocol.SendResponseL(resarr);
hgs
parents: 0
diff changeset
   147
                    CleanupStack::PopAndDestroy(&resarr);
hgs
parents: 0
diff changeset
   148
                    Observer().RequestCompletedL(*this, iStatus.Int());  
hgs
parents: 0
diff changeset
   149
                    }
hgs
parents: 0
diff changeset
   150
                else
hgs
parents: 0
diff changeset
   151
                    {
hgs
parents: 0
diff changeset
   152
                    iProtocol.SendResponseL(resarr);
hgs
parents: 0
diff changeset
   153
                    CleanupStack::PopAndDestroy(&resarr);
hgs
parents: 0
diff changeset
   154
                    GetMsisdnStoreEntry();
hgs
parents: 0
diff changeset
   155
                    }
hgs
parents: 0
diff changeset
   156
                }
hgs
parents: 0
diff changeset
   157
            else
hgs
parents: 0
diff changeset
   158
                {
hgs
parents: 0
diff changeset
   159
                CATResult* okerr = CATResult::NewL(EATERROR);
hgs
parents: 0
diff changeset
   160
                CleanupStack::PushL(okerr);
hgs
parents: 0
diff changeset
   161
                iProtocol.SendResponseL(*okerr);
hgs
parents: 0
diff changeset
   162
                CleanupStack::PopAndDestroy(okerr);
hgs
parents: 0
diff changeset
   163
                Observer().RequestCompletedL(*this, iStatus.Int());  
hgs
parents: 0
diff changeset
   164
                }
hgs
parents: 0
diff changeset
   165
hgs
parents: 0
diff changeset
   166
            break;
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
            }
22
hgs
parents: 0
diff changeset
   168
        case EStateGettingMsisdnStoreInfo:
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
            {
22
hgs
parents: 0
diff changeset
   170
            if(iStatus==KErrNone && iOnStoreInfo.iUsedEntries>0 && 
hgs
parents: 0
diff changeset
   171
                    (iOnStoreInfo.iCaps & RMobilePhoneStore::KCapsIndividualEntry))
hgs
parents: 0
diff changeset
   172
                {
hgs
parents: 0
diff changeset
   173
                GetMsisdnStoreEntry();
hgs
parents: 0
diff changeset
   174
                }
hgs
parents: 0
diff changeset
   175
            else
hgs
parents: 0
diff changeset
   176
                {
hgs
parents: 0
diff changeset
   177
                CATResult* okerr = CATResult::NewL(EATOK);
hgs
parents: 0
diff changeset
   178
                CleanupStack::PushL(okerr);
hgs
parents: 0
diff changeset
   179
                iProtocol.SendResponseL(*okerr);
hgs
parents: 0
diff changeset
   180
                CleanupStack::PopAndDestroy(okerr);
hgs
parents: 0
diff changeset
   181
                Observer().RequestCompletedL(*this, iStatus.Int());  
hgs
parents: 0
diff changeset
   182
                }
hgs
parents: 0
diff changeset
   183
            break;
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
            }
22
hgs
parents: 0
diff changeset
   185
            
hgs
parents: 0
diff changeset
   186
        default:
hgs
parents: 0
diff changeset
   187
            break;        
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
        }
22
hgs
parents: 0
diff changeset
   189
    
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
    TRACE_FUNC_EXIT
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
22
hgs
parents: 0
diff changeset
   193
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
// CBtmcNumber::DoCancel
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
void CBtmcNumber::DoCancel()
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
    iStore.CancelAsyncRequest(EMobilePhoneStoreRead);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
    TRACE_FUNC
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
// CBtmcNumber::RunError
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
// -------------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
TInt CBtmcNumber::RunError(TInt /*aErr*/)
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
    TRACE_FUNC
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
    return KErrNone;
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
// CBtmcNumber::CBtmcNumber
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
// -----------------------------------------------------------------------------
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
CBtmcNumber::CBtmcNumber(
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
    MBtmcActiveObserver& aObserver, 
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
    CBtmcProtocol& aProtocol, 
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
    CActive::TPriority aPriority, 
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
    TInt aServiceId)
22
hgs
parents: 0
diff changeset
   221
    : CBtmcActive(aObserver, aPriority, aServiceId), iProtocol(aProtocol), iPckg(iEntry),
hgs
parents: 0
diff changeset
   222
    iOnStoreInfoPckg(iOnStoreInfo), iState(EStateNull), iUsedEntriesCount(1), iCorrectNumbersCount(0)
0
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
void CBtmcNumber::ConstructL()
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
    {
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
    TRACE_FUNC_ENTRY
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
    LEAVE_IF_ERROR(iServer.Connect());
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    iServer.LoadPhoneModule(KMmTsyModuleName);
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    LEAVE_IF_ERROR(iPhone.Open(iServer, KMmTsyPhoneName));
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
     LEAVE_IF_ERROR(iStore.Open(iPhone));//, KETelIccMsisdnPhoneBook));
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
    TRACE_FUNC_EXIT
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
    }
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
f63038272f30 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
// End of File