smsprotocols/smsstack/wapprot/Src/ws_main.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
       
    15 
       
    16 
       
    17 #include "OstTraceDefinitions.h"
       
    18 #ifdef OST_TRACE_COMPILER_IN_USE
       
    19 #include "ws_mainTraces.h"
       
    20 #endif
    15 
    21 
    16 #include "es_ver.h"
    22 #include "es_ver.h"
    17 #include "es_prot.h"
    23 #include "es_prot.h"
    18 #include "es_wsms.h"
    24 #include "es_wsms.h"
    19 #include "ws_main.h"
    25 #include "ws_main.h"
    35 //
    41 //
    36 // Factory
    42 // Factory
    37 //
    43 //
    38 CWapSmsProtocolFamily * CWapSmsProtocolFamily::NewL()
    44 CWapSmsProtocolFamily * CWapSmsProtocolFamily::NewL()
    39 	{
    45 	{
    40 	LOGWAPPROT1("CWapSmsProtocolFamily::NewL()");
    46 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_NEWL_1, "CWapSmsProtocolFamily::NewL()");
    41 
    47 
    42 	return new (ELeave)CWapSmsProtocolFamily;
    48 	return new (ELeave)CWapSmsProtocolFamily;
    43 	} // CWapSmsProtocolFamily::NewL
    49 	} // CWapSmsProtocolFamily::NewL
    44 
    50 
    45 
    51 
    46 //
    52 //
    47 // Nothing to be done
    53 // Nothing to be done
    48 //
    54 //
    49 TInt CWapSmsProtocolFamily::Install()
    55 TInt CWapSmsProtocolFamily::Install()
    50 	{
    56 	{
    51 	LOGWAPPROT1("CWapSmsProtocolFamily::Install()");
    57 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_INSTALL_1, "CWapSmsProtocolFamily::Install()");
    52 
    58 
    53 	return KErrNone;
    59 	return KErrNone;
    54 	} // CWapSmsProtocolFamily::Install
    60 	} // CWapSmsProtocolFamily::Install
    55 
    61 
    56 
    62 
    57 //
    63 //
    58 // Nothing to be done
    64 // Nothing to be done
    59 //
    65 //
    60 TInt CWapSmsProtocolFamily::Remove()
    66 TInt CWapSmsProtocolFamily::Remove()
    61 	{
    67 	{
    62 	LOGWAPPROT1("CWapSmsProtocolFamily::Remove()");
    68 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_REMOVE_1, "CWapSmsProtocolFamily::Remove()");
    63 
    69 
    64 	return KErrNone;
    70 	return KErrNone;
    65 	} // CWapSmsProtocolFamily::Remove
    71 	} // CWapSmsProtocolFamily::Remove
    66 
    72 
    67 
    73 
    68 //
    74 //
    69 // Return a new CWapSmsProtocol
    75 // Return a new CWapSmsProtocol
    70 //
    76 //
    71 CProtocolBase * CWapSmsProtocolFamily::NewProtocolL(TUint aSockType,TUint /*aProtocol*/)
    77 CProtocolBase * CWapSmsProtocolFamily::NewProtocolL(TUint aSockType,TUint /*aProtocol*/)
    72 	{
    78 	{
    73 	LOGWAPPROT1("CWapSmsProtocolFamily::NewProtocolL()");
    79 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_NEWPROTOCOLL_1, "CWapSmsProtocolFamily::NewProtocolL()");
    74 
    80 
    75 	if (aSockType!=KSockDatagram)
    81 	if (aSockType!=KSockDatagram)
    76 		return NULL;
    82 		return NULL;
    77 
    83 
    78 	return CWapSmsProtocol::NewL();
    84 	return CWapSmsProtocol::NewL();
    82 //
    88 //
    83 // Create a description of the WapSms protocol
    89 // Create a description of the WapSms protocol
    84 //
    90 //
    85 TUint CWapSmsProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList)
    91 TUint CWapSmsProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList)
    86 	{
    92 	{
    87 	LOGWAPPROT1("CWapSmsProtocolFamily::ProtocolList()");
    93 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_PROTOCOLLIST_1, "CWapSmsProtocolFamily::ProtocolList()");
    88 
    94 
    89 	TRAPD(ret, (aProtocolList=new(ELeave) TServerProtocolDesc[1]) );
    95 	TRAPD(ret, (aProtocolList=new(ELeave) TServerProtocolDesc[1]) );
    90 	if(ret!=KErrNone)
    96 	if(ret!=KErrNone)
    91 		return 0;
    97 		return 0;
    92 
    98 
   111 //
   117 //
   112 // Create a new protocol family
   118 // Create a new protocol family
   113 //
   119 //
   114 EXPORT_C CProtocolFamilyBase * InstallWAPSMS(void)
   120 EXPORT_C CProtocolFamilyBase * InstallWAPSMS(void)
   115 	{
   121 	{
   116 	LOGWAPPROT4("InstallWAPSMS [version %d.%d.%d]",
   122     OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, INSTALLWAPSMS_1, "InstallWAPSMS [version %u.%u.%u]",KWapSmsMajorVersionNumber, KWapSmsMinorVersionNumber, KWapSmsBuildVersionNumber);
   117 			 KWapSmsMajorVersionNumber,
       
   118 			 KWapSmsMinorVersionNumber,
       
   119 			 KWapSmsBuildVersionNumber
       
   120 			 );
       
   121 
   123 
   122 	CWapSmsProtocolFamily* wapProt=NULL;
   124 	CWapSmsProtocolFamily* wapProt=NULL;
   123 	TRAPD(ret, (wapProt=CWapSmsProtocolFamily::NewL()) );
   125 	TRAPD(ret, (wapProt=CWapSmsProtocolFamily::NewL()) );
   124 	if (ret==KErrNone)
   126 	if (ret==KErrNone)
   125 		return wapProt;
   127 		return wapProt;