Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: cdmasmsaddr.h

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

Enum TCdmaSmsAddrFamily

TCdmaSmsAddrFamily

Description

Sockets for CDMA SMS messages must be bound to an address. The 'address' provides a rule that tells the CDMA SMS stack which received messages should be given to the socket; see TCdmaSmsAddr for a more detailed explanation.

Each address must belong to a family. The family must be one of the values listed below.

ECdmaSmsAddrUnbound

This indicates that the address's family has not been set

ECdmaSmsAddrSendOnly

Sockets bound to a ECdmaSmsAddrSendOnly address can only be for sending CDMA SMS messages; they will not receive any messages until they are bound to a different address.

Note that a socket bound to any address family except for ECdmaSmsAddrLocalOperation can be used to send messages; not just ECdmaSmsAddrSendOnly

ECdmaSmsAddrLocalOperation

Sockets bound to a ECdmaSmsAddrLocalOperation address can only be used for local protocol operations such as enumerating, writing and deleting messages. These sockets cannot be used for sending or receiving messages until they are bound to a different address.

Any socket kind of binded address and be used for writing and deleting messages. Only LocalOperation can be used for enumerating messages.

ECdmaSmsWemtAddrMatchIEI

Sockets bound to a ECdmaSmsWemtAddrMatchIEI address will receive messages on the WEMT teleservice that have a particular Information Element Identifier (IEI).

As well as setting the address's family to ECdmaSmsWemtAddrMatchIEI, set the address's 'port'to one of the IEIs in TSmsInformationElementIdentifier; see CSmsInformationElement..

The following example binds a socket so that it will receive messages on the WEMT teleservice that have the IEI "Special SMS Message Indication":

    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsWemtAddrMatchIEI); 
    smsaddr.SetPort(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication);
    ret=socket.Bind(smsaddr);

ECdmaSmsAddrMatchText

Sockets bound to a ECdmaSmsAddrMatchText address will receive messages whose user data matches contains particular text. The messages teleservice does not matter.

As well as setting the address's family to ECdmaSmsAddrMatchText, use TCdmaSmsAddr::SetTextMatch to specify an ASCII string. This string is compared to the user data in the message. If the two match then the message is delivered to the socket. The string can contain the wildcards '?' to match one instance of any character and '*' to match any number of characters.

    // match messages that start with 12345 
    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrMatchText);
    smsaddr.SetTextMatch(_L8("12345"));
    ret=socketMatchText.Bind(smsaddr);

    // match messages that end with 12345
    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrMatchText);
    smsaddr.SetTextMatch(_L8("*12345"));
    ret=socketMatchText.Bind(smsaddr);

    // match message that contain 12345
    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrMatchText);
    smsaddr.SetTextMatch(_L8("*12345*"));
    ret=socketMatchText.Bind(smsaddr);

ECdmaSmsWemtAddrApplication8BitPort

Sockets bound to a ECdmaSmsWemtAddrApplication8BitPort address will receive messages on the WEMT teleservice that are from a particular 8 bit application port.

As well as setting the address's family to ECdmaSmsWemtAddrMatchIEI, set the address's 'port' to an 8-bit number.

The following example binds a socket so that it will receive messages on the WEMT teleservice that are on the port 83:

    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsWemtAddrApplication8BitPort);  
    smsaddr.SetPort(83);
    ret=socket.Bind(smsaddr);

ECdmaSmsWemtAddrApplication16BitPort

This is similar to ECdmaSmsWemtAddrApplication8BitPort, except that the WEMT message must be from a particular 16 bit application port. The address's port must be set to a 16-bit number. For example:

    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsWemtAddrApplication16BitPort); 
    smsaddr.SetPort(1000);
    ret=socket.Bind(smsaddr);

ECdmaSmsAddrTeleservice

Sockets bound to a ECdmaSmsAddrTeleservice address will receive messages on a particular teleservice.

As well as setting the address's family to ECdmaSmsAddrTeleservice, use TCdmaSmsAddr::SetTeleserviceId to set the required teleservice. For example, to receive messages on the WEMT teleservice:

    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrTeleservice);
    smsaddr.SetTeleserviceId(KTeleserviceWEMT);
    ret=socket.Bind(smsaddr);

ECdmaSmsAddrWdp

Sockets bound to a ECdmaSmsWemtAddrWdp address will receive messages on the WAP teleservice that are for a particular WDP port.

As well as setting the address's family to ECdmaSmsWemtAddrWdp, set the address's 'port' to a WDP port. For example:

    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrWdp);
    smsaddr.SetPort(wdpPort);
    ret=socket.Bind(smsaddr);

ECdmaSmsAddrBroadcast

Sockets bound to a ECdmaSmsAddrBroadcast address will receive broadcast messages. Note that broadcast messages cannot be received using other address family.

Broadcast messages belong to a service category. A socket can be bound so that it receives broadcast messages from a specified service category. Alternatively it can receive all broadcast messages, whatever the service category.

As well as setting the address's family to ECdmaSmsAddrBroadcast, use TCdmaSmsAddr::SetPort to set the required service category from those in tia637::TServiceCategory.

    // Receive messages from the Emergency Broadcast service catagory
    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrBroadcast);
    smsaddr.SetPort(KEmergencyBroadcasts);
    ret=broadcastSocket.Bind(smsaddr);

    // Receive messages from any service category by setting the port to zero
    smsaddr.SetCdmaSmsAddrFamily(ECdmaSmsAddrBroadcast);
    smsaddr.SetPort(0);
    ret=broadcastSocket2.Bind(smsaddr);