#include <gsmupdu.h>
class CSmsPDU : public CBase |
Protected Attributes | |
---|---|
CSmsAddress * | iServiceCenterAddress |
Public Member Enumerations | |
---|---|
enum | TSmsPDUType { ESmsDeliver, ESmsDeliverReport, ESmsSubmit, ESmsSubmitReport, ..., ESmsCommand } |
Protected Member Functions | |
---|---|
CSmsPDU(TSmsPDUType) | |
pure virtual void | ConstructL(CCnvCharacterSetConverter &, RFs &) |
virtual const TSmsDataCodingScheme * | DataCodingScheme() |
pure virtual TUint8 * | EncodeL(TUint8 *) |
pure virtual TUint8 * | EncodeL(TUint8 *, const TEncodeParams *) |
pure virtual void | ExternalizeMessagePDUL(RWriteStream &) |
pure virtual void | InternalizeMessagePDUL(RReadStream &) |
virtual const TSmsParameterIndicator * | ParameterIndicator() |
virtual const TSmsProtocolIdentifier * | ProtocolIdentifier() |
virtual const CSmsAddress * | ToFromAddressPtr() |
virtual const CSmsUserData * | UserDataPtr() |
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.
IMPORT_C TSmsDataCodingScheme::TSmsAlphabet | Alphabet | ( | ) | const |
Gets the alphabet encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Returns: Alphabet
IMPORT_C TBool | ApplicationPortAddressing | ( | TInt & | aDestination, |
TInt & | aOriginator, | |||
TBool * | aIs16Bit = NULL | |||
) | const |
Gets application port addressing information in the user data.
Parameter | Description |
---|---|
aDestination | The destination port address |
aOriginator | The originating port address |
aIs16Bit | Set to true if the addressing is 16 bit. Default is null. |
Returns: True if there is an application port addressing information element in the user data
IMPORT_C TSmsDataCodingScheme::TSmsDCSBits7To4 | Bits7To4 | ( | ) | const |
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.
Returns: Bits 7 to 4
IMPORT_C TBool | Class | ( | TSmsDataCodingScheme::TSmsClass & | aClass | ) | const |
Gets the GSM SMS PDU class in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aClass | Sms class 0 - 3 encoded in the data coding scheme |
Returns: True if SMS class is defined, else false
IMPORT_C TInt | ConcatenatedMessagePDUIndex | ( | ) | const |
Gets the index of the PDU within the Concatenated Message.
The function panics if the PDU is not concatenated.
Returns: Index of the PDU within the Concatenated Message
IMPORT_C TInt | ConcatenatedMessageReference | ( | ) | const |
Gets the reference contained in the Concatenation Information Element.
Returns: Reference contained in the Concatenation Information Element
void | ConstructL | ( | CCnvCharacterSetConverter & | aCharacterSetConverter, |
RFs & | aFs | |||
) | [protected, pure virtual] |
IMPORT_C TBool | DataCodingSchemePresent | ( | ) | const |
Tests if data coding scheme is present.
Panics if PDU type is unsupported.
Returns: True if data coding scheme is present
TUint8 * | EncodeL | ( | TUint8 * | aPtr, |
const TEncodeParams * | aEncodeParams | |||
) | const [protected, pure virtual] |
void | EncodeMessagePDUL | ( | TGsmSms & | aGsmSms, |
const TEncodeParams * | aEncodeParams | |||
) | const |
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const |
Externalises the object.
Parameter | Description |
---|---|
aStream | Stream to write to |
void | ExternalizeMessagePDUL | ( | RWriteStream & | aStream | ) | const [protected, pure virtual] |
IMPORT_C TSmsDataCodingScheme::TSmsIndicationState | IndicationState | ( | ) | const |
Gets the Indication State encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Returns: Indication State
IMPORT_C TSmsDataCodingScheme::TSmsIndicationType | IndicationType | ( | ) | const |
Gets the Indication Type encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Returns: Indication Type
void | InternalizeMessagePDUL | ( | RReadStream & | aStream | ) | [protected, pure virtual] |
IMPORT_C CSmsPDU * | NewL | ( | RReadStream & | aStream, |
CCnvCharacterSetConverter & | aCharacterSetConverter, | |||
RFs & | aFs | |||
) | [static] |
Restores a CSmsPDU from a stream where the object has bean previously persisted.
The type is determined from the first byte in the stream.
Parameter | Description |
---|---|
aStream | Stream from which to restore this CSmsPDU |
aCharacterSetConverter | Character converter utility, required for encoding and decoding this PDU |
aFs | File system handle, required for encoding and decoding this PDU |
Returns: Newly constructed CSmsPDU-derived object restored from aStream
IMPORT_C CSmsPDU * | NewL | ( | const TGsmSms & | aGsmSms, |
CCnvCharacterSetConverter & | aCharacterSetConverter, | |||
RFs & | aFs, | |||
TBool | aIsRPError = EFalse, | |||
TBool | aIsMobileTerminated = ETrue | |||
) | [static] |
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.
Parameter | Description |
---|---|
aGsmSms | Encoded (raw) GSM SMS PDU |
aCharacterSetConverter | Character converter utility, required for encoding and decoding this PDU |
aFs | File system handle, required for encoding and decoding this PDU |
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. |
aIsMobileTerminated | Used to determine (with the first octet in aGsmSms) the TSmsPDUType |
Returns: Newly constructed CSmsPDU-derived object restored from aGsmSms
IMPORT_C CSmsPDU * | NewL | ( | TSmsPDUType | aType, |
CCnvCharacterSetConverter & | aCharacterSetConverter, | |||
RFs & | aFs, | |||
TBool | aIsRPError = EFalse | |||
) | [static] |
Allocates and constructs a CSmsPDU, with the type specified by a TSmsPDUType.
Parameter | Description |
---|---|
aType | The PDU type to construct |
aCharacterSetConverter | Character converter utility, required for encoding and decoding this PDU |
aFs | File system handle, required for encoding and decoding this PDU |
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. |
Returns: Newly constructed CSmsPDU-derived object
IMPORT_C TInt | NumConcatenatedMessagePDUs | ( | ) | const |
Gets the number of PDU's in a Concatenated Message.
The function panics if the PDU is not concatenated.
Returns: Number of PDU's in a Concatenated Message
IMPORT_C TSmsProtocolIdentifier::TSmsPIDType | PIDType | ( | ) | const |
Gets key bits 7 and 6 of the PID field.
Returns: Bits 7 and 6 of the PID field
IMPORT_C void | ParsedServiceCenterAddress | ( | TGsmSmsTelNumber & | aParsedAddress | ) | const |
Gets the service center address in a TGsmSmsTelNumber object.
A prepended '+', spaces and aphabetic characters are removed.
Parameter | Description |
---|---|
aParsedAddress | Service center address |
IMPORT_C void | ParsedToFromAddress | ( | TGsmSmsTelNumber & | aParsedAddress | ) | const |
Gets the "to from" in a TGsmSmsTelNumber object.
A prepended '+', spaces and aphabetic characters are removed.
Parameter | Description |
---|---|
aParsedAddress | The destination or sender address |
IMPORT_C TBool | ProtocolIdentifierPresent | ( | ) | const |
Tests if Protocol Identifier is present.
It panics if the PDU type is unsupported.
Returns: True if Protocol Identifier is present
IMPORT_C TPtrC | ServiceCenterAddress | ( | ) | const |
Gets the service center address.
It is assumed that the address is Unicode, and can contain spaces and alphabetic characters.
Returns: Service center address
IMPORT_C void | SetAlphabet | ( | TSmsDataCodingScheme::TSmsAlphabet | aAlphabet | ) |
Sets the alphabet encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aAlphabet | Alphabet |
IMPORT_C void | SetApplicationPortAddressingL | ( | TBool | aAddressing, |
TInt | aDestination, | |||
TInt | aOriginator, | |||
TBool | aIs16Bit = EFalse | |||
) |
Sets application port addressing information in the user data.
Parameter | Description |
---|---|
aAddressing | If true, set application port addressing in the PDU. If false, removes addressing if it's already set |
aDestination | The destination port address to set in the PDU |
aOriginator | The originating port address to set in the PDU |
aIs16Bit | True if the addresses are 16 bit, false if 8 bit |
IMPORT_C void | SetBits7To4 | ( | TSmsDataCodingScheme::TSmsDCSBits7To4 | aBits7To4 | ) |
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.
Parameter | Description |
---|---|
aBits7To4 | Bits 7 to 4 |
IMPORT_C void | SetClass | ( | TBool | aClassDefined, |
TSmsDataCodingScheme::TSmsClass | aClass | |||
) |
Sets the GSM SMS PDU class in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aClassDefined | True if SMS class is defined, else false |
aClass | Sms class 0 - 3 encoded in the data coding scheme |
IMPORT_C void | SetConcatenatedMessagePDUIndex | ( | TInt | aIndex | ) |
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.
Parameter | Description |
---|---|
aIndex | Index of the PDU within the Concatenated Message |
IMPORT_C void | SetConcatenatedMessageReference | ( | TInt | aReference | ) |
Sets the reference contained in the Concatenation Information Element.
The function panics if aReference is out of range for the message type.
Parameter | Description |
---|---|
aReference | Value to set the Concatenated Message Reference. |
IMPORT_C void | SetDataCodingSchemePresent | ( | TBool | aPresent | ) |
Sets if data coding scheme is present.
Parameter | Description |
---|---|
aPresent | True if data coding scheme is present |
IMPORT_C void | SetIndicationState | ( | TSmsDataCodingScheme::TSmsIndicationState | aState | ) |
Sets the Indication State encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aState | Indication State |
IMPORT_C void | SetIndicationType | ( | TSmsDataCodingScheme::TSmsIndicationType | aType | ) |
Sets the Indication Type encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aType | Indication Type |
IMPORT_C void | SetNationalLanguageEncodingL | ( | TSmsEncoding | aEncoding | ) |
IMPORT_C void | SetNumConcatenatedMessagePDUs | ( | TInt | aNum | ) |
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.
Parameter | Description |
---|---|
aNum | Number of PDU's in a Concatenated Message |
IMPORT_C void | SetPIDType | ( | TSmsProtocolIdentifier::TSmsPIDType | aSmsPIDType | ) |
Sets key bits 7 and 6 of the PID field.
Parameter | Description |
---|---|
aSmsPIDType | Bits 7 and 6 of the PID field |
IMPORT_C void | SetParsedServiceCenterAddressL | ( | const TGsmSmsTelNumber & | aParsedAddress | ) |
Sets the service center address through a TGsmSmsTelNumber object.
These functions panic for a DELIVER REPORT (CSmsDeliverReport) or a SUBMIT REPORT (CSmsSubmitReport).
Parameter | Description |
---|---|
aParsedAddress | Service center address |
IMPORT_C void | SetParsedToFromAddressL | ( | const TGsmSmsTelNumber & | aParsedAddress | ) |
Sets the "to from" with a TGsmSmsTelNumber object.
Parameter | Description |
---|---|
aParsedAddress | The destination or sender address |
IMPORT_C void | SetProtocolIdentifierPresent | ( | TBool | aPresent | ) |
Sets if Protocol Identifier is present.
It panics if the PDU type is unsupported.
Parameter | Description |
---|---|
aPresent | True if Protocol Identifier is present |
IMPORT_C void | SetServiceCenterAddressL | ( | const TDesC & | aAddress | ) |
Sets the service center address.
A prepended '+' is used to indicate an international number.
Parameter | Description |
---|---|
aAddress | Service center address |
IMPORT_C void | SetShortMessageType | ( | TSmsProtocolIdentifier::TSmsShortMessageType | aShortMessageType | ) |
Sets the Short Message Type in the PID field.
Parameter | Description |
---|---|
aShortMessageType | Short Message Type |
IMPORT_C void | SetTelematicDeviceIndicator | ( | TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator | aIndicator | ) |
Sets the Telematic device indicator from the PID field.
Parameter | Description |
---|---|
aIndicator | Telematic device indicator |
IMPORT_C void | SetTelematicDeviceType | ( | TSmsProtocolIdentifier::TSmsTelematicDeviceType | aDeviceType | ) |
Sets the Telematic device type in the PID field.
Parameter | Description |
---|---|
aDeviceType | Telematic device type |
IMPORT_C void | SetTextCompressed | ( | TBool | aCompressed | ) |
Set to encode Text Compressed in the data coding scheme.
The function panics if the data coding scheme is not present.
Parameter | Description |
---|---|
aCompressed | True to encode Text Compressed |
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.
Parameter | Description |
---|---|
aConcatenated | True if message is concatenated |
aIs16Bit | True if type of Concatenation Information Element is 16 bit |
IMPORT_C void | SetToFromAddressL | ( | const TDesC & | aAddress | ) |
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.
Parameter | Description |
---|---|
aAddress | The destination or sender address |
IMPORT_C TSmsProtocolIdentifier::TSmsShortMessageType | ShortMessageType | ( | ) | const |
Gets the Short Message Type in the PID field.
Returns: Short Message Type
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceIndicator | TelematicDeviceIndicator | ( | ) | const |
Gets the Telematic device indicator from the PID field.
Returns: Telematic device indicator
IMPORT_C TSmsProtocolIdentifier::TSmsTelematicDeviceType | TelematicDeviceType | ( | ) | const |
Gets the Telematic device type in the PID field.
Returns: Telematic device type
IMPORT_C TBool | TextCompressed | ( | ) | const |
True if Text Compressed is encoded in the data coding scheme.
The function panics if the data coding scheme is not present.
Returns: True if Text Compressed is encoded
Tests if the PDU is part of a concatenated message.
Parameter | Description |
---|---|
aIs16Bit | Content is set true if Concatenation Information Element is 16-bit. Default is null. |
Returns: True if the PDU is part of a concatenated message.
IMPORT_C TPtrC | ToFromAddress | ( | ) | const |
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.
Returns: The destination or sender address
void | UpdateEmailHeaderDataL | ( | TInt & | aEmailOverallHeaderLength | ) |
Updates the email header data in this PDU.
Parameter | Description |
---|---|
aEmailOverallHeaderLength | Length of the email header. |
TBool | UpdateTPSRRL | ( | TSmsFirstOctet | aSmsReportRequest | ) |
Updates the TPSRRL control parameter in this PDU.
Parameter | Description |
---|---|
aSmsReportRequest | Status Report Request setting. |
Returns: Always returns ETrue.
IMPORT_C const CSmsUserData & | UserData | ( | ) | const |
Gets User Data (const).
Returns: User Data