24
|
1 |
// Copyright (c) 2006-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 "Gsmumain.h"
|
|
17 |
#include "gsmunonieoperations.h"
|
|
18 |
#include "Gsmumsg.h"
|
|
19 |
#include "gsmumsgadditionalattributes.h"
|
|
20 |
#include "Gsmuelem.h"
|
|
21 |
#include "smsstacklog.h"
|
|
22 |
|
|
23 |
|
|
24 |
/**
|
|
25 |
* @internalComponent
|
|
26 |
*
|
|
27 |
* This is used by the CSmsMessage to create a CSmsNonIEOperation.
|
|
28 |
* Each instance is owned by the CSmsMessage which created it.
|
|
29 |
* Therefore only the CSmsMessage (GSMU component) is allowed to
|
|
30 |
* create and delete CSmsNonIEOperations.
|
|
31 |
*
|
|
32 |
* @param aId The ID for the element for which an operation class needs to be created.
|
|
33 |
* @param aMessage The CSmsMessage that this operations class belongs to.
|
|
34 |
*/
|
|
35 |
CSmsNonIEOperation* CSmsNonIEOperation::NewL(TSmsNonIEIdentifier aId, CSmsMessage& aMessage)
|
|
36 |
{
|
|
37 |
CSmsNonIEOperation* nonIEOperation = NULL;
|
|
38 |
|
|
39 |
if(aId == ESmsTPSRRParameter)
|
|
40 |
{
|
|
41 |
nonIEOperation = new (ELeave) CSmsTPSRROperations(aId, aMessage);
|
|
42 |
}
|
|
43 |
else if (aId == ESmsIncompleteClass0MessageParameter)
|
|
44 |
{
|
|
45 |
nonIEOperation = new (ELeave) CIncompleteClass0MessageInfo(aId, aMessage);
|
|
46 |
}
|
|
47 |
else
|
|
48 |
{
|
|
49 |
User::Leave(KErrArgument);
|
|
50 |
}
|
|
51 |
CleanupStack::PushL(nonIEOperation);
|
|
52 |
nonIEOperation->ConstructL();
|
|
53 |
CleanupStack::Pop();
|
|
54 |
return nonIEOperation;
|
|
55 |
}
|
|
56 |
|
|
57 |
|
|
58 |
/**
|
|
59 |
* @publishedAll
|
|
60 |
*
|
|
61 |
* Identifies the element which is supported by this operations class.
|
|
62 |
*
|
|
63 |
* @return The element ID supported by this operations class.
|
|
64 |
*
|
|
65 |
* @capability None
|
|
66 |
*/
|
|
67 |
EXPORT_C TSmsNonIEIdentifier CSmsNonIEOperation::Id() const
|
|
68 |
{
|
|
69 |
return iId;
|
|
70 |
}
|
|
71 |
|
|
72 |
|
|
73 |
/**
|
|
74 |
* @internalComponent
|
|
75 |
*
|
|
76 |
* Identifies whether the message type supports is supported
|
|
77 |
*
|
|
78 |
* @return True if the message type is supported. False otherwise.
|
|
79 |
*/
|
|
80 |
TBool CSmsNonIEOperation::MessageTypeSupported() const
|
|
81 |
{
|
|
82 |
CSmsPDU::TSmsPDUType type = iMessage.Type();
|
|
83 |
|
|
84 |
return ((type == CSmsPDU::ESmsDeliver) ||
|
|
85 |
(type == CSmsPDU::ESmsSubmit));
|
|
86 |
}
|
|
87 |
|
|
88 |
CSmsNonIEOperation::CSmsNonIEOperation(TSmsNonIEIdentifier aId, CSmsMessage& aMessage) : iId(aId), iMessage(aMessage)
|
|
89 |
{
|
|
90 |
}
|
|
91 |
|
|
92 |
/**
|
|
93 |
* @internalComponent
|
|
94 |
*
|
|
95 |
* Prevent clients from using the assignment operator by including it in the class definition
|
|
96 |
* but making it protected and not exporting it.
|
|
97 |
*
|
|
98 |
* @capability None
|
|
99 |
*/
|
|
100 |
void CSmsNonIEOperation::operator=(const CSmsNonIEOperation&)
|
|
101 |
{
|
|
102 |
// Ignore in code coverage - not intended to be used
|
|
103 |
BULLSEYE_OFF
|
|
104 |
LOGGSMU1("CSmsNonIEOperation::operator=");
|
|
105 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
106 |
BULLSEYE_RESTORE
|
|
107 |
}
|
|
108 |
|
|
109 |
/**
|
|
110 |
* @internalComponent
|
|
111 |
*
|
|
112 |
* Prevent clients from using the equality operator by including it in the class definition
|
|
113 |
* but making it protected and not exporting it.
|
|
114 |
*
|
|
115 |
* @capability None
|
|
116 |
*/
|
|
117 |
TBool CSmsNonIEOperation::operator==(const CSmsNonIEOperation&)
|
|
118 |
{
|
|
119 |
// Ignore in code coverage - not intended to be used
|
|
120 |
BULLSEYE_OFF
|
|
121 |
LOGGSMU1("CSmsNonIEOperation::operator==");
|
|
122 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
123 |
return EFalse;
|
|
124 |
BULLSEYE_RESTORE
|
|
125 |
}
|
|
126 |
|
|
127 |
/**
|
|
128 |
* @internalComponent
|
|
129 |
*
|
|
130 |
* Prevent clients from using the assignment operator by including it in the class definition
|
|
131 |
* but making it protected and not exporting it.
|
|
132 |
*
|
|
133 |
* @capability None
|
|
134 |
*/
|
|
135 |
void CSmsCtrlNonIEOperation::operator=(const CSmsCtrlNonIEOperation&)
|
|
136 |
{
|
|
137 |
// Ignore in code coverage - not intended to be used
|
|
138 |
BULLSEYE_OFF
|
|
139 |
LOGGSMU1("CSmsCtrlNonIEOperation::operator=");
|
|
140 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
141 |
BULLSEYE_RESTORE
|
|
142 |
}
|
|
143 |
|
|
144 |
/**
|
|
145 |
* @internalComponent
|
|
146 |
*
|
|
147 |
* Prevent clients from using the equality operator by including it in the class definition
|
|
148 |
* but making it protected and not exporting it.
|
|
149 |
*
|
|
150 |
* @capability None
|
|
151 |
*/
|
|
152 |
TBool CSmsCtrlNonIEOperation::operator==(const CSmsCtrlNonIEOperation&)
|
|
153 |
{
|
|
154 |
// Ignore in code coverage - not intended to be used
|
|
155 |
BULLSEYE_OFF
|
|
156 |
LOGGSMU1("CSmsCtrlNonIEOperation::operator==");
|
|
157 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
158 |
return EFalse;
|
|
159 |
BULLSEYE_RESTORE
|
|
160 |
}
|
|
161 |
|
|
162 |
CSmsCtrlNonIEOperation::CSmsCtrlNonIEOperation(TSmsNonIEIdentifier aId, CSmsMessage& aMessage) : CSmsNonIEOperation(aId, aMessage)
|
|
163 |
{
|
|
164 |
}
|
|
165 |
|
|
166 |
void CSmsNonIEOperation::ConstructL()
|
|
167 |
{
|
|
168 |
}
|
|
169 |
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Status Reporting.
|
|
173 |
*
|
|
174 |
* @note This should be the last thing that should be configured in CSmsMessage.
|
|
175 |
* If anything is changed after this then the number of PDUs might change which
|
|
176 |
* will affect status reporting.
|
|
177 |
*/
|
|
178 |
CSmsTPSRROperations::CSmsTPSRROperations(TSmsNonIEIdentifier aId, CSmsMessage& aMessage)
|
|
179 |
: CSmsCtrlNonIEOperation(aId, aMessage)
|
|
180 |
{
|
|
181 |
|
|
182 |
}
|
|
183 |
|
|
184 |
|
|
185 |
/**
|
|
186 |
* @internalComponent
|
|
187 |
*
|
|
188 |
* Prevent clients from using the assignment operator by including it in the class definition
|
|
189 |
* but making it protected and not exporting it.
|
|
190 |
*
|
|
191 |
* @capability None
|
|
192 |
*/
|
|
193 |
void CSmsTPSRROperations::operator=(const CSmsTPSRROperations&)
|
|
194 |
{
|
|
195 |
// Ignore in code coverage - not intended to be used
|
|
196 |
BULLSEYE_OFF
|
|
197 |
LOGGSMU1("CSmsTPSRROperations::operator=");
|
|
198 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
199 |
BULLSEYE_RESTORE
|
|
200 |
}
|
|
201 |
|
|
202 |
/**
|
|
203 |
* @internalComponent
|
|
204 |
*
|
|
205 |
* Prevent clients from using the equality operator by including it in the class definition
|
|
206 |
* but making it protected and not exporting it.
|
|
207 |
*
|
|
208 |
* @capability None
|
|
209 |
*/
|
|
210 |
TBool CSmsTPSRROperations::operator==(const CSmsTPSRROperations&)
|
|
211 |
{
|
|
212 |
// Ignore in code coverage - not intended to be used
|
|
213 |
BULLSEYE_OFF
|
|
214 |
LOGGSMU1("CSmsTPSRROperations::operator==");
|
|
215 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
216 |
return EFalse;
|
|
217 |
BULLSEYE_RESTORE
|
|
218 |
}
|
|
219 |
|
|
220 |
/**
|
|
221 |
* @internalComponent
|
|
222 |
*
|
|
223 |
* Identifies whether the message type or version supports this operation
|
|
224 |
*
|
|
225 |
* @leave If the message type or version does not support this operation.
|
|
226 |
*/
|
|
227 |
void CSmsTPSRROperations::ValidateOperationL() const
|
|
228 |
{
|
|
229 |
if (iMessage.Version() < CSmsMessage::ESmsMessageV2)
|
|
230 |
{
|
|
231 |
LOGGSMU2("CSmsTPSRROperations Operation not supported, Msg Version %d", iMessage.Version());
|
|
232 |
User::Leave(KErrNotSupported);
|
|
233 |
}
|
|
234 |
|
|
235 |
if (!MessageTypeSupported())
|
|
236 |
{
|
|
237 |
LOGGSMU2("CSmsTPSRROperations Operation not supported by this PDU type, type = %d", iMessage.Type());
|
|
238 |
User::Leave(KErrNotSupported);
|
|
239 |
}
|
|
240 |
}
|
|
241 |
|
|
242 |
|
|
243 |
/**
|
|
244 |
* @publishedAll
|
|
245 |
*
|
|
246 |
* Sets the TPSRR bit for the last PDU depending on the value of aEnable.
|
|
247 |
* First the scheme is obtained by calling the GetStatusReportScheme.
|
|
248 |
* Then the array iTPSRRStatusReport is traversed to find the last segement.
|
|
249 |
* Once that is done the TPSRR bit for it is updated. If the last segment is
|
|
250 |
* not present in the array then it is appended to it with its TPSRR status.
|
|
251 |
*
|
|
252 |
* @param aEnable
|
|
253 |
* ETrue to set the TPSRR bit to TSmsFirstOctet::ESmsStatusReportRequested
|
|
254 |
* or EFalse to set it to TSmsFirstOctet::ESmsStatusReportNotRequested.
|
|
255 |
*
|
|
256 |
* @leave KErrNotFound If the scheme is not valid.
|
|
257 |
*
|
|
258 |
* @capability None
|
|
259 |
*/
|
|
260 |
EXPORT_C void CSmsTPSRROperations::SetLastSegmentStatusReportL(TBool aEnable)
|
|
261 |
{
|
|
262 |
ValidateOperationL();
|
|
263 |
|
|
264 |
CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
|
|
265 |
CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
|
|
266 |
if (scheme.Id() == ETPSRRScheme)
|
|
267 |
{
|
|
268 |
CSmsMessageAdditionalAttributes::CTPSRRScheme& tpsrrScheme = (CSmsMessageAdditionalAttributes::CTPSRRScheme&)scheme;
|
|
269 |
|
|
270 |
TBool found(EFalse);
|
|
271 |
TInt count = (tpsrrScheme.iTPSRRStatusReport).Count();
|
|
272 |
|
|
273 |
for (TInt ii=0; !found && ii<count; ii++)
|
|
274 |
{
|
|
275 |
if ((tpsrrScheme.iTPSRRStatusReport[ii]).iSegmentSequenceNum == tpsrrScheme.iNumOfPDUs-1)
|
|
276 |
{
|
|
277 |
if(aEnable)
|
|
278 |
{
|
|
279 |
(tpsrrScheme.iTPSRRStatusReport[ii]).iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportRequested;
|
|
280 |
}
|
|
281 |
else
|
|
282 |
{
|
|
283 |
(tpsrrScheme.iTPSRRStatusReport[ii]).iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportNotRequested;
|
|
284 |
}
|
|
285 |
found = ETrue;
|
|
286 |
break;
|
|
287 |
}
|
|
288 |
}
|
|
289 |
|
|
290 |
if (!found)
|
|
291 |
{
|
|
292 |
CSmsMessageAdditionalAttributes::CTPSRRScheme::TSmsTPSRRStatus tpsrrStatus;
|
|
293 |
tpsrrStatus.iSegmentSequenceNum = tpsrrScheme.iNumOfPDUs-1;
|
|
294 |
if(aEnable)
|
|
295 |
{
|
|
296 |
tpsrrStatus.iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportRequested;
|
|
297 |
}
|
|
298 |
else
|
|
299 |
{
|
|
300 |
tpsrrStatus.iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportNotRequested;
|
|
301 |
}
|
|
302 |
(tpsrrScheme.iTPSRRStatusReport).AppendL(tpsrrStatus);
|
|
303 |
}
|
|
304 |
}
|
|
305 |
else
|
|
306 |
{
|
|
307 |
User::Leave(KErrNotFound);
|
|
308 |
}
|
|
309 |
}
|
|
310 |
|
|
311 |
|
|
312 |
/**
|
|
313 |
* @publishedAll
|
|
314 |
*
|
|
315 |
* Sets the TPSRR bit for any PDU depending on the value of aEnable.
|
|
316 |
* First the scheme is obtained by calling the GetStatusReportScheme.
|
|
317 |
* Then the array iTPSRRStatusReport is traversed to find the segment
|
|
318 |
* which has the reference number = aSegmentSequenceNum. Once that is done
|
|
319 |
* the TPSRR bit for it is updated.
|
|
320 |
*
|
|
321 |
* If the refernce number is not found then it is added to the array.
|
|
322 |
*
|
|
323 |
* @param aSegmentSequenceNum
|
|
324 |
* Segment Sequence number of the PDU that is to be updated.
|
|
325 |
* @param aEnable
|
|
326 |
* ETrue to set the TPSRR bit to TSmsFirstOctet::ESmsStatusReportRequested
|
|
327 |
* or EFalse to set it to TSmsFirstOctet::ESmsStatusReportNotRequested.
|
|
328 |
*
|
|
329 |
* @return KErrNone if the operation is successful.
|
|
330 |
* KErrNotFound if the Segment Sequence Number is out of range or
|
|
331 |
* if the scheme is not valid.
|
|
332 |
*
|
|
333 |
* @leave If ValidateOperationL or AppendL leaves.
|
|
334 |
*
|
|
335 |
* @capability None
|
|
336 |
*/
|
|
337 |
EXPORT_C TInt CSmsTPSRROperations::SetSegmentStatusReportL(TUint aSegmentSequenceNum, TBool aEnable)
|
|
338 |
{
|
|
339 |
ValidateOperationL();
|
|
340 |
|
|
341 |
CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
|
|
342 |
CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
|
|
343 |
if (scheme.Id() == ETPSRRScheme)
|
|
344 |
{
|
|
345 |
CSmsMessageAdditionalAttributes::CTPSRRScheme& tpsrrScheme = (CSmsMessageAdditionalAttributes::CTPSRRScheme&)scheme;
|
|
346 |
|
|
347 |
if( aSegmentSequenceNum>=tpsrrScheme.iNumOfPDUs)
|
|
348 |
{
|
|
349 |
return KErrNotFound; // aSegmentSequenceNum out of range.
|
|
350 |
}
|
|
351 |
|
|
352 |
TBool found(EFalse);
|
|
353 |
|
|
354 |
TInt count = (tpsrrScheme.iTPSRRStatusReport).Count();
|
|
355 |
|
|
356 |
for (TInt ii=0; !found && ii<count; ii++)
|
|
357 |
{
|
|
358 |
if ((tpsrrScheme.iTPSRRStatusReport[ii]).iSegmentSequenceNum == aSegmentSequenceNum)
|
|
359 |
{
|
|
360 |
if(aEnable)
|
|
361 |
{
|
|
362 |
(tpsrrScheme.iTPSRRStatusReport[ii]).iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportRequested;
|
|
363 |
}
|
|
364 |
else
|
|
365 |
{
|
|
366 |
(tpsrrScheme.iTPSRRStatusReport[ii]).iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportNotRequested;
|
|
367 |
}
|
|
368 |
found = ETrue;
|
|
369 |
break;
|
|
370 |
}
|
|
371 |
}
|
|
372 |
|
|
373 |
if (!found)
|
|
374 |
{
|
|
375 |
CSmsMessageAdditionalAttributes::CTPSRRScheme::TSmsTPSRRStatus tpsrrStatus;
|
|
376 |
tpsrrStatus.iSegmentSequenceNum = aSegmentSequenceNum;
|
|
377 |
if(aEnable)
|
|
378 |
{
|
|
379 |
tpsrrStatus.iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportRequested;
|
|
380 |
}
|
|
381 |
else
|
|
382 |
{
|
|
383 |
tpsrrStatus.iTPSRRStatus = TSmsFirstOctet::ESmsStatusReportNotRequested;
|
|
384 |
}
|
|
385 |
(tpsrrScheme.iTPSRRStatusReport).AppendL(tpsrrStatus);
|
|
386 |
}
|
|
387 |
|
|
388 |
return KErrNone;
|
|
389 |
}
|
|
390 |
else
|
|
391 |
{
|
|
392 |
return KErrNotFound; // Invalid Scheme
|
|
393 |
}
|
|
394 |
}
|
|
395 |
|
|
396 |
|
|
397 |
/**
|
|
398 |
* @publishedAll
|
|
399 |
*
|
|
400 |
* Gets the selective status for a PDU if the scheme is set to the TPSRR Scheme.
|
|
401 |
*
|
|
402 |
* @param aSegmentSequenceNum The segment sequence number of the PDU whose status report
|
|
403 |
* is required.
|
|
404 |
*
|
|
405 |
* @return The TPSRR bit for the PDU.
|
|
406 |
*
|
|
407 |
* @capability None
|
|
408 |
*/
|
|
409 |
EXPORT_C TInt CSmsTPSRROperations::GetStatusReport(TUint aSegmentSequenceNum) const
|
|
410 |
{
|
|
411 |
CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
|
|
412 |
CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes->GetStatusReportScheme();
|
|
413 |
if (scheme.Id() == ETPSRRScheme)
|
|
414 |
{
|
|
415 |
CSmsMessageAdditionalAttributes::CTPSRRScheme& tpsrrScheme = (CSmsMessageAdditionalAttributes::CTPSRRScheme&)scheme;
|
|
416 |
|
|
417 |
if(aSegmentSequenceNum>=tpsrrScheme.iNumOfPDUs)
|
|
418 |
{
|
|
419 |
return KErrNotFound; // aSegmentSequenceNum out of range.
|
|
420 |
}
|
|
421 |
|
|
422 |
TInt count = (tpsrrScheme.iTPSRRStatusReport).Count();
|
|
423 |
|
|
424 |
for (TInt ii=0; ii<count; ii++)
|
|
425 |
{
|
|
426 |
if ((tpsrrScheme.iTPSRRStatusReport[ii]).iSegmentSequenceNum == aSegmentSequenceNum)
|
|
427 |
{
|
|
428 |
return (tpsrrScheme.iTPSRRStatusReport[ii]).iTPSRRStatus;
|
|
429 |
}
|
|
430 |
}
|
|
431 |
|
|
432 |
return tpsrrScheme.iDefaultStatusReport;
|
|
433 |
}
|
|
434 |
else
|
|
435 |
{
|
|
436 |
return KErrNotFound;
|
|
437 |
}
|
|
438 |
}
|
|
439 |
|
|
440 |
|
|
441 |
/**
|
|
442 |
* @publishedAll
|
|
443 |
*
|
|
444 |
* Sets the default value of the status report to requested or not requested as per aEnable.
|
|
445 |
*
|
|
446 |
* @param aEnable To set the default to Requested or Not Requested.
|
|
447 |
*
|
|
448 |
* @capability None
|
|
449 |
*/
|
|
450 |
EXPORT_C void CSmsTPSRROperations::SetDefaultL(TBool aEnable)
|
|
451 |
{
|
|
452 |
CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
|
|
453 |
CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
|
|
454 |
if (scheme.Id() == ETPSRRScheme)
|
|
455 |
{
|
|
456 |
CSmsMessageAdditionalAttributes::CTPSRRScheme& tpsrrScheme = (CSmsMessageAdditionalAttributes::CTPSRRScheme&)scheme;
|
|
457 |
if(aEnable)
|
|
458 |
{
|
|
459 |
tpsrrScheme.iDefaultStatusReport = TSmsFirstOctet::ESmsStatusReportRequested;
|
|
460 |
}
|
|
461 |
else
|
|
462 |
{
|
|
463 |
tpsrrScheme.iDefaultStatusReport = TSmsFirstOctet::ESmsStatusReportNotRequested;
|
|
464 |
}
|
|
465 |
}
|
|
466 |
else
|
|
467 |
{
|
|
468 |
User::Leave(KErrNotFound);
|
|
469 |
}
|
|
470 |
}
|
|
471 |
|
|
472 |
|
|
473 |
/**
|
|
474 |
* @publishedAll
|
|
475 |
*
|
|
476 |
* This method is called to set the scheme to TPSRR Scheme.
|
|
477 |
* First iStatusReportScheme, which is obtained by calling GetStatusReportScheme,
|
|
478 |
* is deleted and the set to NULL. Then a new scheme is created and a default value is set.
|
|
479 |
* The last segment is set to have TPSRR bit as Requested. This should be the last method
|
|
480 |
* to be called in a message sending process as all the operations in this interface depend
|
|
481 |
* on the number of PDUs being set.
|
|
482 |
*
|
|
483 |
* @leave If ValidateOperationL or NumMessagePDUsL leaves.
|
|
484 |
*
|
|
485 |
* @capability None
|
|
486 |
*/
|
|
487 |
EXPORT_C void CSmsTPSRROperations::SetSchemeL()
|
|
488 |
{
|
|
489 |
ValidateOperationL();
|
|
490 |
|
|
491 |
//check if UserData has SMSC Information Element, if so delete it
|
|
492 |
CSmsUserData& userData = iMessage.SmsPDU().UserData();
|
|
493 |
TInt index=0;
|
|
494 |
TBool hasSMSC=userData.InformationElementIndex(CSmsInformationElement::ESmsIEISMSCControlParameters,index);
|
|
495 |
if(hasSMSC)
|
|
496 |
{
|
|
497 |
userData.RemoveInformationElement(index);
|
|
498 |
}
|
|
499 |
|
|
500 |
CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
|
|
501 |
additionalAttributes.SetStatusReportSchemeL(ETPSRRScheme);
|
|
502 |
|
|
503 |
CSmsMessageAdditionalAttributes::CSmsStatusReportScheme& scheme = additionalAttributes.GetStatusReportScheme();
|
|
504 |
CSmsMessageAdditionalAttributes::CTPSRRScheme& tpsrrScheme = (CSmsMessageAdditionalAttributes::CTPSRRScheme&)scheme;
|
|
505 |
|
|
506 |
tpsrrScheme.iNumOfPDUs = iMessage.NumMessagePDUsL();
|
|
507 |
|
|
508 |
SetDefaultL(EFalse);
|
|
509 |
}
|
|
510 |
|
|
511 |
|
|
512 |
/**
|
|
513 |
* @publishedAll
|
|
514 |
*
|
|
515 |
* Gets the current scheme being used.
|
|
516 |
*
|
|
517 |
* @return ETPSRRScheme is returned when TPSRR Scheme is being used.
|
|
518 |
*
|
|
519 |
* @capability None
|
|
520 |
*/
|
|
521 |
EXPORT_C TSmsStatusReportScheme CSmsTPSRROperations::GetScheme() const
|
|
522 |
{
|
|
523 |
CSmsMessageAdditionalAttributes* additionalAttributes = (CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo();
|
|
524 |
return (additionalAttributes->GetStatusReportScheme()).Id();
|
|
525 |
}
|
|
526 |
|
|
527 |
|
|
528 |
/**
|
|
529 |
* @publishedAll
|
|
530 |
*
|
|
531 |
* If the current scheme is set to TPSRR Scheme then
|
|
532 |
* this method sets the scheme to the Default scheme.
|
|
533 |
*
|
|
534 |
* @capability None
|
|
535 |
*/
|
|
536 |
EXPORT_C void CSmsTPSRROperations::ResetSchemeL()
|
|
537 |
{
|
|
538 |
CSmsMessageAdditionalAttributes& additionalAttributes = *((CSmsMessageAdditionalAttributes*) iMessage.AdditionalInfo());
|
|
539 |
|
|
540 |
additionalAttributes.SetStatusReportSchemeL(EDefaultScheme);
|
|
541 |
}
|
|
542 |
|
|
543 |
/**
|
|
544 |
* constructor
|
|
545 |
*
|
|
546 |
*/
|
|
547 |
CIncompleteClass0MessageInfo::CIncompleteClass0MessageInfo(TSmsNonIEIdentifier aId, CSmsMessage& aMessage)
|
|
548 |
: CSmsNonIEOperation(aId, aMessage)
|
|
549 |
{
|
|
550 |
LOGGSMU1("CIncompleteClass0MessageInfo constructor");
|
|
551 |
}
|
|
552 |
|
|
553 |
/**
|
|
554 |
* @publishedAll
|
|
555 |
*
|
|
556 |
* Gets the incomplete message info.
|
|
557 |
* This information will indicate the partial complete message consists of which PDUs.
|
|
558 |
*
|
|
559 |
* @param aStartPos Starting PDU position of decoded message.
|
|
560 |
* @param aEndPos End PDU position of decoded message.
|
|
561 |
* @param aLastPartialCompleteMsg boolean value indicating this is the last
|
|
562 |
* incomplete message for a particular concatenated message.
|
|
563 |
* @capability None
|
|
564 |
*/
|
|
565 |
EXPORT_C void CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL(TInt& aStartPos, TInt& aEndPos, TBool& aIsLastIncompleteMessage)
|
|
566 |
{
|
|
567 |
LOGGSMU1("CIncompleteClass0MessageInfo::GetIncompleteMessageInfoL");
|
|
568 |
ValidateOperationL();
|
|
569 |
aStartPos = iStartPos;
|
|
570 |
aEndPos = iEndPos;
|
|
571 |
aIsLastIncompleteMessage = iIsLastIncompleteMessage;
|
|
572 |
}
|
|
573 |
|
|
574 |
/**
|
|
575 |
* @publishedAll
|
|
576 |
*
|
|
577 |
* Sets the incomplete message info.
|
|
578 |
* This information will indicate the partial complete message consists of which PDUs.
|
|
579 |
*
|
|
580 |
* @param aStartPos Starting PDU position of decoded message.
|
|
581 |
* @param aEndPos End PDU position of decoded message.
|
|
582 |
* @param aLastPartialCompleteMsg boolean value indicating this is the last
|
|
583 |
* incomplete message for a particular concatenated message.
|
|
584 |
* @capability None
|
|
585 |
*/
|
|
586 |
EXPORT_C void CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL(TInt aStartPos, TInt aEndPos, TBool aIsLastIncompleteMessage)
|
|
587 |
{
|
|
588 |
LOGGSMU1("CIncompleteClass0MessageInfo::SetIncompleteMessageInfoL");
|
|
589 |
ValidateOperationL();
|
|
590 |
iStartPos = aStartPos;
|
|
591 |
iEndPos = aEndPos;
|
|
592 |
iIsLastIncompleteMessage = aIsLastIncompleteMessage;
|
|
593 |
}
|
|
594 |
|
|
595 |
/**
|
|
596 |
* @internalComponent
|
|
597 |
*
|
|
598 |
* Prevent clients from using the assignment operator by including it in the class definition
|
|
599 |
* but making it protected and not exporting it.
|
|
600 |
*
|
|
601 |
* @capability None
|
|
602 |
*/
|
|
603 |
void CIncompleteClass0MessageInfo::operator=(const CIncompleteClass0MessageInfo&)
|
|
604 |
{
|
|
605 |
// Ignore in code coverage - not intended to be used
|
|
606 |
BULLSEYE_OFF
|
|
607 |
LOGGSMU1("CIncompleteClass0MessageInfo::operator=");
|
|
608 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
609 |
BULLSEYE_RESTORE
|
|
610 |
}
|
|
611 |
|
|
612 |
/**
|
|
613 |
* @internalComponent
|
|
614 |
*
|
|
615 |
* Prevent clients from using the equality operator by including it in the class definition
|
|
616 |
* but making it protected and not exporting it.
|
|
617 |
*
|
|
618 |
* @capability None
|
|
619 |
*/
|
|
620 |
TBool CIncompleteClass0MessageInfo::operator==(const CIncompleteClass0MessageInfo&)
|
|
621 |
{
|
|
622 |
// Ignore in code coverage - not intended to be used
|
|
623 |
BULLSEYE_OFF
|
|
624 |
LOGGSMU1("CIncompleteClass0MessageInfo::operator==");
|
|
625 |
Panic(KGsmuPanicMethodBodyNotImplemented1);
|
|
626 |
return EFalse;
|
|
627 |
BULLSEYE_RESTORE
|
|
628 |
}
|
|
629 |
|
|
630 |
/**
|
|
631 |
* @internalComponent
|
|
632 |
*
|
|
633 |
* Identifies which message type is supported
|
|
634 |
*
|
|
635 |
* @return True if the message type is supported. False otherwise.
|
|
636 |
*/
|
|
637 |
TBool CIncompleteClass0MessageInfo::MessageTypeSupported() const
|
|
638 |
{
|
|
639 |
LOGGSMU1("CIncompleteClass0MessageInfo::MessageTypeSupported");
|
|
640 |
CSmsPDU::TSmsPDUType type = iMessage.Type();
|
|
641 |
return (type == CSmsPDU::ESmsDeliver);
|
|
642 |
}
|
|
643 |
|
|
644 |
/**
|
|
645 |
* @internalComponent
|
|
646 |
*
|
|
647 |
* Identifies whether the message type or version supports this operation
|
|
648 |
*
|
|
649 |
* @leave If the message type or version does not support this operation.
|
|
650 |
*/
|
|
651 |
void CIncompleteClass0MessageInfo::ValidateOperationL() const
|
|
652 |
{
|
|
653 |
LOGGSMU1("CIncompleteClass0MessageInfo::ValidateOperationL");
|
|
654 |
|
|
655 |
if (iMessage.Version() != CSmsMessage::ESmsIncompleteClass0MessageV)
|
|
656 |
{
|
|
657 |
LOGGSMU2("CIncompleteClass0MessageInfo Operation not supported, Msg Version %d", iMessage.Version());
|
|
658 |
User::Leave(KErrNotSupported);
|
|
659 |
}
|
|
660 |
|
|
661 |
if (!MessageTypeSupported())
|
|
662 |
{
|
|
663 |
LOGGSMU2("CIncompleteClass0MessageInfo Operation not supported by this PDU type, type = %d", iMessage.Type());
|
|
664 |
User::Leave(KErrNotSupported);
|
|
665 |
}
|
|
666 |
}
|
|
667 |
|
|
668 |
/**
|
|
669 |
* Returns the incomplete class 0 message version number.
|
|
670 |
* @capability
|
|
671 |
*/
|
|
672 |
TInt CIncompleteClass0MessageInfo::Version()
|
|
673 |
{
|
|
674 |
// Ignore in code coverage - as there is only one version of this
|
|
675 |
// class, no need to check the version. Expected to be used if
|
|
676 |
// a new version of the class is added
|
|
677 |
BULLSEYE_OFF
|
|
678 |
LOGGSMU1("CIncompleteClass0MessageInfo::Version()");
|
|
679 |
return iVersion;
|
|
680 |
BULLSEYE_RESTORE
|
|
681 |
}
|
|
682 |
|
|
683 |
/**
|
|
684 |
* @internalComponent
|
|
685 |
* Validates and sets the message version number.
|
|
686 |
*
|
|
687 |
* @param aVersion version number to set.
|
|
688 |
* @capability None
|
|
689 |
*/
|
|
690 |
void CIncompleteClass0MessageInfo::SetVersion(TInt aVersion)
|
|
691 |
{
|
|
692 |
LOGGSMU2("CIncompleteClass0MessageInfo::SetVersion()", aVersion);
|
|
693 |
|
|
694 |
__ASSERT_DEBUG((aVersion<EMaxSmsIncompleteClass0MessageV),Panic(KGsmuPanicVersionNotSupported));
|
|
695 |
|
|
696 |
iVersion=aVersion;
|
|
697 |
} // CSmsMessage::SetVersion
|
|
698 |
|
|
699 |
/**
|
|
700 |
* Internalises all object data.
|
|
701 |
*
|
|
702 |
* @param aStream Stream to read from
|
|
703 |
* @capability None
|
|
704 |
*/
|
|
705 |
void CIncompleteClass0MessageInfo::InternalizeL(RReadStream& aStream)
|
|
706 |
{
|
|
707 |
LOGGSMU1("CIncompleteClass0MessageInfo::InternalizeL()");
|
|
708 |
iVersion = aStream.ReadInt32L();
|
|
709 |
iStartPos = aStream.ReadInt32L();
|
|
710 |
iEndPos = aStream.ReadInt32L();
|
|
711 |
iIsLastIncompleteMessage = aStream.ReadInt32L();
|
|
712 |
}
|
|
713 |
|
|
714 |
/**
|
|
715 |
* Externalises all object data.
|
|
716 |
*
|
|
717 |
* @param aStream Stream to write to
|
|
718 |
* @capability None
|
|
719 |
*/
|
|
720 |
void CIncompleteClass0MessageInfo::ExternalizeL(RWriteStream& aStream) const
|
|
721 |
{
|
|
722 |
LOGGSMU1("CIncompleteClass0MessageInfo::ExternalizeL()");
|
|
723 |
aStream.WriteInt32L(iVersion);
|
|
724 |
aStream.WriteInt32L(iStartPos);
|
|
725 |
aStream.WriteInt32L(iEndPos);
|
|
726 |
aStream.WriteInt32L(iIsLastIncompleteMessage);
|
|
727 |
}
|