|
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 IMPORT_C TSmsDataCodingScheme::TSmsDCSBits7To4 Bits7To4() const; |
|
86 IMPORT_C void SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4 aBits7To4); |
|
87 |
|
88 IMPORT_C TSmsDataCodingScheme::TSmsAlphabet Alphabet() const; |
|
89 IMPORT_C void SetAlphabet(TSmsDataCodingScheme::TSmsAlphabet aAlphabet); |
|
90 IMPORT_C TBool Class(TSmsDataCodingScheme::TSmsClass& aClass) const; |
|
91 IMPORT_C void SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass); |
|
92 IMPORT_C TBool TextCompressed() const; |
|
93 IMPORT_C void SetTextCompressed(TBool aCompressed); |
|
94 |
|
95 IMPORT_C TSmsDataCodingScheme::TSmsIndicationState IndicationState() const; |
|
96 IMPORT_C void SetIndicationState(TSmsDataCodingScheme::TSmsIndicationState aState); |
|
97 IMPORT_C TSmsDataCodingScheme::TSmsIndicationType IndicationType() const; |
|
98 IMPORT_C void SetIndicationType(TSmsDataCodingScheme::TSmsIndicationType aType); |
|
99 |
|
100 // Functions on concatenation user data information element |
|
101 IMPORT_C TBool TextConcatenated(TBool* aIs16Bit=NULL) const; |
|
102 IMPORT_C void SetTextConcatenatedL(TBool aConcatenated,TBool aIs16Bit=EFalse); |
|
103 IMPORT_C TInt ConcatenatedMessageReference() const; |
|
104 IMPORT_C void SetConcatenatedMessageReference(TInt aReference); |
|
105 IMPORT_C TInt NumConcatenatedMessagePDUs() const; |
|
106 IMPORT_C void SetNumConcatenatedMessagePDUs(TInt aNum); |
|
107 IMPORT_C TInt ConcatenatedMessagePDUIndex() const; |
|
108 IMPORT_C void SetConcatenatedMessagePDUIndex(TInt aIndex); |
|
109 |
|
110 // Functions for application port addressing |
|
111 IMPORT_C TBool ApplicationPortAddressing(TInt& aDestination,TInt& aOriginator,TBool* aIs16Bit=NULL) const; |
|
112 IMPORT_C void SetApplicationPortAddressingL(TBool aAddressing,TInt aDestination,TInt aOriginator,TBool aIs16Bit=EFalse); |
|
113 |
|
114 // Functions on protocol identifier |
|
115 IMPORT_C TSmsProtocolIdentifier::TSmsPIDType PIDType() const; |
|
116 IMPORT_C void SetPIDType(TSmsProtocolIdentifier::TSmsPIDType aSmsPIDType); |
|
117 IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const; |
|
118 IMPORT_C void SetTelematicDeviceIndicator(TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator aIndicator); |
|
119 |
|
120 |
|
121 //-- concern 'ShortMessageType' |
|
122 IMPORT_C TSmsProtocolIdentifier::TSmsShortMessageType ShortMessageType() const; |
|
123 IMPORT_C void SetShortMessageType(TSmsProtocolIdentifier::TSmsShortMessageType aShortMessageType); |
|
124 |
|
125 |
|
126 IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceType TelematicDeviceType() const; |
|
127 IMPORT_C void SetTelematicDeviceType(TSmsProtocolIdentifier::TSmsTelematicDeviceType aDeviceType); |
|
128 |
|
129 // Functions on parameter indicator |
|
130 IMPORT_C TBool UserDataPresent() const; |
|
131 IMPORT_C void SetUserDataPresent(TBool aPresent); |
|
132 IMPORT_C TBool DataCodingSchemePresent() const; |
|
133 IMPORT_C void SetDataCodingSchemePresent(TBool aPresent); |
|
134 IMPORT_C TBool ProtocolIdentifierPresent() const; |
|
135 IMPORT_C void SetProtocolIdentifierPresent(TBool aPresent); |
|
136 |
|
137 IMPORT_C CSmsUserData& UserData(); |
|
138 IMPORT_C const CSmsUserData& UserData() const; |
|
139 virtual void DecodeL(TGsmuLex8& aPdu)=0; |
|
140 void UpdateConcatenationDataL(TInt aRef, TInt aPduIndex, TInt aMaxPdu); |
|
141 void UpdateEmailHeaderDataL(TInt& aEmailOverallHeaderLength); |
|
142 |
|
143 // SMSC Control Parameters |
|
144 TBool UpdateSMSCCtrlParameterL(const TUint8 aOctet); |
|
145 |
|
146 // TPSRR Scheme |
|
147 TBool UpdateTPSRRL(TSmsFirstOctet aSmsReportRequest); |
|
148 |
|
149 // National Language Encoding |
|
150 IMPORT_C TSmsEncoding NationalLanguageEncoding() const; |
|
151 IMPORT_C void SetNationalLanguageEncodingL(TSmsEncoding aEncoding); |
|
152 |
|
153 IMPORT_C CSmsPDU* DuplicateL() const; |
|
154 |
|
155 protected: |
|
156 CSmsPDU(TSmsPDUType aSmsPDUType); |
|
157 |
|
158 virtual const TSmsDataCodingScheme* DataCodingScheme() const; // Functions made const to avoid too many definitions |
|
159 virtual const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
160 virtual const TSmsParameterIndicator* ParameterIndicator() const; |
|
161 virtual const CSmsUserData* UserDataPtr() const; |
|
162 virtual const CSmsAddress* ToFromAddressPtr() const; |
|
163 |
|
164 virtual void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs)=0; |
|
165 virtual TUint8* EncodeL(TUint8* aPtr) const=0; |
|
166 virtual TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const=0; |
|
167 |
|
168 virtual void InternalizeMessagePDUL(RReadStream& aStream)=0; |
|
169 virtual void ExternalizeMessagePDUL(RWriteStream& aStream) const=0; |
|
170 |
|
171 private: |
|
172 TBool DoTextConcatenated(TInt& aIndex,TBool* aIs16Bit) const; |
|
173 void DoSetTextConcatenatedL(TBool aIs16Bit); |
|
174 TBool DoApplicationPortAddressing(TInt& aIndex,TInt& aDestination,TInt& aOriginator,TBool* aIs16Bit) const; |
|
175 void DoSetApplicationPortAddressingL(TInt aDestination,TInt aOriginator,TBool aIs16Bit); |
|
176 |
|
177 private: |
|
178 const TSmsPDUType iSmsPDUType; |
|
179 |
|
180 protected: |
|
181 CSmsAddress* iServiceCenterAddress; |
|
182 }; |
|
183 |
|
184 |
|
185 /** |
|
186 * SMS-DELIVER PDU - SC to MS |
|
187 * @publishedAll |
|
188 * @released |
|
189 */ |
|
190 class CSmsDeliver : public CSmsPDU |
|
191 { |
|
192 public: |
|
193 CSmsDeliver(); |
|
194 ~CSmsDeliver(); |
|
195 |
|
196 IMPORT_C TBool MoreMessagesToSend() const; |
|
197 IMPORT_C void SetMoreMessagesToSend(TBool aMore); |
|
198 |
|
199 IMPORT_C TBool ReplyPath() const; |
|
200 IMPORT_C void SetReplyPath(TBool aReplyPath); |
|
201 |
|
202 IMPORT_C TBool StatusReportIndication() const; |
|
203 IMPORT_C void SetStatusReportIndication(TBool aIndication); |
|
204 |
|
205 IMPORT_C void ServiceCenterTimeStamp(TTime& aTime,TInt& aNumQuarterHours); |
|
206 IMPORT_C void SetServiceCenterTimeStamp(const TTime& aTime,TInt aNumQuarterHours=0); |
|
207 IMPORT_C const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
208 |
|
209 IMPORT_C CSmsDeliver* DuplicateL() const; |
|
210 |
|
211 protected: |
|
212 const TSmsDataCodingScheme* DataCodingScheme() const; |
|
213 const CSmsUserData* UserDataPtr() const; |
|
214 const CSmsAddress* ToFromAddressPtr() const; |
|
215 |
|
216 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
217 TUint8* EncodeL(TUint8* aPtr) const; |
|
218 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
219 void DecodeL(TGsmuLex8& aPdu); |
|
220 void InternalizeMessagePDUL(RReadStream& aStream); |
|
221 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
222 |
|
223 private: |
|
224 TSmsFirstOctet iFirstOctet; |
|
225 CSmsAddress* iOriginalAddress; |
|
226 TSmsProtocolIdentifier iProtocolIdentifier; |
|
227 TSmsDataCodingScheme iDataCodingScheme; |
|
228 TSmsServiceCenterTimeStamp iServiceCenterTimeStamp; |
|
229 CSmsUserData* iUserData; |
|
230 }; |
|
231 |
|
232 |
|
233 /** |
|
234 * SMS-SUBMIT PDU - MS to SC |
|
235 * @publishedAll |
|
236 * @released |
|
237 */ |
|
238 class CSmsSubmit : public CSmsPDU |
|
239 { |
|
240 public: |
|
241 CSmsSubmit(); |
|
242 ~CSmsSubmit(); |
|
243 |
|
244 IMPORT_C TBool RejectDuplicates() const; |
|
245 IMPORT_C void SetRejectDuplicates(TBool aRejectDuplicates); |
|
246 |
|
247 IMPORT_C TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const; |
|
248 IMPORT_C void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat); |
|
249 |
|
250 IMPORT_C TBool ReplyPath() const; |
|
251 IMPORT_C void SetReplyPath(TBool aReplyPath); |
|
252 |
|
253 IMPORT_C TBool StatusReportRequest() const; |
|
254 IMPORT_C void SetStatusReportRequest(TBool aRequest); |
|
255 |
|
256 IMPORT_C TInt MessageReference() const; |
|
257 IMPORT_C void SetMessageReference(TInt aMessageReference); |
|
258 |
|
259 IMPORT_C const TTimeIntervalMinutes& ValidityPeriod() const; |
|
260 IMPORT_C void SetValidityPeriod(const TTimeIntervalMinutes& aTimeIntervalMinutes); |
|
261 |
|
262 IMPORT_C CSmsSubmit* DuplicateL() const; |
|
263 |
|
264 protected: |
|
265 const TSmsDataCodingScheme* DataCodingScheme() const; |
|
266 const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
267 const CSmsUserData* UserDataPtr() const; |
|
268 const CSmsAddress* ToFromAddressPtr() const; |
|
269 |
|
270 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
271 TUint8* EncodeL(TUint8* aPtr) const; |
|
272 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
273 void DecodeL(TGsmuLex8& aPdu); |
|
274 void InternalizeMessagePDUL(RReadStream& aStream); |
|
275 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
276 |
|
277 private: |
|
278 TSmsFirstOctet iFirstOctet; |
|
279 TSmsOctet iMessageReference; |
|
280 CSmsAddress* iDestinationAddress; |
|
281 TSmsProtocolIdentifier iProtocolIdentifier; |
|
282 TSmsDataCodingScheme iDataCodingScheme; |
|
283 TSmsValidityPeriod iValidityPeriod; |
|
284 CSmsUserData* iUserData; |
|
285 }; |
|
286 |
|
287 |
|
288 /** |
|
289 * SMS-DELIVER-REPORT PDU - MS to SC |
|
290 * @publishedAll |
|
291 * @released |
|
292 */ |
|
293 class CSmsDeliverReport : public CSmsPDU |
|
294 { |
|
295 public: |
|
296 CSmsDeliverReport(TBool aIsRPError=EFalse); |
|
297 ~CSmsDeliverReport(); |
|
298 |
|
299 inline TBool IsRPError() const; |
|
300 inline void SetIsRPError(TBool aIsRPError); |
|
301 |
|
302 IMPORT_C TInt FailureCause() const; |
|
303 IMPORT_C void SetFailureCause(TSmsFailureCause::TSmsFailureCauseError aFailureCause); |
|
304 |
|
305 IMPORT_C CSmsDeliverReport* DuplicateL() const; |
|
306 |
|
307 protected: |
|
308 const TSmsDataCodingScheme* DataCodingScheme() const; |
|
309 const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
310 const TSmsParameterIndicator* ParameterIndicator() const; |
|
311 const CSmsUserData* UserDataPtr() const; |
|
312 |
|
313 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
314 TUint8* EncodeL(TUint8* aPtr) const; |
|
315 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
316 void DecodeL(TGsmuLex8& aPdu); |
|
317 void InternalizeMessagePDUL(RReadStream& aStream); |
|
318 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
319 |
|
320 private: |
|
321 TUint8 iIsRPError; |
|
322 |
|
323 TSmsFirstOctet iFirstOctet; |
|
324 TSmsFailureCause iFailureCause; |
|
325 TSmsParameterIndicator iParameterIndicator; |
|
326 TSmsProtocolIdentifier iProtocolIdentifier; |
|
327 TSmsDataCodingScheme iDataCodingScheme; |
|
328 CSmsUserData* iUserData; |
|
329 }; |
|
330 |
|
331 |
|
332 /** |
|
333 * SMS-SUBMIT-REPORT PDU - SC to MS |
|
334 * @publishedAll |
|
335 * @released |
|
336 */ |
|
337 class CSmsSubmitReport : public CSmsPDU |
|
338 { |
|
339 public: |
|
340 CSmsSubmitReport(TBool aIsRPError=EFalse); |
|
341 ~CSmsSubmitReport(); |
|
342 |
|
343 inline TBool IsRPError() const; |
|
344 inline void SetIsRPError(TBool aIsRPError); |
|
345 |
|
346 IMPORT_C TInt FailureCause() const; |
|
347 IMPORT_C void SetFailureCause(TSmsFailureCause::TSmsFailureCauseError aFailureCause); |
|
348 |
|
349 IMPORT_C CSmsSubmitReport* DuplicateL() const; |
|
350 |
|
351 protected: |
|
352 const TSmsDataCodingScheme* DataCodingScheme() const; |
|
353 const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
354 const TSmsParameterIndicator* ParameterIndicator() const; |
|
355 const CSmsUserData* UserDataPtr() const; |
|
356 |
|
357 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
358 TUint8* EncodeL(TUint8* aPtr) const; |
|
359 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
360 void DecodeL(TGsmuLex8& aPdu); |
|
361 void InternalizeMessagePDUL(RReadStream& aStream); |
|
362 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
363 |
|
364 private: |
|
365 TUint8 iIsRPError; |
|
366 |
|
367 TSmsFirstOctet iFirstOctet; |
|
368 TSmsFailureCause iFailureCause; |
|
369 TSmsParameterIndicator iParameterIndicator; |
|
370 TSmsServiceCenterTimeStamp iServiceCenterTimeStamp; |
|
371 TSmsProtocolIdentifier iProtocolIdentifier; |
|
372 TSmsDataCodingScheme iDataCodingScheme; |
|
373 CSmsUserData* iUserData; |
|
374 }; |
|
375 |
|
376 |
|
377 /** |
|
378 * SMS-STATUS-REPORT PDU - SC to MS |
|
379 * @publishedAll |
|
380 * @released |
|
381 */ |
|
382 class CSmsStatusReport : public CSmsPDU |
|
383 { |
|
384 public: |
|
385 CSmsStatusReport(); |
|
386 ~CSmsStatusReport(); |
|
387 |
|
388 inline TBool ParameterIndicatorPresent() const; |
|
389 inline void SetParameterIndicatorPresent(TBool aPresent); |
|
390 |
|
391 IMPORT_C TBool MoreMessagesToSend() const; |
|
392 IMPORT_C void SetMoreMessagesToSend(TBool aMore); |
|
393 |
|
394 IMPORT_C TSmsFirstOctet::TSmsStatusReportQualifier StatusReportQualifier() const; |
|
395 IMPORT_C void SetStatusReportQualifier(TSmsFirstOctet::TSmsStatusReportQualifier aQualifier); |
|
396 |
|
397 IMPORT_C TInt MessageReference() const; |
|
398 IMPORT_C void SetMessageReference(TInt aMessageReference); |
|
399 |
|
400 IMPORT_C void ServiceCenterTimeStamp(TTime& aTime,TInt& aNumQuarterHours); |
|
401 IMPORT_C void SetServiceCenterTimeStamp(const TTime& aTime,TInt& aNumQuarterHours); |
|
402 |
|
403 IMPORT_C void DischargeTime(TTime& aTime,TInt& aNumQuarterHours); |
|
404 IMPORT_C void SetDischargeTime(const TTime& aTime,TInt& aNumQuarterHours); |
|
405 |
|
406 IMPORT_C TSmsStatus::TSmsStatusValue Status() const; |
|
407 IMPORT_C void SetStatus(TSmsStatus::TSmsStatusValue aValue); |
|
408 |
|
409 IMPORT_C CSmsStatusReport* DuplicateL() const; |
|
410 |
|
411 protected: |
|
412 const TSmsDataCodingScheme* DataCodingScheme() const; |
|
413 const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
414 const TSmsParameterIndicator* ParameterIndicator() const; |
|
415 const CSmsUserData* UserDataPtr() const; |
|
416 const CSmsAddress* ToFromAddressPtr() const; |
|
417 |
|
418 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
419 TUint8* EncodeL(TUint8* aPtr) const; |
|
420 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
421 void DecodeL(TGsmuLex8& aPdu); |
|
422 void InternalizeMessagePDUL(RReadStream& aStream); |
|
423 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
424 |
|
425 private: |
|
426 TUint8 iParameterIndicatorPresent; |
|
427 |
|
428 TSmsFirstOctet iFirstOctet; |
|
429 TSmsOctet iMessageReference; |
|
430 CSmsAddress* iRecipientAddress; |
|
431 TSmsServiceCenterTimeStamp iServiceCenterTimeStamp; |
|
432 TSmsServiceCenterTimeStamp iDischargeTime; |
|
433 TSmsStatus iStatus; |
|
434 TSmsParameterIndicator iParameterIndicator; |
|
435 TSmsProtocolIdentifier iProtocolIdentifier; |
|
436 TSmsDataCodingScheme iDataCodingScheme; |
|
437 CSmsUserData* iUserData; |
|
438 }; |
|
439 |
|
440 |
|
441 /** |
|
442 * SMS-COMMAND PDU - MS to SC |
|
443 * @publishedAll |
|
444 * @released |
|
445 */ |
|
446 class CSmsCommand : public CSmsPDU |
|
447 { |
|
448 public: |
|
449 CSmsCommand(); |
|
450 ~CSmsCommand(); |
|
451 |
|
452 IMPORT_C TBool StatusReportRequest() const; |
|
453 IMPORT_C void SetStatusReportRequest(TBool aRequest); |
|
454 |
|
455 IMPORT_C TInt MessageReference() const; |
|
456 IMPORT_C void SetMessageReference(TInt aMessageReference); |
|
457 |
|
458 IMPORT_C TInt CommandType() const; |
|
459 IMPORT_C void SetCommandType(TSmsCommandType::TSmsCommandTypeValue aCommandType); |
|
460 |
|
461 IMPORT_C TInt MessageNumber() const; |
|
462 IMPORT_C void SetMessageNumber(TInt aMessageNumber); |
|
463 |
|
464 IMPORT_C TInt NumInformationElements() const; |
|
465 IMPORT_C CSmsInformationElement& InformationElement(TInt aIndex) const; |
|
466 CSmsInformationElement*& InformationElementPtr(TInt aIndex) const; |
|
467 IMPORT_C TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, |
|
468 TInt& aIndex) const; |
|
469 IMPORT_C void AddInformationElementL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, TDesC8& aData); |
|
470 IMPORT_C void RemoveInformationElement(TInt aIndex); |
|
471 |
|
472 IMPORT_C TInt MaxCommandDataLength() const; |
|
473 IMPORT_C TPtrC8 CommandData() const; |
|
474 IMPORT_C void SetCommandDataL(const TDesC8& aData); |
|
475 |
|
476 IMPORT_C CSmsCommand* DuplicateL() const; |
|
477 |
|
478 protected: |
|
479 const TSmsProtocolIdentifier* ProtocolIdentifier() const; |
|
480 const CSmsAddress* ToFromAddressPtr() const; |
|
481 |
|
482 void ConstructL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs); |
|
483 TUint8* EncodeL(TUint8* aPtr) const; |
|
484 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const; |
|
485 void DecodeL(TGsmuLex8& aPdu); |
|
486 void InternalizeMessagePDUL(RReadStream& aStream); |
|
487 void ExternalizeMessagePDUL(RWriteStream& aStream) const; |
|
488 void DoSetStatusReportRequest(TBool aRequest); |
|
489 |
|
490 private: |
|
491 TSmsFirstOctet iFirstOctet; |
|
492 TSmsOctet iMessageReference; |
|
493 TSmsProtocolIdentifier iProtocolIdentifier; |
|
494 TSmsCommandType iCommandType; |
|
495 TSmsOctet iMessageNumber; |
|
496 CSmsAddress* iDestinationAddress; |
|
497 CSmsCommandData* iCommandData; |
|
498 }; |
|
499 |
|
500 #include "gsmupdu.inl" |
|
501 |
|
502 #endif // !defined __GSMUPDU_H__ |