24
|
1 |
// Copyright (c) 1999-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 |
// Contains a class representing the generic interface to a GSM SMS PDU (CSmsPDU) as well as six concrete implementations representing the six types of CSmsPDU, namely CSmsDeliver, CSmsSubmit, CSmsDeliverReport, CSmsSubmitReport, CSmsStatusReport and CSmsCommand
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#ifndef __GSMUPDU_H__
|
|
23 |
#define __GSMUPDU_H__
|
|
24 |
|
|
25 |
#include <gsmuelem.h>
|
|
26 |
// forwarded class declarations
|
|
27 |
|
|
28 |
class TGsmSms;
|
|
29 |
class CSmsAddress;
|
|
30 |
struct TEncodeParams;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* A generic interface to a GSM SMS PDU.
|
|
34 |
*
|
|
35 |
* The class can be used on its own to encode GSM SMS PDUs. It is also the base
|
|
36 |
* class for the six real implementations of GSM SMS PDUs. The derived classes
|
|
37 |
* are built up from the elements defined in gsmuelem.h according to the ETSI
|
|
38 |
* GSM 03.40. All the SMS elements have generic encode and decode functions so
|
|
39 |
* that each PDU type knows how to encode and decode itself into a TGsmSms.
|
|
40 |
*
|
|
41 |
* CSmsPDU and derived classes provide a human readable interface to a GSM SMS
|
|
42 |
* PDU, for example setting the destination address on a SUBMIT (CSmsSubmit).
|
|
43 |
* All the factory functions for CSmsPDUs are provided in the base class.
|
|
44 |
*
|
|
45 |
* @publishedAll
|
|
46 |
* @released
|
|
47 |
*/
|
|
48 |
class CSmsPDU : public CBase
|
|
49 |
{
|
|
50 |
public:
|
|
51 |
//note the enum values must be kept to ensure future binary compatibility with the TSAREntry store.
|
|
52 |
/** Flags for the 6 basic PDU types in GSM SMS messaging. */
|
|
53 |
enum TSmsPDUType
|
|
54 |
{
|
|
55 |
ESmsDeliver = 0, //< SMS-DELIVER, sent from SC to MS
|
|
56 |
ESmsDeliverReport = 1, //< SMS-DELIVER-REPORT, sent from MS to SC
|
|
57 |
ESmsSubmit = 2, //< SMS-SUBMIT, sent from MS to SC
|
|
58 |
ESmsSubmitReport = 3, //< SMS-SUBMIT-REPORT, sent from SC to MS
|
|
59 |
ESmsStatusReport = 4, //< SMS-STATUS-REQUEST, sent from SC to MS
|
|
60 |
ESmsCommand = 5 //< SMS-COMMAND, sent from MS to SC
|
|
61 |
};
|
|
62 |
public:
|
|
63 |
IMPORT_C static CSmsPDU* NewL(RReadStream &aStream,CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
64 |
IMPORT_C static CSmsPDU* NewL(const TGsmSms& aGsmSms,CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TBool aIsRPError=EFalse,TBool aIsMobileTerminated=ETrue);
|
|
65 |
IMPORT_C static CSmsPDU* NewL(TSmsPDUType aType,CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TBool aIsRPError=EFalse);
|
|
66 |
|
|
67 |
inline TSmsPDUType Type() const;
|
|
68 |
|
|
69 |
IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
|
|
70 |
|
|
71 |
IMPORT_C void EncodeMessagePDUL(TGsmSms& aGsmSms) const;
|
|
72 |
void EncodeMessagePDUL(TGsmSms& aGsmSms, const TEncodeParams* aEncodeParams) const;
|
|
73 |
|
|
74 |
IMPORT_C TPtrC ServiceCenterAddress() const;
|
|
75 |
IMPORT_C void SetServiceCenterAddressL(const TDesC& aAddress);
|
|
76 |
IMPORT_C void ParsedServiceCenterAddress(TGsmSmsTelNumber& aParsedAddress) const;
|
|
77 |
IMPORT_C void SetParsedServiceCenterAddressL(const TGsmSmsTelNumber& aParsedAddress);
|
|
78 |
|
|
79 |
IMPORT_C TPtrC ToFromAddress() const;
|
|
80 |
IMPORT_C void SetToFromAddressL(const TDesC& aAddress);
|
|
81 |
IMPORT_C void ParsedToFromAddress(TGsmSmsTelNumber& aParsedAddress) const;
|
|
82 |
IMPORT_C void SetParsedToFromAddressL(const TGsmSmsTelNumber& aParsedAddress);
|
|
83 |
|
|
84 |
// Functions on data coding scheme
|
|
85 |
// The functions available are dependant on bits 7 to 4 in the data coding scheme.
|
|
86 |
// Functions panic when they are not available.
|
|
87 |
// This requires the caller to have some knowledge of ETSI GSM 03.38 in order to keep the data coding scheme in a consistent state.
|
|
88 |
|
|
89 |
IMPORT_C TSmsDataCodingScheme::TSmsDCSBits7To4 Bits7To4() const;
|
|
90 |
IMPORT_C void SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4 aBits7To4);
|
|
91 |
|
|
92 |
IMPORT_C TSmsDataCodingScheme::TSmsAlphabet Alphabet() const;
|
|
93 |
IMPORT_C void SetAlphabet(TSmsDataCodingScheme::TSmsAlphabet aAlphabet);
|
|
94 |
IMPORT_C TBool Class(TSmsDataCodingScheme::TSmsClass& aClass) const;
|
|
95 |
IMPORT_C void SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass);
|
|
96 |
IMPORT_C TBool TextCompressed() const;
|
|
97 |
IMPORT_C void SetTextCompressed(TBool aCompressed);
|
|
98 |
|
|
99 |
IMPORT_C TSmsDataCodingScheme::TSmsIndicationState IndicationState() const;
|
|
100 |
IMPORT_C void SetIndicationState(TSmsDataCodingScheme::TSmsIndicationState aState);
|
|
101 |
IMPORT_C TSmsDataCodingScheme::TSmsIndicationType IndicationType() const;
|
|
102 |
IMPORT_C void SetIndicationType(TSmsDataCodingScheme::TSmsIndicationType aType);
|
|
103 |
|
|
104 |
// Functions on concatenation user data information element
|
|
105 |
IMPORT_C TBool TextConcatenated(TBool* aIs16Bit=NULL) const;
|
|
106 |
IMPORT_C void SetTextConcatenatedL(TBool aConcatenated,TBool aIs16Bit=EFalse);
|
|
107 |
IMPORT_C TInt ConcatenatedMessageReference() const;
|
|
108 |
IMPORT_C void SetConcatenatedMessageReference(TInt aReference);
|
|
109 |
IMPORT_C TInt NumConcatenatedMessagePDUs() const;
|
|
110 |
IMPORT_C void SetNumConcatenatedMessagePDUs(TInt aNum);
|
|
111 |
IMPORT_C TInt ConcatenatedMessagePDUIndex() const;
|
|
112 |
IMPORT_C void SetConcatenatedMessagePDUIndex(TInt aIndex);
|
|
113 |
|
|
114 |
// Functions for application port addressing
|
|
115 |
IMPORT_C TBool ApplicationPortAddressing(TInt& aDestination,TInt& aOriginator,TBool* aIs16Bit=NULL) const;
|
|
116 |
IMPORT_C void SetApplicationPortAddressingL(TBool aAddressing,TInt aDestination,TInt aOriginator,TBool aIs16Bit=EFalse);
|
|
117 |
|
|
118 |
// Functions on protocol identifier
|
|
119 |
IMPORT_C TSmsProtocolIdentifier::TSmsPIDType PIDType() const;
|
|
120 |
IMPORT_C void SetPIDType(TSmsProtocolIdentifier::TSmsPIDType aSmsPIDType);
|
|
121 |
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;
|
|
122 |
IMPORT_C void SetTelematicDeviceIndicator(TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator aIndicator);
|
|
123 |
|
|
124 |
|
|
125 |
//-- concern 'ShortMessageType'
|
|
126 |
IMPORT_C TSmsProtocolIdentifier::TSmsShortMessageType ShortMessageType() const;
|
|
127 |
IMPORT_C void SetShortMessageType(TSmsProtocolIdentifier::TSmsShortMessageType aShortMessageType);
|
|
128 |
|
|
129 |
|
|
130 |
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceType TelematicDeviceType() const;
|
|
131 |
IMPORT_C void SetTelematicDeviceType(TSmsProtocolIdentifier::TSmsTelematicDeviceType aDeviceType);
|
|
132 |
|
|
133 |
// Functions on parameter indicator
|
|
134 |
IMPORT_C TBool UserDataPresent() const;
|
|
135 |
IMPORT_C void SetUserDataPresent(TBool aPresent);
|
|
136 |
IMPORT_C TBool DataCodingSchemePresent() const;
|
|
137 |
IMPORT_C void SetDataCodingSchemePresent(TBool aPresent);
|
|
138 |
IMPORT_C TBool ProtocolIdentifierPresent() const;
|
|
139 |
IMPORT_C void SetProtocolIdentifierPresent(TBool aPresent);
|
|
140 |
|
|
141 |
IMPORT_C CSmsUserData& UserData();
|
|
142 |
IMPORT_C const CSmsUserData& UserData() const;
|
|
143 |
virtual void DecodeL(TGsmuLex8& aPdu)=0;
|
|
144 |
void UpdateConcatenationDataL(TInt aRef, TInt aPduIndex, TInt aMaxPdu);
|
|
145 |
void UpdateEmailHeaderDataL(TInt& aEmailOverallHeaderLength);
|
|
146 |
|
|
147 |
// SMSC Control Parameters
|
|
148 |
TBool UpdateSMSCCtrlParameterL(const TUint8 aOctet);
|
|
149 |
|
|
150 |
// TPSRR Scheme
|
|
151 |
TBool UpdateTPSRRL(TSmsFirstOctet aSmsReportRequest);
|
|
152 |
|
|
153 |
// National Language Encoding
|
|
154 |
IMPORT_C TSmsEncoding NationalLanguageEncoding() const;
|
|
155 |
IMPORT_C void SetNationalLanguageEncodingL(TSmsEncoding aEncoding);
|
|
156 |
|
|
157 |
IMPORT_C CSmsPDU* DuplicateL() const;
|
|
158 |
|
|
159 |
protected:
|
|
160 |
CSmsPDU(TSmsPDUType aSmsPDUType);
|
|
161 |
|
|
162 |
virtual const TSmsDataCodingScheme* DataCodingScheme() const; // Functions made const to avoid too many definitions
|
|
163 |
virtual const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
164 |
virtual const TSmsParameterIndicator* ParameterIndicator() const;
|
|
165 |
virtual const CSmsUserData* UserDataPtr() const;
|
|
166 |
virtual const CSmsAddress* ToFromAddressPtr() const;
|
|
167 |
|
|
168 |
virtual void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs)=0;
|
|
169 |
virtual TUint8* EncodeL(TUint8* aPtr) const=0;
|
|
170 |
virtual TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const=0;
|
|
171 |
|
|
172 |
virtual void InternalizeMessagePDUL(RReadStream& aStream)=0;
|
|
173 |
virtual void ExternalizeMessagePDUL(RWriteStream& aStream) const=0;
|
|
174 |
|
|
175 |
private:
|
|
176 |
TBool DoTextConcatenated(TInt& aIndex,TBool* aIs16Bit) const;
|
|
177 |
void DoSetTextConcatenatedL(TBool aIs16Bit);
|
|
178 |
TBool DoApplicationPortAddressing(TInt& aIndex,TInt& aDestination,TInt& aOriginator,TBool* aIs16Bit) const;
|
|
179 |
void DoSetApplicationPortAddressingL(TInt aDestination,TInt aOriginator,TBool aIs16Bit);
|
|
180 |
|
|
181 |
private:
|
|
182 |
const TSmsPDUType iSmsPDUType;
|
|
183 |
|
|
184 |
protected:
|
|
185 |
CSmsAddress* iServiceCenterAddress;
|
|
186 |
};
|
|
187 |
|
|
188 |
|
|
189 |
/**
|
|
190 |
* SMS-DELIVER PDU - SC to MS
|
|
191 |
* @publishedAll
|
|
192 |
* @released
|
|
193 |
*/
|
|
194 |
class CSmsDeliver : public CSmsPDU
|
|
195 |
{
|
|
196 |
public:
|
|
197 |
CSmsDeliver();
|
|
198 |
~CSmsDeliver();
|
|
199 |
|
|
200 |
IMPORT_C TBool MoreMessagesToSend() const;
|
|
201 |
IMPORT_C void SetMoreMessagesToSend(TBool aMore);
|
|
202 |
|
|
203 |
IMPORT_C TBool ReplyPath() const;
|
|
204 |
IMPORT_C void SetReplyPath(TBool aReplyPath);
|
|
205 |
|
|
206 |
IMPORT_C TBool StatusReportIndication() const;
|
|
207 |
IMPORT_C void SetStatusReportIndication(TBool aIndication);
|
|
208 |
|
|
209 |
IMPORT_C void ServiceCenterTimeStamp(TTime& aTime,TInt& aNumQuarterHours);
|
|
210 |
IMPORT_C void SetServiceCenterTimeStamp(const TTime& aTime,TInt aNumQuarterHours=0);
|
|
211 |
IMPORT_C const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
212 |
|
|
213 |
IMPORT_C CSmsDeliver* DuplicateL() const;
|
|
214 |
|
|
215 |
protected:
|
|
216 |
const TSmsDataCodingScheme* DataCodingScheme() const;
|
|
217 |
const CSmsUserData* UserDataPtr() const;
|
|
218 |
const CSmsAddress* ToFromAddressPtr() const;
|
|
219 |
|
|
220 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
221 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
222 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
223 |
void DecodeL(TGsmuLex8& aPdu);
|
|
224 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
225 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
226 |
|
|
227 |
private:
|
|
228 |
TSmsFirstOctet iFirstOctet;
|
|
229 |
CSmsAddress* iOriginalAddress;
|
|
230 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
231 |
TSmsDataCodingScheme iDataCodingScheme;
|
|
232 |
TSmsServiceCenterTimeStamp iServiceCenterTimeStamp;
|
|
233 |
CSmsUserData* iUserData;
|
|
234 |
};
|
|
235 |
|
|
236 |
|
|
237 |
/**
|
|
238 |
* SMS-SUBMIT PDU - MS to SC
|
|
239 |
* @publishedAll
|
|
240 |
* @released
|
|
241 |
*/
|
|
242 |
class CSmsSubmit : public CSmsPDU
|
|
243 |
{
|
|
244 |
public:
|
|
245 |
CSmsSubmit();
|
|
246 |
~CSmsSubmit();
|
|
247 |
|
|
248 |
IMPORT_C TBool RejectDuplicates() const;
|
|
249 |
IMPORT_C void SetRejectDuplicates(TBool aRejectDuplicates);
|
|
250 |
|
|
251 |
IMPORT_C TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
|
|
252 |
IMPORT_C void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
|
|
253 |
|
|
254 |
IMPORT_C TBool ReplyPath() const;
|
|
255 |
IMPORT_C void SetReplyPath(TBool aReplyPath);
|
|
256 |
|
|
257 |
IMPORT_C TBool StatusReportRequest() const;
|
|
258 |
IMPORT_C void SetStatusReportRequest(TBool aRequest);
|
|
259 |
|
|
260 |
IMPORT_C TInt MessageReference() const;
|
|
261 |
IMPORT_C void SetMessageReference(TInt aMessageReference);
|
|
262 |
|
|
263 |
IMPORT_C const TTimeIntervalMinutes& ValidityPeriod() const;
|
|
264 |
IMPORT_C void SetValidityPeriod(const TTimeIntervalMinutes& aTimeIntervalMinutes);
|
|
265 |
|
|
266 |
IMPORT_C CSmsSubmit* DuplicateL() const;
|
|
267 |
|
|
268 |
protected:
|
|
269 |
const TSmsDataCodingScheme* DataCodingScheme() const;
|
|
270 |
const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
271 |
const CSmsUserData* UserDataPtr() const;
|
|
272 |
const CSmsAddress* ToFromAddressPtr() const;
|
|
273 |
|
|
274 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
275 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
276 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
277 |
void DecodeL(TGsmuLex8& aPdu);
|
|
278 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
279 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
280 |
|
|
281 |
private:
|
|
282 |
TSmsFirstOctet iFirstOctet;
|
|
283 |
TSmsOctet iMessageReference;
|
|
284 |
CSmsAddress* iDestinationAddress;
|
|
285 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
286 |
TSmsDataCodingScheme iDataCodingScheme;
|
|
287 |
TSmsValidityPeriod iValidityPeriod;
|
|
288 |
CSmsUserData* iUserData;
|
|
289 |
};
|
|
290 |
|
|
291 |
|
|
292 |
/**
|
|
293 |
* SMS-DELIVER-REPORT PDU - MS to SC
|
|
294 |
* @publishedAll
|
|
295 |
* @released
|
|
296 |
*/
|
|
297 |
class CSmsDeliverReport : public CSmsPDU
|
|
298 |
{
|
|
299 |
public:
|
|
300 |
CSmsDeliverReport(TBool aIsRPError=EFalse);
|
|
301 |
~CSmsDeliverReport();
|
|
302 |
|
|
303 |
inline TBool IsRPError() const;
|
|
304 |
inline void SetIsRPError(TBool aIsRPError);
|
|
305 |
|
|
306 |
IMPORT_C TInt FailureCause() const;
|
|
307 |
IMPORT_C void SetFailureCause(TSmsFailureCause::TSmsFailureCauseError aFailureCause);
|
|
308 |
|
|
309 |
IMPORT_C CSmsDeliverReport* DuplicateL() const;
|
|
310 |
|
|
311 |
protected:
|
|
312 |
const TSmsDataCodingScheme* DataCodingScheme() const;
|
|
313 |
const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
314 |
const TSmsParameterIndicator* ParameterIndicator() const;
|
|
315 |
const CSmsUserData* UserDataPtr() const;
|
|
316 |
|
|
317 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
318 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
319 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
320 |
void DecodeL(TGsmuLex8& aPdu);
|
|
321 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
322 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
323 |
|
|
324 |
private:
|
|
325 |
TUint8 iIsRPError;
|
|
326 |
|
|
327 |
TSmsFirstOctet iFirstOctet;
|
|
328 |
TSmsFailureCause iFailureCause;
|
|
329 |
TSmsParameterIndicator iParameterIndicator;
|
|
330 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
331 |
TSmsDataCodingScheme iDataCodingScheme;
|
|
332 |
CSmsUserData* iUserData;
|
|
333 |
};
|
|
334 |
|
|
335 |
|
|
336 |
/**
|
|
337 |
* SMS-SUBMIT-REPORT PDU - SC to MS
|
|
338 |
* @publishedAll
|
|
339 |
* @released
|
|
340 |
*/
|
|
341 |
class CSmsSubmitReport : public CSmsPDU
|
|
342 |
{
|
|
343 |
public:
|
|
344 |
CSmsSubmitReport(TBool aIsRPError=EFalse);
|
|
345 |
~CSmsSubmitReport();
|
|
346 |
|
|
347 |
inline TBool IsRPError() const;
|
|
348 |
inline void SetIsRPError(TBool aIsRPError);
|
|
349 |
|
|
350 |
IMPORT_C TInt FailureCause() const;
|
|
351 |
IMPORT_C void SetFailureCause(TSmsFailureCause::TSmsFailureCauseError aFailureCause);
|
|
352 |
|
|
353 |
IMPORT_C CSmsSubmitReport* DuplicateL() const;
|
|
354 |
|
|
355 |
protected:
|
|
356 |
const TSmsDataCodingScheme* DataCodingScheme() const;
|
|
357 |
const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
358 |
const TSmsParameterIndicator* ParameterIndicator() const;
|
|
359 |
const CSmsUserData* UserDataPtr() const;
|
|
360 |
|
|
361 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
362 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
363 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
364 |
void DecodeL(TGsmuLex8& aPdu);
|
|
365 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
366 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
367 |
|
|
368 |
private:
|
|
369 |
TUint8 iIsRPError;
|
|
370 |
|
|
371 |
TSmsFirstOctet iFirstOctet;
|
|
372 |
TSmsFailureCause iFailureCause;
|
|
373 |
TSmsParameterIndicator iParameterIndicator;
|
|
374 |
TSmsServiceCenterTimeStamp iServiceCenterTimeStamp;
|
|
375 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
376 |
TSmsDataCodingScheme iDataCodingScheme;
|
|
377 |
CSmsUserData* iUserData;
|
|
378 |
};
|
|
379 |
|
|
380 |
|
|
381 |
/**
|
|
382 |
* SMS-STATUS-REPORT PDU - SC to MS
|
|
383 |
* @publishedAll
|
|
384 |
* @released
|
|
385 |
*/
|
|
386 |
class CSmsStatusReport : public CSmsPDU
|
|
387 |
{
|
|
388 |
public:
|
|
389 |
CSmsStatusReport();
|
|
390 |
~CSmsStatusReport();
|
|
391 |
|
|
392 |
inline TBool ParameterIndicatorPresent() const;
|
|
393 |
inline void SetParameterIndicatorPresent(TBool aPresent);
|
|
394 |
|
|
395 |
IMPORT_C TBool MoreMessagesToSend() const;
|
|
396 |
IMPORT_C void SetMoreMessagesToSend(TBool aMore);
|
|
397 |
|
|
398 |
IMPORT_C TSmsFirstOctet::TSmsStatusReportQualifier StatusReportQualifier() const;
|
|
399 |
IMPORT_C void SetStatusReportQualifier(TSmsFirstOctet::TSmsStatusReportQualifier aQualifier);
|
|
400 |
|
|
401 |
IMPORT_C TInt MessageReference() const;
|
|
402 |
IMPORT_C void SetMessageReference(TInt aMessageReference);
|
|
403 |
|
|
404 |
IMPORT_C void ServiceCenterTimeStamp(TTime& aTime,TInt& aNumQuarterHours);
|
|
405 |
IMPORT_C void SetServiceCenterTimeStamp(const TTime& aTime,TInt& aNumQuarterHours);
|
|
406 |
|
|
407 |
IMPORT_C void DischargeTime(TTime& aTime,TInt& aNumQuarterHours);
|
|
408 |
IMPORT_C void SetDischargeTime(const TTime& aTime,TInt& aNumQuarterHours);
|
|
409 |
|
|
410 |
IMPORT_C TSmsStatus::TSmsStatusValue Status() const;
|
|
411 |
IMPORT_C void SetStatus(TSmsStatus::TSmsStatusValue aValue);
|
|
412 |
|
|
413 |
IMPORT_C CSmsStatusReport* DuplicateL() const;
|
|
414 |
|
|
415 |
protected:
|
|
416 |
const TSmsDataCodingScheme* DataCodingScheme() const;
|
|
417 |
const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
418 |
const TSmsParameterIndicator* ParameterIndicator() const;
|
|
419 |
const CSmsUserData* UserDataPtr() const;
|
|
420 |
const CSmsAddress* ToFromAddressPtr() const;
|
|
421 |
|
|
422 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
423 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
424 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
425 |
void DecodeL(TGsmuLex8& aPdu);
|
|
426 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
427 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
428 |
|
|
429 |
private:
|
|
430 |
TUint8 iParameterIndicatorPresent;
|
|
431 |
|
|
432 |
TSmsFirstOctet iFirstOctet;
|
|
433 |
TSmsOctet iMessageReference;
|
|
434 |
CSmsAddress* iRecipientAddress;
|
|
435 |
TSmsServiceCenterTimeStamp iServiceCenterTimeStamp;
|
|
436 |
TSmsServiceCenterTimeStamp iDischargeTime;
|
|
437 |
TSmsStatus iStatus;
|
|
438 |
TSmsParameterIndicator iParameterIndicator;
|
|
439 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
440 |
TSmsDataCodingScheme iDataCodingScheme;
|
|
441 |
CSmsUserData* iUserData;
|
|
442 |
};
|
|
443 |
|
|
444 |
|
|
445 |
/**
|
|
446 |
* SMS-COMMAND PDU - MS to SC
|
|
447 |
* @publishedAll
|
|
448 |
* @released
|
|
449 |
*/
|
|
450 |
class CSmsCommand : public CSmsPDU
|
|
451 |
{
|
|
452 |
public:
|
|
453 |
CSmsCommand();
|
|
454 |
~CSmsCommand();
|
|
455 |
|
|
456 |
IMPORT_C TBool StatusReportRequest() const;
|
|
457 |
IMPORT_C void SetStatusReportRequest(TBool aRequest);
|
|
458 |
|
|
459 |
IMPORT_C TInt MessageReference() const;
|
|
460 |
IMPORT_C void SetMessageReference(TInt aMessageReference);
|
|
461 |
|
|
462 |
IMPORT_C TInt CommandType() const;
|
|
463 |
IMPORT_C void SetCommandType(TSmsCommandType::TSmsCommandTypeValue aCommandType);
|
|
464 |
|
|
465 |
IMPORT_C TInt MessageNumber() const;
|
|
466 |
IMPORT_C void SetMessageNumber(TInt aMessageNumber);
|
|
467 |
|
|
468 |
IMPORT_C TInt NumInformationElements() const;
|
|
469 |
IMPORT_C CSmsInformationElement& InformationElement(TInt aIndex) const;
|
|
470 |
CSmsInformationElement*& InformationElementPtr(TInt aIndex) const;
|
|
471 |
IMPORT_C TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
|
|
472 |
TInt& aIndex) const;
|
|
473 |
IMPORT_C void AddInformationElementL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, TDesC8& aData);
|
|
474 |
IMPORT_C void RemoveInformationElement(TInt aIndex);
|
|
475 |
|
|
476 |
IMPORT_C TInt MaxCommandDataLength() const;
|
|
477 |
IMPORT_C TPtrC8 CommandData() const;
|
|
478 |
IMPORT_C void SetCommandDataL(const TDesC8& aData);
|
|
479 |
|
|
480 |
IMPORT_C CSmsCommand* DuplicateL() const;
|
|
481 |
|
|
482 |
protected:
|
|
483 |
const TSmsProtocolIdentifier* ProtocolIdentifier() const;
|
|
484 |
const CSmsAddress* ToFromAddressPtr() const;
|
|
485 |
|
|
486 |
void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
|
|
487 |
TUint8* EncodeL(TUint8* aPtr) const;
|
|
488 |
TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
|
|
489 |
void DecodeL(TGsmuLex8& aPdu);
|
|
490 |
void InternalizeMessagePDUL(RReadStream& aStream);
|
|
491 |
void ExternalizeMessagePDUL(RWriteStream& aStream) const;
|
|
492 |
void DoSetStatusReportRequest(TBool aRequest);
|
|
493 |
|
|
494 |
private:
|
|
495 |
TSmsFirstOctet iFirstOctet;
|
|
496 |
TSmsOctet iMessageReference;
|
|
497 |
TSmsProtocolIdentifier iProtocolIdentifier;
|
|
498 |
TSmsCommandType iCommandType;
|
|
499 |
TSmsOctet iMessageNumber;
|
|
500 |
CSmsAddress* iDestinationAddress;
|
|
501 |
CSmsCommandData* iCommandData;
|
|
502 |
};
|
|
503 |
|
|
504 |
#include "gsmupdu.inl"
|
|
505 |
|
|
506 |
#endif // !defined __GSMUPDU_H__
|