Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: gsmupdu.h
Link against: gsmu.lib

Class CSmsPDU

class CSmsPDU : public CBase;

Description

A generic interface to a GSM SMS PDU.

The class can be used on its own to encode GSM SMS PDUs. It is also the base class for the six real implementations of GSM SMS PDUs. The derived classes are built up from the elements defined in gsmuelem.h according to the ETSI GSM 03.40. All the SMS elements have generic encode and decode functions so that each PDU type knows how to encode and decode itself into a TGsmSms.

CSmsPDU and derived classes provide a human readable interface to a GSM SMS PDU, for example setting the destination address on a SUBMIT (CSmsSubmit). All the factory functions for CSmsPDUs are provided in the base class.

Derivation

Members

Defined in CSmsPDU:
Alphabet(), ApplicationPortAddressing(), Bits7To4(), Class(), ConcatenatedMessagePDUIndex(), ConcatenatedMessageReference(), ConstructL(), DataCodingScheme(), DataCodingSchemePresent(), DecodeL(), ESmsCommand, ESmsDeliver, ESmsDeliverReport, ESmsStatusReport, ESmsSubmit, ESmsSubmitReport, EncodeL(), EncodeMessagePDUL(), ExternalizeL(), ExternalizeMessagePDUL(), IndicationState(), IndicationType(), InternalizeMessagePDUL(), NewL(), NewL(), NewL(), NumConcatenatedMessagePDUs(), PIDType(), ParameterIndicator(), ParsedServiceCenterAddress(), ParsedToFromAddress(), ProtocolIdentifier(), ProtocolIdentifierPresent(), ServiceCenterAddress(), SetAlphabet(), SetApplicationPortAddressingL(), SetBits7To4(), SetClass(), SetConcatenatedMessagePDUIndex(), SetConcatenatedMessageReference(), SetDataCodingSchemePresent(), SetIndicationState(), SetIndicationType(), SetNumConcatenatedMessagePDUs(), SetPIDType(), SetParsedServiceCenterAddressL(), SetParsedToFromAddressL(), SetProtocolIdentifierPresent(), SetServiceCenterAddressL(), SetShortMessageType(), SetTelematicDeviceIndicator(), SetTelematicDeviceType(), SetTextCompressed(), SetTextConcatenatedL(), SetToFromAddressL(), SetUserDataPresent(), ShortMessageType(), TSmsPDUType, TelematicDeviceIndicator(), TelematicDeviceType(), TextCompressed(), TextConcatenated(), ToFromAddress(), ToFromAddressPtr(), Type(), UserData(), UserData(), UserDataPresent(), UserDataPtr(), iServiceCenterAddress

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

Capability: Illegal

static IMPORT_C CSmsPDU *NewL(RReadStream &aStream, CCnvCharacterSetConverter &aCharacterSetConverter, RFs &aFs);

Description

Restores a CSmsPDU from a stream where the object has bean previously persisted.

The type is determined from the first byte in the stream.

Parameters

RReadStream &aStream

Stream from which to restore this CSmsPDU

CCnvCharacterSetConverter &aCharacterSetConverter

Character converter utility, required for encoding and decoding this PDU

RFs &aFs

File system handle, required for encoding and decoding this PDU

Return value

CSmsPDU *

Newly constructed CSmsPDU-derived object restored from aStream


NewL()

Capability: Illegal

static IMPORT_C CSmsPDU *NewL(const TGsmSms &aGsmSms, CCnvCharacterSetConverter &aCharacterSetConverter, RFs &aFs, TBool aIsRPError=EFalse, TBool aIsMobileTerminated=ETrue);

Description

Allocates and constructs a CSmsPDU from a TGsmSms.

The type of SMS to construct is determined from the first octet in aGsmSms and whether the SMS is mobile terminated.

TODO Service centre address should be in rigth format when it comes from TSY

Parameters

const TGsmSms &aGsmSms

