»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Narrow Band Protocols SMSSTACK »
CSmsPDU
Location:
gsmupdu.h
Link against: gsmu.lib
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
CBase
- Base class for all classes to be instantiated on the heap
CSmsPDU
- A generic interface to a GSM SMS PDU
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
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
|
|
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
|
|
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
|
|
protected: virtual void ConstructL(CCnvCharacterSetConverter &aCharacterSetConverter, RFs &aFs)=0;
Description
Parameters
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
IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
Description
Externalises the object.
Parameters
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
|
|
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()
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()
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
SetParsedServiceCenterAddressL()
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
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
|
|
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
|
|
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
SetParsedToFromAddressL()
IMPORT_C void SetParsedToFromAddressL(const TGsmSmsTelNumber &aParsedAddress);
Description
Sets the "to from" with a TGsmSmsTelNumber
object.
Parameters
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
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
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
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
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
Return value
TBool
|
True if SMS class is defined, else false
|
|
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
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
|
|
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
|
|
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
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
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
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
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.
|
|
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()
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()
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()
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()
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()
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()
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()
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()
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
|
|
IMPORT_C TSmsProtocolIdentifier::TSmsPIDType PIDType() const;
Description
Gets key bits 7 and 6 of the PID field.
Return value
IMPORT_C void SetPIDType(TSmsProtocolIdentifier::TSmsPIDType aSmsPIDType);
Description
Sets key bits 7 and 6 of the PID field.
Parameters
TelematicDeviceIndicator()
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;
Description
Gets the Telematic device indicator from the PID field.
Return value
SetTelematicDeviceIndicator()
IMPORT_C void SetTelematicDeviceIndicator(TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator aIndicator);
Description
Sets the Telematic device indicator from the PID field.
Parameters
IMPORT_C TSmsProtocolIdentifier::TSmsShortMessageType ShortMessageType() const;
Description
Gets the Short Message Type in the PID field.
Return value
IMPORT_C void SetShortMessageType(TSmsProtocolIdentifier::TSmsShortMessageType aShortMessageType);
Description
Sets the Short Message Type in the PID field.
Parameters
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceType TelematicDeviceType() const;
Description
Gets the Telematic device type in the PID field.
Return value
IMPORT_C void SetTelematicDeviceType(TSmsProtocolIdentifier::TSmsTelematicDeviceType aDeviceType);
Description
Sets the Telematic device type in the PID field.
Parameters
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
|
|
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()
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()
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()
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()
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
|
|
IMPORT_C CSmsUserData &UserData();
Description
Gets User
Data (non-const).
Return value
IMPORT_C const CSmsUserData &UserData() const;
Description
Gets User
Data (const).
Return value
virtual void DecodeL(TGsmuLex8 &aPdu)=0;
Description
Parameters
protected: virtual const TSmsDataCodingScheme *DataCodingScheme() const;
Description
Return value
protected: virtual const TSmsProtocolIdentifier *ProtocolIdentifier() const;
Description
Return value
protected: virtual const TSmsParameterIndicator *ParameterIndicator() const;
Description
Return value
protected: virtual const CSmsUserData *UserDataPtr() const;
Description
Return value
protected: virtual const CSmsAddress *ToFromAddressPtr() const;
Description
Return value
protected: virtual TUint8 *EncodeL(TUint8 *aPtr) const=0;
Description
Parameters
Return value
protected: virtual void InternalizeMessagePDUL(RReadStream &aStream)=0;
Description
Parameters
protected: virtual void ExternalizeMessagePDUL(RWriteStream &aStream) const=0;
Description
Parameters
TSmsPDUType
Description
Flags for the 6 basic PDU types in GSM SMS messaging.
protected: CSmsAddress * iServiceCenterAddress;
Description