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