Encoded (raw) GSM SMS PDU

CCnvCharacterSetConverter &aCharacterSetConverter

Character converter utility, required for encoding and decoding this PDU

RFs &aFs

File system handle, required for encoding and decoding this PDU

TBool aIsRPError

True if the PDU is part of an RP Error. This is used only for SUBMIT REPORT (CSmsSubmitReport) and DELIVER REPORT (CSmsDeliverReport), as the format of these PDUs differs depending on whether the PDU is part of an RP Ack or RP Error.

TBool aIsMobileTerminated

Used to determine (with the first octet in aGsmSms) the TSmsPDUType

Return value

CSmsPDU *

Newly constructed CSmsPDU-derived object restored from aGsmSms


NewL()

Capability: Illegal

static IMPORT_C CSmsPDU *NewL(TSmsPDUType aType, CCnvCharacterSetConverter &aCharacterSetConverter, RFs &aFs, TBool aIsRPError=EFalse);

Description

Allocates and constructs a CSmsPDU, with the type specified by a TSmsPDUType.

Parameters

TSmsPDUType aType

The PDU type to construct

CCnvCharacterSetConverter &aCharacterSetConverter

Character converter utility, required for encoding and decoding this PDU

RFs &aFs

File system handle, required for encoding and decoding this PDU

TBool aIsRPError

True if the PDU is part of an RP Error. This is used only for SUBMIT REPORT (CSmsSubmitReport) and DELIVER REPORT (CSmsDeliverReport), as the format of these PDUs differs depending on whether the PDU is part of an RP Ack or RP Error.

Return value

CSmsPDU *

Newly constructed CSmsPDU-derived object


ConstructL()

protected: virtual void ConstructL(CCnvCharacterSetConverter &aCharacterSetConverter, RFs &aFs)=0;

Description

Parameters

CCnvCharacterSetConverter &aCharacterSetConverter

RFs &aFs

[Top]


Member functions


Type()

inline TSmsPDUType Type() const;

Description

Gets the PDU type.

Once a PDU has been constructed it cannot change its type as the SMS elements present differ. Hence there is no function to set the type.

Return value

TSmsPDUType

PDU type


ExternalizeL()

Capability: Illegal

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises the object.

Parameters

RWriteStream &aStream

Stream to write to


EncodeMessagePDUL()

Capability: Illegal

IMPORT_C void EncodeMessagePDUL(TGsmSms &aGsmSms) const;

Description

Encodes a TGsmSms for the given type of CSmsPDU.

Parameters

TGsmSms &aGsmSms

On return, encoded GSM SMS PDU


ServiceCenterAddress()

Capability: Illegal

IMPORT_C TPtrC ServiceCenterAddress() const;

Description

Gets the service center address.

It is assumed that the address is Unicode, and can contain spaces and alphabetic characters.

Return value

TPtrC

Service center address


SetServiceCenterAddressL()

Capability: Illegal

IMPORT_C void SetServiceCenterAddressL(const TDesC &aAddress);

Description

Sets the service center address.

A prepended '+' is used to indicate an international number.

Parameters

const TDesC &aAddress

Service center address


ParsedServiceCenterAddress()

Capability: Illegal

IMPORT_C void ParsedServiceCenterAddress(TGsmSmsTelNumber &aParsedAddress) const;

Description

Gets the service center address in a TGsmSmsTelNumber object.

A prepended '+', spaces and aphabetic characters are removed.

Parameters

TGsmSmsTelNumber &aParsedAddress

Service center address


SetParsedServiceCenterAddressL()

Capability: Illegal

IMPORT_C void SetParsedServiceCenterAddressL(const TGsmSmsTelNumber &aParsedAddress);

Description

Sets the service center address through a TGsmSmsTelNumber object.

These functions panic for a DELIVER REPORT (CSmsDeliverReport) or a SUBMIT REPORT (CSmsSubmitReport).

Parameters

const TGsmSmsTelNumber &aParsedAddress

