telephonyprotocols/umtsgprsscpr/src/RSpudManInterface.cpp
changeset 68 d0d9cc530d21
parent 62 8ef833fbf5aa
child 75 f45cd1ad4667
equal deleted inserted replaced
62:8ef833fbf5aa 68:d0d9cc530d21
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // The MSpudManInterface handle implementation.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "RSpudManInterface.h"
       
    24 
       
    25 
       
    26 RSpudManInterface::RSpudManInterface()
       
    27    :iSpudManImpl(NULL)
       
    28 {
       
    29 #ifdef __FLOG_ACTIVE
       
    30    // Logging tags
       
    31    _LIT8(KUmtsGprsLogTag1,"SubConn");
       
    32    _LIT8(KUmtsGprsLogTag2,"UmtsGprs");
       
    33 	__FLOG_OPEN(KUmtsGprsLogTag1, KUmtsGprsLogTag2);
       
    34 #endif
       
    35 }
       
    36 
       
    37 
       
    38 void RSpudManInterface::Init(MSpudManInterface* aSpudManImpl)
       
    39 {
       
    40    __FLOG_2(_L("RSpudManInterface::Init: [this=%08x] [aSpudManImpl=%08x]"), this, aSpudManImpl);
       
    41    iSpudManImpl = aSpudManImpl;
       
    42 }
       
    43 
       
    44 
       
    45 void RSpudManInterface::Input(TContextId aContextId, TInt aEvent, TInt aParam)
       
    46 {
       
    47    if (iSpudManImpl)
       
    48       {
       
    49       //ignoring calls to an unitialised handle - apparently there is no 
       
    50       //SpudMan.
       
    51       __FLOG_4(_L("RSpudManInterface::Input: Sending input. [this=%08x] [aContextId=%d] [aEvent=%d] [aParam=%d]"),
       
    52          this, aContextId, aEvent, aParam);
       
    53       iSpudManImpl->Input(aContextId, aEvent, aParam);        
       
    54       }
       
    55    else
       
    56       {
       
    57       __FLOG_4(_L("RSpudManInterface::Input: Discarding input. [this=%08x] [aContextId=%d] [aEvent=%d] [aParam=%d]"),
       
    58          this, aContextId, aEvent, aParam);
       
    59       }
       
    60 }
       
    61 
       
    62 void RSpudManInterface::SetContextTerminationErrorAndStop(TContextId aContextId, TInt aErrorCode)
       
    63 {
       
    64    if (iSpudManImpl)
       
    65       {
       
    66       //ignoring calls to an unitialised handle - apparently there is no 
       
    67       //SpudMan.
       
    68       __FLOG_3(_L("SetContextTerminationErrorAndStop: [this=%08x] [aContextId=%d] [aErrorCode=%d]"),
       
    69          this, aContextId, aErrorCode);
       
    70       iSpudManImpl->SetContextTerminationErrorAndStop(aContextId, aErrorCode);        
       
    71       }
       
    72    else
       
    73       {
       
    74       __FLOG_3(_L("RSpudManInterface::SetContextTerminationErrorAndStop: Discarded! [this=%08x] [aContextId=%d] [aErrorCode=%d]"),
       
    75          this, aContextId, aErrorCode);
       
    76       }
       
    77 }
       
    78 
       
    79 void RSpudManInterface::Close ()
       
    80 {
       
    81    __FLOG_1(_L("RSpudManInterface::Close: [this=%08x]"), this);
       
    82    
       
    83    if (iSpudManImpl)
       
    84       {
       
    85       // Clear the member first to avoid ping-ponging Close() messages
       
    86       // between the PdpFsmInterface and SpudManInterface
       
    87       MSpudManInterface* spudManImpl = iSpudManImpl;
       
    88       iSpudManImpl = NULL;
       
    89       spudManImpl->Input (0, KPdpFsmShuttingDown, 0);
       
    90    }
       
    91 }
       
    92