bluetoothengine/btmac/src/BTMonoCmdHandler/BTMonoCdmaIncomingFlash.cpp
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  General Active Object offering asynchronous service
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "BTMonoCdmaIncomingFlash.h"
       
    20 #include "BTMonoCallActive.h"
       
    21 #include "Debug.h"
       
    22 
       
    23 _LIT(KDefaultRemoteNumber, "n/a");
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CBTMonoCdmaIncomingFlash::NewL
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CBTMonoCdmaIncomingFlash* CBTMonoCdmaIncomingFlash::NewL(
       
    32     MBTMonoActiveObserver& aObserver, 
       
    33     CActive::TPriority aPriority,
       
    34     TInt aServiceId,
       
    35 	RMobileLine& aLine, 
       
    36 	const TName& aName)
       
    37     {
       
    38 	CBTMonoCdmaIncomingFlash * self = 
       
    39 	    CBTMonoCdmaIncomingFlash::NewLC(aObserver, aPriority, aServiceId, aLine, aName);
       
    40     CleanupStack::Pop(self);
       
    41     return self;
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CBTMonoCdmaIncomingFlash::NewLC
       
    46 // -----------------------------------------------------------------------------
       
    47 CBTMonoCdmaIncomingFlash* CBTMonoCdmaIncomingFlash::NewLC(
       
    48     MBTMonoActiveObserver& aObserver, 
       
    49     CActive::TPriority aPriority, 
       
    50     TInt aServiceId,
       
    51     RMobileLine& aLine,
       
    52     const TName& aName)
       
    53     {
       
    54     CBTMonoCdmaIncomingFlash* self = 
       
    55         new (ELeave) CBTMonoCdmaIncomingFlash(aObserver, aPriority, aServiceId, aLine, aName);
       
    56     CleanupStack::PushL(self);
       
    57     self->ConstructL();
       
    58 	return self;
       
    59     }
       
    60 
       
    61 // Destructor
       
    62 CBTMonoCdmaIncomingFlash::~CBTMonoCdmaIncomingFlash()
       
    63 	{
       
    64 	Cancel();
       
    65 	iCdmaCall.Close();
       
    66 	TRACE_FUNC_THIS
       
    67     }
       
    68 
       
    69 void CBTMonoCdmaIncomingFlash::GoActive()
       
    70     {
       
    71     if (!IsActive())
       
    72         {
       
    73     	iCdmaCall.NotifyIncomingNetworkFlashWithInfo(iStatus, iFlashMessagePckg);
       
    74         SetActive();
       
    75         }
       
    76     TRACE_FUNC_THIS
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CBTMonoCdmaIncomingFlash::DoCancel
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void CBTMonoCdmaIncomingFlash::DoCancel()
       
    84     {
       
    85 	iCdmaCall.CancelAsyncRequest(ECdmaMobileCallNotifyIncomingNetworkFlashWithInfo);
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CBTMonoCdmaIncomingFlash::RunL
       
    90 // 
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 void CBTMonoCdmaIncomingFlash::RunL()
       
    94     {
       
    95     TRACE_FUNC_ENTRY_THIS
       
    96 	Observer().RequestCompletedL(*this, iStatus.Int());
       
    97 	TRACE_FUNC_EXIT
       
    98     }
       
    99 
       
   100 // -------------------------------------------------------------------------------
       
   101 // CBTMonoCdmaIncomingFlash::RunError
       
   102 // -------------------------------------------------------------------------------
       
   103 TInt CBTMonoCdmaIncomingFlash::RunError(TInt /*aErr*/)
       
   104     {
       
   105 	Cancel();
       
   106 	iCdmaCall.Close();
       
   107     TRACE_FUNC_THIS
       
   108     return KErrNone;
       
   109     }
       
   110 
       
   111 // -----------------------------------------------------------------------------
       
   112 // CBTMonoCdmaIncomingFlash::CBTMonoCdmaIncomingFlash
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 CBTMonoCdmaIncomingFlash::CBTMonoCdmaIncomingFlash(
       
   116     MBTMonoActiveObserver& aObserver,
       
   117     CActive::TPriority aPriority,
       
   118     TInt aServiceId,
       
   119     RMobileLine& aLine,
       
   120     const TName& aName)
       
   121     : CBTMonoActive(aObserver, aPriority, aServiceId),
       
   122 	  iCdmaLine(aLine),
       
   123 	  iCallName(aName),
       
   124 	  iFlashMessagePckg(RCdmaMobileCall::TMobileCallIncomingFlashMessageV1())    
       
   125     {
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CBTMonoCdmaIncomingFlash::ConstructL
       
   130 // -----------------------------------------------------------------------------
       
   131 //
       
   132 void CBTMonoCdmaIncomingFlash::ConstructL()
       
   133     {
       
   134 	LEAVE_IF_ERROR(iCdmaCall.OpenExistingCall(iCdmaLine, iCallName))
       
   135 	TRACE_FUNC_THIS
       
   136     }
       
   137 
       
   138 // End of File