Service center address


ToFromAddress()

Capability: Illegal

IMPORT_C TPtrC ToFromAddress() const;

Description

Gets the "to from" address.

This address is the original (sender's) address for a DELIVER (CSmsDeliver), the destination address for a SUBMIT (CSmsSubmit), the recipient (sender's) address for a STATUS REPORT (CSmsStatusReport) and the destination address for a COMMAND (CSmsCommand).

The function panics for a DELIVER REPORT (CSmsDeliverReport) or a SUBMIT REPORT (CSmsSubmitReport).

It is assumed that the address is Unicode, and can contain spaces and alphabetic characters.

Return value

TPtrC

The destination or sender address


SetToFromAddressL()

Capability: Illegal

IMPORT_C void SetToFromAddressL(const TDesC &aAddress);

Description

Sets the "to from" address.

The function panics for a DELIVER REPORT (CSmsDeliverReport) or a SUBMIT REPORT (CSmsSubmitReport).

A prepended '+' is used to indicate an international number.

Parameters

const TDesC &aAddress

The destination or sender address


ParsedToFromAddress()

Capability: Illegal

IMPORT_C void ParsedToFromAddress(TGsmSmsTelNumber &aParsedAddress) const;

Description

Gets the "to from" in a TGsmSmsTelNumber object.

A prepended '+', spaces and aphabetic characters are removed.

Parameters

TGsmSmsTelNumber &aParsedAddress

The destination or sender address


SetParsedToFromAddressL()

Capability: Illegal

IMPORT_C void SetParsedToFromAddressL(const TGsmSmsTelNumber &aParsedAddress);

Description

Sets the "to from" with a TGsmSmsTelNumber object.

Parameters

const TGsmSmsTelNumber &aParsedAddress

The destination or sender address


Bits7To4()

Capability: Illegal

IMPORT_C TSmsDataCodingScheme::TSmsDCSBits7To4 Bits7To4() const;

Description

Gets bits 7 to 4 on the data coding scheme.

The value of bits 7 to 4 effects the meaning of the lower order bits.

The function panics if the data coding scheme is not present.

Return value

TSmsDataCodingScheme::TSmsDCSBits7To4

Bits 7 to 4


SetBits7To4()

Capability: Illegal

IMPORT_C void SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4 aBits7To4);

Description

Sets key bits 7 to 4 of the data coding scheme.

This is designed to be used for message waiting indication, as it is not needed for the normal type of data coding scheme where the alphabet and class are defined in the lower order bits.

The function panics if the data coding scheme is not present.

Parameters

TSmsDataCodingScheme::TSmsDCSBits7To4 aBits7To4

Bits 7 to 4


Alphabet()

Capability: Illegal

IMPORT_C TSmsDataCodingScheme::TSmsAlphabet Alphabet() const;

Description

Gets the alphabet encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Return value

TSmsDataCodingScheme::TSmsAlphabet

Alphabet


SetAlphabet()

Capability: Illegal

IMPORT_C void SetAlphabet(TSmsDataCodingScheme::TSmsAlphabet aAlphabet);

Description

Sets the alphabet encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TSmsDataCodingScheme::TSmsAlphabet aAlphabet

Alphabet


Class()

Capability: Illegal

IMPORT_C TBool Class(TSmsDataCodingScheme::TSmsClass &aClass) const;

Description

Gets the GSM SMS PDU class in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TSmsDataCodingScheme::TSmsClass &aClass

Sms class 0 - 3 encoded in the data coding scheme

Return value

TBool

True if SMS class is defined, else false


SetClass()

Capability: Illegal

IMPORT_C void SetClass(TBool aClassDefined, TSmsDataCodingScheme::TSmsClass aClass);

Description

Sets the GSM SMS PDU class in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TBool aClassDefined

True if SMS class is defined, else false

TSmsDataCodingScheme::TSmsClass aClass

