EPOC   SDK Home Glossary Indexes Previous Next Up

RSmsMessaging class


Contents


RSmsMessaging class — SMS messaging

Section Contents


Overview

Derivation

RTelSubSessionBase

Base class. Defines telephony sub-session.

Defined in

etelbgsm.h

Link against

gsmbas.lib

Description

This class encapsulates the SMS messaging functionality associated with the phone.

Using this class, clients can send and receive SMS messages, change the mode of SMS messages, access SMS store information, and set/query the phone’s service centre number.

Writing derived classes

This class is not intended for user derivation


Construction and destruction


RSmsMessaging() — Trivial default C++ constructor

RSmsMessaging();

Description

The default C++ constructor constructs a messaging object.


General SMS messaging functions


Open() — Open SMS messaging subsession

TInt Open(RPhone& aPhone);

Description

This function opens a SMS Messaging subsession.

Arguments

RPhone& aPhone

The phone session in which the messaging subsession is opened.

Return value

TInt

An error code: see System error codes.

Note

Close() — Close SMS messaging subsession

void Close();

Description

This function closes an SMS messaging subsession.


GetCaps() — Get messaging capabilities

TInt GetCaps(TCaps& aCaps) const;

Description

This function retrieves the SMS messaging capabilities of the phone.

Arguments

TCaps& aCaps

On return, contains the phone’s messaging capabilities.

Return value

TInt

An error code: see System error codes.


Message reception functions


RegisterReadSmsMessage() — Register interest in receiving SMS messages

TInt RegisterReadSmsMessage(const TSms::TFormat aFormat,const TInt aBufferSize) const;

Description

This function causes the server to create a memory buffer to hold outstanding SMS messages, and to maintain an outstanding ReadSmsMessage() request on the TSY. Messages are placed in the buffer and the oldest one is completed when the client next calls ReadSmsMessage().

This function reduces the possibility of new messages being over-written before the client can re-post ReadSmsMessage().

Arguments

const TSms::TFormat aFormat

The format of the messages to be buffered; PDU or text.

const TInt aBufferSize

The size of the buffer that the server should create to hold SMS messages.

Return value

TInt

An error code: see System error codes.

Notes:

DeregisterReadSmsMessage() — Deregister interest in receiving SMS messages

TInt DeregisterReadSmsMessage() const;

Description

This function cancels a previously registered interest in buffering SMS messages. The buffer is destroyed — but outstanding ReadSmsMessage() requests remain outstanding.

Return value

TInt

An error code: see System error codes.


ReadSmsMessage() — Read SMS message

void ReadSmsMessage(TRequestStatus& aStatus, TMsgLocation& aMsgLocation, TSms& aMsg);

Description

This function requests notification when a new message arrives from the network, and retrieves the message information.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TMsgLocation& aMsgLocation

On request completion, contains the location of the message in the message store — if the message storage is enabled.

TSms& aMsg

On return, contains the new message.

Notes:

ReadSmsMessageCancel() — Cancel request to read SMS message

void ReadSmsMessageCancel() const;

Description

This function cancels an outstanding SMS message read request, placed using the ReadSmsMessage() function.


NotifySmsMessageArrived() — Notification of an incoming SMS message

void NotifySmsMessageArrived(TRequestStatus& aStatus) const;

Description

This function provides notification of the arrival of a new SMS message. The request completes when the new message has arrived.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

Notes:

NotifySmsMessageArrivedCancel() — Cancel notification of an incoming SMS message

void NotifySmsMessageArrivedCancel() const;

Description

This function cancels an outstanding request for notification of SMS message arrival, placed using the NotifySmsMessageArrived() function.


Service centre functions


GetDefaultSCAddress() — Get default service centre phone number — synchronous

TInt GetDefaultSCAddress(TGsmTelNumber& aSCAddress) const;

Description

This synchronous function reads the default service centre telephone number from the SIM.

Arguments

TGsmTelNumber& aSCAddress

On return, contains the default service centre number.

Return value

TInt

An error code: see System error codes.


GetDefaultSCAddress() — Get default service centre phone number — asynchronous

void GetDefaultSCAddress(TRequestStatus& aStatus, TGsmTelNumber& aSCAddress) const;

Description

This asynchronous function reads the default service centre telephone number from the SIM.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TGsmTelNumber& aSCAddress

On request completion, contains the default service centre number.


GetDefaultSCAddressCancel() — Cancel request to get default service centre phone number

void GetDefaultSCAddressCancel() const;

Description

This function cancels an outstanding request to read the default service centre number from the SIM, placed using the asynchronous variant of the GetDefaultSCAddress() function.


SetDefaultSCAddress() — Set default service centre phone number — synchronous

TInt SetDefaultSCAddress(const TGsmTelNumber& aSCAddress) const;

Description

This synchronous function sets the default service centre telephone number (in the SIM).

Arguments

const TGsmTelNumber& aSCAddress

The new default service centre telephone number.

Return value

TInt

An error code: see System error codes.


SetDefaultSCAddress() — Set default service centre phone number — asynchronous

void SetDefaultSCAddress(TRequestStatus& aStatus, const TGsmTelNumber& aSCAddress);

Description

This asynchronous function sets the default service centre telephone number (in the SIM).

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

const TGsmTelNumber& aSCAddress

The new default service centre telephone number.


SetDefaultSCAddressCancel() — Cancel request to set the default service centre phone number

void SetDefaultSCAddressCancel() const;

Description

This function cancels an outstanding request to set the default service centre number, placed using the asynchronous variant of the SetDefaultSCAddress() function.


Message transmission functions


