Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: cdmasmsaddr.h
Link against: cdmau.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class TCdmaSmsAddr

class TCdmaSmsAddr : public TSockAddr;

Description

Sockets for CDMA SMS messages must be bound to an address. A socket's address can be thought of as a rule that tells the sockets server which messages should be delivered to the socket. When the CDMA SMS stack receives a message, it compares the message to the address (or rule) of each of the CDMA SMS sockets. If the message's contents match one of the rules, the SMS stack uses Symbian OS's sockets server to pass the message to an appropriate socket.

The address is an instance of TCdmaSmsAddr. Create an instance then use its setter methods to configure up the address. Before receiving SMS messages, RSocket::Bind must be called to bind a socket to a appropriate address.

Each address must belong to a family. This broadly defines the type of rule used to match messages to socket. Set an address's family with SetCdmaSmsAddrFamily. Depending upon the family, call methods to set further address variables, thus refining the rule further. To understand address better, see the descriptions of the address families in TCdmaSmsAddrFamily.

Two sockets cannot be bound to the same address - the second attempt to bind a socket will fail.

Sometimes, a message is received matches several addresses, and so could be sent to more than one socket. The messages are compared to address in a particular order; see CdmaSmsAddressPriority below for more information.

Derivation

Members

Defined in TCdmaSmsAddr:
CdmaSmsAddrFamily(), CdmaSmsAddressPriority(), EMaxTextMatchLength, NumTextMatchChar(), SetCdmaSmsAddrFamily(), SetTextMatch(), TCdmaSmsAddr(), TextMatch(), anonymous, operator==()

Inherited from TSockAddr:
CmpPort(), Family(), GetUserLen(), Port(), SetFamily(), SetPort(), SetUserLen(), UserPtr()


Construction and destruction


TCdmaSmsAddr()

IMPORT_C TCdmaSmsAddr();

Description

Constructor

[Top]


Member functions


CdmaSmsAddrFamily()

IMPORT_C TCdmaSmsAddrFamily CdmaSmsAddrFamily() const;

Description

Return the Cdma Sms Address Family

Return value

TCdmaSmsAddrFamily

the Cdma Sms Address Family


SetCdmaSmsAddrFamily()

IMPORT_C void SetCdmaSmsAddrFamily(TCdmaSmsAddrFamily aFamily);

Description

Set the Sms Address Family

Parameters

TCdmaSmsAddrFamily aFamily

The address family to set to


TextMatch()

IMPORT_C TPtrC8 TextMatch() const;

Description

Return the text to be matched

Return value

TPtrC8

The text match pattern


SetTextMatch()

IMPORT_C void SetTextMatch(const TDesC8 &aText);

Description

Set the text to be matched

Note: if the given text is longer than EMaxTextMatchLength, the text pattern will be trancated to a similar text pattern. TextMatch() will return the pattern that is actually set into the address.

Parameters

const TDesC8 &aText

The text match pattern


NumTextMatchChar()

IMPORT_C TInt NumTextMatchChar() const;

Description

Return the number of character in the text match, excluding wildcard characters * and ? Wildcard character "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Return value

TInt

the number of character in the text match


operator==()

IMPORT_C TBool operator==(const TCdmaSmsAddr &aAddr) const;

Description

Equality operator

Parameters

const TCdmaSmsAddr &aAddr

The address to compare against

Return value

TBool

ETrue if the addresses match


CdmaSmsAddressPriority()

IMPORT_C TInt CdmaSmsAddressPriority() const;

Description

Method that returns the priority of a given CDMA SMS address.

Addresses have a priority, and so the sockets that are bound to these addresses have a priority. Priority is based on address family. This is the order, starting with the highest:

    ECdmaSmsAddrWdp
    ECdmaSmsWemtAddrApplication8BitPort
    ECdmaSmsWemtAddrApplication16BitPort
    ECdmaSmsWemtAddrMatchIEI
    ECdmaSmsAddrBroadcast
    ECdmaSmsAddrMatchText for prefix match (i.e., no '*' or only one '*' at the end, and any number of '?')
    ECdmaSmsAddrMatchText for wildcard match (i.e., has a '*' that is not only at the end of the pattern)
    ECdmaSmsAddrTeleservice
    ECdmaSmsAddrSendOnly
    ECdmaSmsAddrLocalOperation
    ECdmaSmsAddrUnbound

For example, suppose a broadcast message is received containing the text "Hello". One socket might be waiting for messages containing "Hello" (i.e. bound to a ECdmaSmsAddrMatchText address) and another might be waiting for all boardcast messages (i.e. bound to a ECdmaSmsAddrBroadcast address). ECdmaSmsAddrBroadcast is a higher priority than ECdmaSmsAddrMatchText, so the message will be given to the ECdmaSmsAddrBroadcast socket.

Return value

TInt

Returns priority or KErrNotFound if address has an unknown address type, with 1 being the lowest.

[Top]


Member enumerations


Enum anonymous

n/a

Description

Maximum length of the text pattern used to match the incoming text.

EMaxTextMatchLength