Sms class 0 - 3 encoded in the data coding scheme


TextCompressed()

Capability: Illegal

IMPORT_C TBool TextCompressed() const;

Description

True if Text Compressed is encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Return value

TBool

True if Text Compressed is encoded


SetTextCompressed()

Capability: Illegal

IMPORT_C void SetTextCompressed(TBool aCompressed);

Description

Set to encode Text Compressed in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TBool aCompressed

True to encode Text Compressed


IndicationState()

Capability: Illegal

IMPORT_C TSmsDataCodingScheme::TSmsIndicationState IndicationState() const;

Description

Gets the Indication State encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Return value

TSmsDataCodingScheme::TSmsIndicationState

Indication State


SetIndicationState()

Capability: Illegal

IMPORT_C void SetIndicationState(TSmsDataCodingScheme::TSmsIndicationState aState);

Description

Sets the Indication State encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TSmsDataCodingScheme::TSmsIndicationState aState

Indication State


IndicationType()

Capability: Illegal

IMPORT_C TSmsDataCodingScheme::TSmsIndicationType IndicationType() const;

Description

Gets the Indication Type encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Return value

TSmsDataCodingScheme::TSmsIndicationType

Indication Type


SetIndicationType()

Capability: Illegal

IMPORT_C void SetIndicationType(TSmsDataCodingScheme::TSmsIndicationType aType);

Description

Sets the Indication Type encoded in the data coding scheme.

The function panics if the data coding scheme is not present.

Parameters

TSmsDataCodingScheme::TSmsIndicationType aType

Indication Type


TextConcatenated()

Capability: Illegal

IMPORT_C TBool TextConcatenated(TBool *aIs16Bit=0) const;

Description

Tests if the PDU is part of a concatenated message.

Parameters

TBool *aIs16Bit

Content is set true if Concatenation Information Element is 16-bit. Default is null.

Return value

TBool

True if the PDU is part of a concatenated message.


SetTextConcatenatedL()

Capability: Illegal

IMPORT_C void SetTextConcatenatedL(TBool aConcatenated, TBool aIs16Bit=EFalse);

Description

Sets whether the PDU is part of a concatenated message or not.

It is a leaving function as it is inserting an information element into the user data.

Parameters

TBool aConcatenated

True if message is concatenated

TBool aIs16Bit

True if type of Concatenation Information Element is 16 bit


ConcatenatedMessageReference()

Capability: Illegal

IMPORT_C TInt ConcatenatedMessageReference() const;

Description

Gets the reference contained in the Concatenation Information Element.

Return value

TInt

Reference contained in the Concatenation Information Element


SetConcatenatedMessageReference()

Capability: Illegal

IMPORT_C void SetConcatenatedMessageReference(TInt aReference);

Description

Sets the reference contained in the Concatenation Information Element.

The function panics if aReference is out of range for the message type.

Parameters

TInt aReference

Value to set the Concatenated Message Reference.


NumConcatenatedMessagePDUs()

Capability: Illegal

IMPORT_C TInt NumConcatenatedMessagePDUs() const;

Description

Gets the number of PDU's in a Concatenated Message.

The function panics if the PDU is not concatenated.

Return value

TInt

Number of PDU's in a Concatenated Message


SetNumConcatenatedMessagePDUs()

Capability: Illegal

IMPORT_C void SetNumConcatenatedMessagePDUs(TInt aNum);

Description

Sets the number of PDU's in a Concatenated Message.

The function panics if the PDU is not concatenated or if aNum is out of range.

Parameters

TInt aNum

Number of PDU's in a Concatenated Message


ConcatenatedMessagePDUIndex()

Capability: Illegal

IMPORT_C TInt ConcatenatedMessagePDUIndex() const;

Description

Gets the index of the PDU within the Concatenated Message.

The function panics if the PDU is not concatenated.

Return value

TInt

Index of the PDU within the Concatenated Message


SetConcatenatedMessagePDUIndex()

