telephonyserver/etelpacketdata/dtsy/pcktphonetsy.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 //
       
    15 
       
    16 #include "pckttsy.h"
       
    17 #include "etelpckt.h"
       
    18 #include <et_clsvr.h>
       
    19 #include "dpcktlog.h"
       
    20 #include <pcktcs.h>
       
    21 #include "testdef.h"
       
    22 
       
    23 #include "coretsy.h"
       
    24 
       
    25 
       
    26 extern "C"
       
    27 /**
       
    28  * First ordinal function - Force "Proper Name" export
       
    29  */
       
    30 	{
       
    31 	IMPORT_C CPhoneFactoryBase* LibEntry();	
       
    32 	}
       
    33 
       
    34 EXPORT_C CPhoneFactoryBase* LibEntry()
       
    35 /**
       
    36  * Ordinal function.
       
    37  */
       
    38 	{
       
    39 	return new CPhoneFactoryDGprsTsy;
       
    40 	}
       
    41 
       
    42 /**************************************************************************/
       
    43 //
       
    44 //	CPhoneFactoryDGprsTsy
       
    45 //
       
    46 /**************************************************************************/
       
    47 
       
    48 CPhoneFactoryDGprsTsy::CPhoneFactoryDGprsTsy()
       
    49 	{
       
    50 	iVersion=TVersion(	KTsyEtelMajorVersionNumber,
       
    51 						KTsyEtelMinorVersionNumber,
       
    52 						KTsyEtelBuildVersionNumber);
       
    53 	}
       
    54 
       
    55 CPhoneFactoryDGprsTsy::~CPhoneFactoryDGprsTsy()
       
    56 	{
       
    57 	LOGDESTROY();
       
    58 	}
       
    59 
       
    60 CPhoneBase * CPhoneFactoryDGprsTsy::NewPhoneL(const TDesC& aName)
       
    61 	{
       
    62 	LOGTEXT(_L8("CPhoneFactoryDGprsTsy: NewPhoneL()"));
       
    63 
       
    64 	if (aName.Compare(DPCKTTSY_PHONE_NAME)==KErrNone)
       
    65 		return CPhoneDGprsTsy::NewL(this);
       
    66 	return NULL;
       
    67 	}
       
    68 
       
    69 TBool CPhoneFactoryDGprsTsy::IsSupported(const TInt /*aMixin*/)
       
    70 	{
       
    71 	return EFalse;
       
    72 	}
       
    73 
       
    74 
       
    75 
       
    76 /**************************************************************************/
       
    77 //
       
    78 //	CPhoneDGprsTsy
       
    79 //
       
    80 /**************************************************************************/
       
    81 
       
    82 CPhoneDGprsTsy* CPhoneDGprsTsy::NewL(CPhoneFactoryDummyBase* aFac)
       
    83 /**
       
    84  * NewL method - Standard 2 phase constructor.
       
    85  */
       
    86 	{
       
    87 	LOGTEXT(_L8("CPhoneDGprsTsy: NewL()"));
       
    88 
       
    89 	CPhoneDGprsTsy* phone=new(ELeave) CPhoneDGprsTsy(aFac);
       
    90 	CleanupStack::PushL(phone);
       
    91 	phone->ConstructL();
       
    92 	CleanupStack::Pop();
       
    93 	return phone;
       
    94 	}
       
    95 
       
    96 CPhoneDGprsTsy::CPhoneDGprsTsy(CPhoneFactoryDummyBase* aFac)
       
    97 	:CPhoneDummyBase(aFac)
       
    98 	{}
       
    99 
       
   100 void CPhoneDGprsTsy::ConstructL()
       
   101 /**
       
   102  * ConstructL method
       
   103  */
       
   104 	{
       
   105 	CPhoneDummyBase::ConstructL();
       
   106 	LOGTEXT(_L8("CPhoneDGprsTsy::ConstructL()"));
       
   107 	}
       
   108   
       
   109 CPhoneDGprsTsy::~CPhoneDGprsTsy()
       
   110 /** 
       
   111  * Destructor
       
   112  */
       
   113 	{
       
   114 	LOGTEXT(_L8("CPhoneDGprsTsy::~CPhoneDGprsTsy"));
       
   115 	}
       
   116 
       
   117 void CPhoneDGprsTsy::Init()
       
   118 /** 
       
   119  * Server calls this function once it has created the sub-session. It gives the TSY a chance 
       
   120  * to do any initialisation it may need to do for this sub-session.
       
   121  */
       
   122 	{}
       
   123 
       
   124 CTelObject* CPhoneDGprsTsy::OpenNewObjectByNameL(const TDesC& aName)
       
   125 /**
       
   126  * Server calls this function when a client is opening an object from the phone for the 
       
   127  * first time. Multiple clients opening handles to the same sub-session object will be 
       
   128  * dealt with by the server - i.e. by reference counting.
       
   129  */
       
   130 	{
       
   131 	LOGTEXT(_L8("CPhoneDGprsTsy: OpenNewObjectByNameL() called"));
       
   132 
       
   133 	if(aName.Compare(DPCKTTSY_PACKET_NAME)==KErrNone)
       
   134 	   return REINTERPRET_CAST(CTelObject*,CGprsDGprsTsy::NewL(FacPtr()));
       
   135 
       
   136 	return NULL;
       
   137 	}
       
   138 
       
   139 CTelObject* CPhoneDGprsTsy::OpenNewObjectL(TDes& /*aNewName*/)
       
   140 /**
       
   141  * This method is not supported in this dummy TSY.
       
   142  */
       
   143 	{
       
   144 	LOGTEXT(_L8("CPhoneDGprsTsy: OpenNewObjectL, Not supported()"));
       
   145 
       
   146 	User::Leave(KErrNotSupported);
       
   147 	return NULL;
       
   148 	}
       
   149 
       
   150 
       
   151 CTelObject::TReqMode CPhoneDGprsTsy::ReqModeL(const TInt /*aIpc*/)
       
   152 	{
       
   153 	return 0;
       
   154 	}
       
   155 
       
   156 TInt CPhoneDGprsTsy::RegisterNotification(const TInt /*aIpc*/)
       
   157 	{
       
   158 	return KErrNotSupported;
       
   159 	}
       
   160 
       
   161 TInt CPhoneDGprsTsy::DeregisterNotification(const TInt /*aIpc*/)
       
   162 	{
       
   163 	return KErrNotSupported;
       
   164 	}
       
   165 
       
   166 TInt CPhoneDGprsTsy::NumberOfSlotsL(const TInt /*aIpc*/)
       
   167 	{
       
   168 	User::Leave(KErrNotSupported);
       
   169 	return NULL;
       
   170 	}
       
   171 
       
   172 
       
   173 TInt CPhoneDGprsTsy::ExtFunc(const TTsyReqHandle /*aTsyReqHandle*/,const TInt /*aIpc*/,
       
   174 		 				 const TDataPackage& /*aPackage*/)
       
   175 	{
       
   176 	return KErrNotSupported;
       
   177 	}
       
   178 
       
   179 TInt CPhoneDGprsTsy::CancelService(const TInt /*aIpc*/,const TTsyReqHandle /*aTsyReqHandle*/)
       
   180 	{
       
   181 	return KErrNotSupported;
       
   182 	}
       
   183 
       
   184 
       
   185 CPhoneDGprsTsy* CPhoneDGprsTsy::This(TAny* aPtr)
       
   186 	{
       
   187 	return REINTERPRET_CAST(CPhoneDGprsTsy*,aPtr);
       
   188 	}