1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2009 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". |
41 // |
35 // |
42 // Factory |
36 // Factory |
43 // |
37 // |
44 CWapSmsProtocolFamily * CWapSmsProtocolFamily::NewL() |
38 CWapSmsProtocolFamily * CWapSmsProtocolFamily::NewL() |
45 { |
39 { |
46 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_NEWL_1, "CWapSmsProtocolFamily::NewL()"); |
40 LOGWAPPROT1("CWapSmsProtocolFamily::NewL()"); |
47 |
41 |
48 return new (ELeave)CWapSmsProtocolFamily; |
42 return new (ELeave)CWapSmsProtocolFamily; |
49 } // CWapSmsProtocolFamily::NewL |
43 } // CWapSmsProtocolFamily::NewL |
50 |
44 |
51 |
45 |
52 // |
46 // |
53 // Nothing to be done |
47 // Nothing to be done |
54 // |
48 // |
55 TInt CWapSmsProtocolFamily::Install() |
49 TInt CWapSmsProtocolFamily::Install() |
56 { |
50 { |
57 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_INSTALL_1, "CWapSmsProtocolFamily::Install()"); |
51 LOGWAPPROT1("CWapSmsProtocolFamily::Install()"); |
58 |
52 |
59 return KErrNone; |
53 return KErrNone; |
60 } // CWapSmsProtocolFamily::Install |
54 } // CWapSmsProtocolFamily::Install |
61 |
55 |
62 |
56 |
63 // |
57 // |
64 // Nothing to be done |
58 // Nothing to be done |
65 // |
59 // |
66 TInt CWapSmsProtocolFamily::Remove() |
60 TInt CWapSmsProtocolFamily::Remove() |
67 { |
61 { |
68 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_REMOVE_1, "CWapSmsProtocolFamily::Remove()"); |
62 LOGWAPPROT1("CWapSmsProtocolFamily::Remove()"); |
69 |
63 |
70 return KErrNone; |
64 return KErrNone; |
71 } // CWapSmsProtocolFamily::Remove |
65 } // CWapSmsProtocolFamily::Remove |
72 |
66 |
73 |
67 |
74 // |
68 // |
75 // Return a new CWapSmsProtocol |
69 // Return a new CWapSmsProtocol |
76 // |
70 // |
77 CProtocolBase * CWapSmsProtocolFamily::NewProtocolL(TUint aSockType,TUint /*aProtocol*/) |
71 CProtocolBase * CWapSmsProtocolFamily::NewProtocolL(TUint aSockType,TUint /*aProtocol*/) |
78 { |
72 { |
79 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_NEWPROTOCOLL_1, "CWapSmsProtocolFamily::NewProtocolL()"); |
73 LOGWAPPROT1("CWapSmsProtocolFamily::NewProtocolL()"); |
80 |
74 |
81 if (aSockType!=KSockDatagram) |
75 if (aSockType!=KSockDatagram) |
82 return NULL; |
76 return NULL; |
83 |
77 |
84 return CWapSmsProtocol::NewL(); |
78 return CWapSmsProtocol::NewL(); |
88 // |
82 // |
89 // Create a description of the WapSms protocol |
83 // Create a description of the WapSms protocol |
90 // |
84 // |
91 TUint CWapSmsProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList) |
85 TUint CWapSmsProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList) |
92 { |
86 { |
93 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CWAPSMSPROTOCOLFAMILY_PROTOCOLLIST_1, "CWapSmsProtocolFamily::ProtocolList()"); |
87 LOGWAPPROT1("CWapSmsProtocolFamily::ProtocolList()"); |
94 |
88 |
95 TRAPD(ret, (aProtocolList=new(ELeave) TServerProtocolDesc[1]) ); |
89 TRAPD(ret, (aProtocolList=new(ELeave) TServerProtocolDesc[1]) ); |
96 if(ret!=KErrNone) |
90 if(ret!=KErrNone) |
97 return 0; |
91 return 0; |
98 |
92 |
117 // |
111 // |
118 // Create a new protocol family |
112 // Create a new protocol family |
119 // |
113 // |
120 EXPORT_C CProtocolFamilyBase * InstallWAPSMS(void) |
114 EXPORT_C CProtocolFamilyBase * InstallWAPSMS(void) |
121 { |
115 { |
122 OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, INSTALLWAPSMS_1, "InstallWAPSMS [version %u.%u.%u]",KWapSmsMajorVersionNumber, KWapSmsMinorVersionNumber, KWapSmsBuildVersionNumber); |
116 LOGWAPPROT4("InstallWAPSMS [version %d.%d.%d]", |
|
117 KWapSmsMajorVersionNumber, |
|
118 KWapSmsMinorVersionNumber, |
|
119 KWapSmsBuildVersionNumber |
|
120 ); |
123 |
121 |
124 CWapSmsProtocolFamily* wapProt=NULL; |
122 CWapSmsProtocolFamily* wapProt=NULL; |
125 TRAPD(ret, (wapProt=CWapSmsProtocolFamily::NewL()) ); |
123 TRAPD(ret, (wapProt=CWapSmsProtocolFamily::NewL()) ); |
126 if (ret==KErrNone) |
124 if (ret==KErrNone) |
127 return wapProt; |
125 return wapProt; |