Capability: Illegal

IMPORT_C void SetConcatenatedMessagePDUIndex(TInt aIndex);

Description

Sets the index of the PDU within the Concatenated Message.

The function panics if the PDU is not concatenated or aIndex is out of range.

Parameters

TInt aIndex

Index of the PDU within the Concatenated Message


ApplicationPortAddressing()

Capability: Illegal

IMPORT_C TBool ApplicationPortAddressing(TInt &aDestination, TInt &aOriginator, TBool *aIs16Bit=0) const;

Description

Gets application port addressing information in the user data.

Parameters

TInt &aDestination

The destination port address

TInt &aOriginator

The originating port address

TBool *aIs16Bit

Set to true if the addressing is 16 bit. Default is null.

Return value

TBool

True if there is an application port addressing information element in the user data


SetApplicationPortAddressingL()

Capability: Illegal

IMPORT_C void SetApplicationPortAddressingL(TBool aAddressing, TInt aDestination, TInt aOriginator, TBool aIs16Bit=EFalse);

Description

Sets application port addressing information in the user data.

Parameters

TBool aAddressing

If true, set application port addressing in the PDU. If false, removes addressing if it's already set

TInt aDestination

The destination port address to set in the PDU

TInt aOriginator

The originating port address to set in the PDU

TBool aIs16Bit

True if the addresses are 16 bit, false if 8 bit


PIDType()

Capability: Illegal

IMPORT_C TSmsProtocolIdentifier::TSmsPIDType PIDType() const;

Description

Gets key bits 7 and 6 of the PID field.

Return value

TSmsProtocolIdentifier::TSmsPIDType

Bits 7 and 6 of the PID field


SetPIDType()

Capability: Illegal

IMPORT_C void SetPIDType(TSmsProtocolIdentifier::TSmsPIDType aSmsPIDType);

Description

Sets key bits 7 and 6 of the PID field.

Parameters

TSmsProtocolIdentifier::TSmsPIDType aSmsPIDType

Bits 7 and 6 of the PID field


TelematicDeviceIndicator()

Capability: Illegal

IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;

Description

Gets the Telematic device indicator from the PID field.

Return value

TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator

Telematic device indicator


SetTelematicDeviceIndicator()

Capability: Illegal

IMPORT_C void SetTelematicDeviceIndicator(TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator aIndicator);

Description

Sets the Telematic device indicator from the PID field.

Parameters

TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator aIndicator

Telematic device indicator


ShortMessageType()

Capability: Illegal

IMPORT_C TSmsProtocolIdentifier::TSmsShortMessageType ShortMessageType() const;

Description

Gets the Short Message Type in the PID field.

Return value

TSmsProtocolIdentifier::TSmsShortMessageType

Short Message Type


SetShortMessageType()

Capability: Illegal

IMPORT_C void SetShortMessageType(TSmsProtocolIdentifier::TSmsShortMessageType aShortMessageType);

Description

Sets the Short Message Type in the PID field.

Parameters

TSmsProtocolIdentifier::TSmsShortMessageType aShortMessageType

Short Message Type


TelematicDeviceType()

Capability: Illegal

IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceType TelematicDeviceType() const;

Description

Gets the Telematic device type in the PID field.

Return value

TSmsProtocolIdentifier::TSmsTelematicDeviceType

Telematic device type


SetTelematicDeviceType()

Capability: Illegal

IMPORT_C void SetTelematicDeviceType(TSmsProtocolIdentifier::TSmsTelematicDeviceType aDeviceType);

Description

Sets the Telematic device type in the PID field.

Parameters

TSmsProtocolIdentifier::TSmsTelematicDeviceType aDeviceType

Telematic device type


UserDataPresent()

Capability: Illegal

IMPORT_C TBool UserDataPresent() const;

Description

Tests if the User Data Header Indicator is set.

It panics if PDU type is unsupported.

Return value

TBool