SendMessage() — Transmit SMS message

void SendMessage(TRequestStatus& aStatus, TUint& aMsgRef, TSms& aMsg);

Description

This function sends an SMS message.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

TUint& aMsgRef

On request completion, contains an SMS message reference number assigned by the network.

TSms& aMsg

The SMS message to be sent.

Notes:

SendMessageCancel() — Cancel request to transmit SMS message

void SendMessageCancel() const;

Description

This function cancels an outstanding message transmission request, placed using the SendMessage() function.


Messaging mode functions


GetMode() — Get the messaging mode

TInt GetMode(TMode& aMode) const;

Description

This function retrieves the current messaging mode.

Arguments

TMode& aMode

On return, contains the current messaging mode.

Return value

TInt

An error code: see System error codes.


SetMode() — Set the messaging mode — synchronous

TInt SetMode(const TMode& aMode) const;

Description

This synchronous function sets the current messaging mode — PDU or Text.

Arguments

const TMode& aMode

The new messaging mode.

Return value

TInt

An error code: see System error codes.

Notes:

SetMode() — Set the messaging mode — asynchronous

void SetMode(TRequestStatus& aStatus, const TMode& aMode) const;

Description

This asynchronous function sets the current messaging mode — PDU or Text.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

const TMode& aMode

The new messaging mode.


SetModeCancel() — Cancel request to set the messaging mode

void SetModeCancel() const;

Description

This function cancels an outstanding request to set the messaging mode, placed using the asynchronous variant of the SetMode() function.


Messaging storage functions


EnumerateMessageStores() — Enumerate message stores

TInt EnumerateMessageStores(TInt& aCount) const;

Description

This function retrieves the number of message stores supported by the phone.

Arguments

TInt& aCount

On return, contains the number of message stores supported by the phone.

Return value

TInt

An error code: see System error codes.


GetMessageStoreInfo() — Get message store information — synchronous

TInt GetMessageStoreInfo(const TInt aIndex,TStoreInfo& aInfo) const;

Description

This synchronous function retrieves information about a specified message store.

Arguments

const TInt aIndex

The index of the store for which information is required. Valid values lie between 0 and (n-1), where n is given by the EnumerateMessageStores() function.

TStoreInfo& aInfo

On return, contains the message store information.

Return value

TInt

An error code: see System error codes.


GetMessageStoreInfo() — Get message store information — asynchronous

void GetMessageStoreInfo(TRequestStatus& aStatus,const TInt aIndex,TStoreInfo& aInfo) const;

Description

This asynchronous function retrieves information about a specified message store.

Arguments

TRequestStatus& aStatus

A variable that indicates the completion status of the request.

const TInt aIndex

The index of the store for which information is required. Valid values lie between 0 and (n-1), where n is given by the EnumerateMessageStores() function.

TStoreInfo& aInfo

On request completion, contains the message store information.


GetMessageStoreInfoCancel() — Cancel request to get message store information

void GetMessageStoreInfoCancel() const;

Description

This function cancels an outstanding request to get message store information, placed using the asynchronous variant of the GetMessageStoreInfo() function.


Enumerations


Anonymous enum — Messaging mode capability flags

KCapsModeCommandPduSupported

Command mode PDU messaging is supported.

KCapsModeCommandTextSupported

Command mode Text messaging is supported.

KCapsModeBlockPduSupported

Block mode PDU messaging is supported.

KCapsModeReadWithoutStorage

Read without storage is supported.

KCapsModeReadWithStorage

Read with storage is supported.


Anonymous enum — Messaging type capability flags

KCapsTypeRxSmsDeliver

SMS reception is supported.

KCapsTypeRxCellBroadcast

Cell broadcast reception is supported.

KCapsTypeRxStatusReport

Status report reception is supported.

KCapsTypeTxSmsSubmit

SMS transmission is supported.


TSmsMode enum — Messaging mode flags

EModeCommandPdu

PDU command messaging mode.

EModeCommandText

Text command messaging mode.

EModeBlockPdu

PDU block messaging mode.


TStorageMode enum — Messaging storage mode flags

EReadWithoutStorage

SMS messages are not stored in phone or SIM based storage.

EReadWithStorage

SMS messages are stored before being passed to client(s). Messages are passed with a storage reference number.


Anonymous enum — Message store information flags

KMessageStoreReadAndDeleted

Memory which supports reading and deleting messages.

KMessageStoreWriteAndSend

Memory in which messages can be written and from which operations can be sent.

KMessageStoreBroadcast

This store contains cell broadcast messages.


Struct


TCaps struct — Messaging capability information

TUint iSmsMode

Bit mask of the messaging mode capability flags — defined in the enumerations section above.

TUint iSmsMsgTypes

Bit mask of the messaging type capability flags — defined in the enumerations section above.


TMsgLocation struct — Messaging location information

TInt iIndex

The index number indicating where the SMS message is stored. If the messaging mode is “Read Without Storage” then the value is set to KErrNotFound (-1).

TName iStore

The message store name.


TMode struct — Messaging and message storage mode information

TSmsMode iMessagingMode

Selects the messaging mode.

TStorageMode iStorageMode

Selects the message storage mode.


TStoreInfo struct — Message store information

TName iName

The name of the message store. For a valid list of names see SMS Phone store types.

TUint iTotal

Indicates the total number of messages that may be stored in this store.

TUint iUsed

Indicates the current number of messages stored in this store.

TUint32 iFlags

Indicates the type of message store. Bitmask of the message store information flags — defined in the enumerations section.

EPOC       SDK Home Glossary Indexes Previous Next Up