Location:
cdmasmsaddr.h
Link against: cdmau.lib
class TCdmaSmsAddr : public TSockAddr;
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.
TBuf8< KMaxSockAddrSize >
- No description.
TSockAddr
- Represents an end point address
TCdmaSmsAddr
- Sockets for CDMA SMS messages must be bound to an address
Defined in TCdmaSmsAddr
:
CdmaSmsAddrFamily()
, CdmaSmsAddressPriority()
, EMaxTextMatchLength
, NumTextMatchChar()
, SetCdmaSmsAddrFamily()
, SetTextMatch()
, TCdmaSmsAddr()
, TextMatch()
, anonymous
, operator==()
Inherited from TSockAddr
:
CmpPort()
,
Family()
,
GetUserLen()
,
Port()
,
SetFamily()
,
SetPort()
,
SetUserLen()
,
UserPtr()
IMPORT_C TCdmaSmsAddrFamily CdmaSmsAddrFamily() const;
Return the Cdma Sms Address Family
|
IMPORT_C void SetCdmaSmsAddrFamily(TCdmaSmsAddrFamily aFamily);
Set the Sms Address Family
|
IMPORT_C TPtrC8 TextMatch() const;
Return the text to be matched
|
IMPORT_C void SetTextMatch(const TDesC8 &aText);
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.
|
IMPORT_C TInt NumTextMatchChar() const;
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.
|
IMPORT_C TBool operator==(const TCdmaSmsAddr &aAddr) const;
Equality operator
|
|
IMPORT_C TInt CdmaSmsAddressPriority() const;
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.
|
n/a
Maximum length of the text pattern used to match the incoming text.
|