True if the User Data Header Indicator is set


SetUserDataPresent()

Capability: Illegal

IMPORT_C void SetUserDataPresent(TBool aPresent);

Description

Sets or unsets the User Data Header Indicator.

It panics if PDU type is unsupported.

Parameters

TBool aPresent

True to set the User Data Header Indicator


DataCodingSchemePresent()

Capability: Illegal

IMPORT_C TBool DataCodingSchemePresent() const;

Description

Tests if data coding scheme is present.

Panics if PDU type is unsupported.

Return value

TBool

True if data coding scheme is present


SetDataCodingSchemePresent()

Capability: Illegal

IMPORT_C void SetDataCodingSchemePresent(TBool aPresent);

Description

Sets if data coding scheme is present.

Parameters

TBool aPresent

True if data coding scheme is present


ProtocolIdentifierPresent()

Capability: Illegal

IMPORT_C TBool ProtocolIdentifierPresent() const;

Description

Tests if Protocol Identifier is present.

It panics if the PDU type is unsupported.

Return value

TBool

True if Protocol Identifier is present


SetProtocolIdentifierPresent()

Capability: Illegal

IMPORT_C void SetProtocolIdentifierPresent(TBool aPresent);

Description

Sets if Protocol Identifier is present.

It panics if the PDU type is unsupported.

Parameters

TBool aPresent

True if Protocol Identifier is present


UserData()

Capability: Illegal

IMPORT_C CSmsUserData &UserData();

Description

Gets User Data (non-const).

Return value

CSmsUserData &

User Data


UserData()

Capability: Illegal

IMPORT_C const CSmsUserData &UserData() const;

Description

Gets User Data (const).

Return value

const CSmsUserData &

User Data


DecodeL()

virtual void DecodeL(TGsmuLex8 &aPdu)=0;

Description

Parameters

TGsmuLex8 &aPdu


DataCodingScheme()

protected: virtual const TSmsDataCodingScheme *DataCodingScheme() const;

Description

Return value

const TSmsDataCodingScheme *


ProtocolIdentifier()

protected: virtual const TSmsProtocolIdentifier *ProtocolIdentifier() const;

Description

Return value

const TSmsProtocolIdentifier *


ParameterIndicator()

protected: virtual const TSmsParameterIndicator *ParameterIndicator() const;

Description

Return value

const TSmsParameterIndicator *


UserDataPtr()

protected: virtual const CSmsUserData *UserDataPtr() const;

Description

Return value

const CSmsUserData *


ToFromAddressPtr()

protected: virtual const CSmsAddress *ToFromAddressPtr() const;

Description

Return value

const CSmsAddress *


EncodeL()

protected: virtual TUint8 *EncodeL(TUint8 *aPtr) const=0;

Description

Parameters

TUint8 *aPtr

Return value

TUint8 *


InternalizeMessagePDUL()

protected: virtual void InternalizeMessagePDUL(RReadStream &aStream)=0;

Description

Parameters

RReadStream &aStream


ExternalizeMessagePDUL()

protected: virtual void ExternalizeMessagePDUL(RWriteStream &aStream) const=0;

Description

Parameters

RWriteStream &aStream

[Top]


Member enumerations


Enum TSmsPDUType

TSmsPDUType

Description

Flags for the 6 basic PDU types in GSM SMS messaging.

ESmsDeliver

SMS-DELIVER, sent from SC to MS.

ESmsDeliverReport

SMS-DELIVER-REPORT, sent from MS to SC.

ESmsSubmit

SMS-SUBMIT, sent from MS to SC.

ESmsSubmitReport

SMS-SUBMIT-REPORT, sent from SC to MS.

ESmsStatusReport

SMS-STATUS-REQUEST, sent from SC to MS.

ESmsCommand

SMS-COMMAND, sent from MS to SC.

[Top]


Member data


iServiceCenterAddress

protected: CSmsAddress * iServiceCenterAddress;

Description