equal
deleted
inserted
replaced
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". |
17 |
17 |
18 /** |
18 /** |
19 @file |
19 @file |
20 */ |
20 */ |
21 |
21 |
|
22 |
|
23 #include "OstTraceDefinitions.h" |
|
24 #ifdef OST_TRACE_COMPILER_IN_USE |
|
25 #include "SmsuAddrTraces.h" |
|
26 #endif |
|
27 |
22 #include "smsumain.h" |
28 #include "smsumain.h" |
23 #include "smsuaddr.H" |
29 #include "smsuaddr.H" |
24 #include "smsstacklog.h" |
|
25 |
30 |
26 |
31 |
27 /** |
32 /** |
28 * Constructor. |
33 * Constructor. |
29 * @capability None |
34 * @capability None |
40 * @return SMS address family |
45 * @return SMS address family |
41 * @capability None |
46 * @capability None |
42 */ |
47 */ |
43 EXPORT_C TSmsAddrFamily TSmsAddr::SmsAddrFamily() const |
48 EXPORT_C TSmsAddrFamily TSmsAddr::SmsAddrFamily() const |
44 { |
49 { |
45 LOGSMSU1("TSmsAddr::SmsAddrFamily()"); |
50 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_SMSADDRFAMILY_1, "TSmsAddr::SmsAddrFamily()"); |
46 |
51 |
47 return static_cast<TSmsAddrFamily>(Family()); |
52 return static_cast<TSmsAddrFamily>(Family()); |
48 } // TSmsAddr::SmsAddrFamily |
53 } // TSmsAddr::SmsAddrFamily |
49 |
54 |
50 |
55 |
54 * @param aFamily SMS address family |
59 * @param aFamily SMS address family |
55 * @capability None |
60 * @capability None |
56 */ |
61 */ |
57 EXPORT_C void TSmsAddr::SetSmsAddrFamily(TSmsAddrFamily aFamily) |
62 EXPORT_C void TSmsAddr::SetSmsAddrFamily(TSmsAddrFamily aFamily) |
58 { |
63 { |
59 LOGSMSU1("TSmsAddr::SetSmsAddrFamily()"); |
64 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_SETSMSADDRFAMILY_1, "TSmsAddr::SetSmsAddrFamily()"); |
60 |
65 |
61 SetFamily(static_cast<TUint>(aFamily)); |
66 SetFamily(static_cast<TUint>(aFamily)); |
62 } // TSmsAddr::SetSmsAddrFamily |
67 } // TSmsAddr::SetSmsAddrFamily |
63 |
68 |
64 |
69 |
68 * @return Identifier match |
73 * @return Identifier match |
69 * @capability None |
74 * @capability None |
70 */ |
75 */ |
71 EXPORT_C TInt TSmsAddr::IdentifierMatch() const |
76 EXPORT_C TInt TSmsAddr::IdentifierMatch() const |
72 { |
77 { |
73 LOGSMSU1("TSmsAddr::IdentifierMatch()"); |
78 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_IDENTIFIERMATCH_1, "TSmsAddr::IdentifierMatch()"); |
74 |
79 |
75 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchIEI,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
80 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchIEI,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
76 return (TInt) Port(); |
81 return (TInt) Port(); |
77 } // TSmsAddr::IdentifierMatch |
82 } // TSmsAddr::IdentifierMatch |
78 |
83 |
83 * @param aIdentifier Identifier match |
88 * @param aIdentifier Identifier match |
84 * @capability None |
89 * @capability None |
85 */ |
90 */ |
86 EXPORT_C void TSmsAddr::SetIdentifierMatch(TInt aIdentifier) |
91 EXPORT_C void TSmsAddr::SetIdentifierMatch(TInt aIdentifier) |
87 { |
92 { |
88 LOGSMSU1("TSmsAddr::SetIdentifierMatch()"); |
93 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_SETIDENTIFIERMATCH_1, "TSmsAddr::SetIdentifierMatch()"); |
89 |
94 |
90 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchIEI,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
95 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchIEI,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
91 SetPort((TUint) aIdentifier); |
96 SetPort((TUint) aIdentifier); |
92 } // TSmsAddr::SetIdentifierMatch |
97 } // TSmsAddr::SetIdentifierMatch |
93 |
98 |
98 * @return The match text |
103 * @return The match text |
99 * @capability None |
104 * @capability None |
100 */ |
105 */ |
101 EXPORT_C TPtrC8 TSmsAddr::TextMatch() const |
106 EXPORT_C TPtrC8 TSmsAddr::TextMatch() const |
102 { |
107 { |
103 LOGSMSU1("TSmsAddr::TextMatch()"); |
108 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_TEXTMATCH_1, "TSmsAddr::TextMatch()"); |
104 |
109 |
105 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchText,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
110 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchText,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
106 return TPtrC8(UserPtr(),const_cast<TSmsAddr*>(this)->GetUserLen()); |
111 return TPtrC8(UserPtr(),const_cast<TSmsAddr*>(this)->GetUserLen()); |
107 } // TSmsAddr::TextMatch |
112 } // TSmsAddr::TextMatch |
108 |
113 |
113 * @param aText The match text |
118 * @param aText The match text |
114 * @capability None |
119 * @capability None |
115 */ |
120 */ |
116 EXPORT_C void TSmsAddr::SetTextMatch(const TDesC8& aText) |
121 EXPORT_C void TSmsAddr::SetTextMatch(const TDesC8& aText) |
117 { |
122 { |
118 LOGSMSU1("TSmsAddr::SetTextMatch()"); |
123 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_SETTEXTMATCH_1, "TSmsAddr::SetTextMatch()"); |
119 |
124 |
120 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchText,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
125 __ASSERT_DEBUG(SmsAddrFamily()==ESmsAddrMatchText,SmsuPanic(ESmsuPanicWrongSmsAddressFamily)); |
121 TUint8* target = UserPtr(); |
126 TUint8* target = UserPtr(); |
122 TInt length = aText.Length()<=EMaxTextMatchLength ? aText.Length() : EMaxTextMatchLength; |
127 TInt length = aText.Length()<=EMaxTextMatchLength ? aText.Length() : EMaxTextMatchLength; |
123 Mem::Copy(target,aText.Ptr(),length); |
128 Mem::Copy(target,aText.Ptr(),length); |
132 * @return ETrue if the addresses match |
137 * @return ETrue if the addresses match |
133 * @capability None |
138 * @capability None |
134 */ |
139 */ |
135 EXPORT_C TBool TSmsAddr::operator==(const TSmsAddr& aAddr) const |
140 EXPORT_C TBool TSmsAddr::operator==(const TSmsAddr& aAddr) const |
136 { |
141 { |
137 LOGSMSU1("TSmsAddr::operator=()"); |
142 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, TSMSADDR_OPERATOR_1, "TSmsAddr::operator=()"); |
138 |
143 |
139 TSmsAddrFamily family=aAddr.SmsAddrFamily(); |
144 TSmsAddrFamily family=aAddr.SmsAddrFamily(); |
140 TBool same=(SmsAddrFamily()==family); |
145 TBool same=(SmsAddrFamily()==family); |
141 if (same) |
146 if (same) |
142 switch(family) |
147 switch(family) |