CUpnpDispatcher Class Reference

class CUpnpDispatcher : public CBase

This class represents a logical unit between UPnP devices / control points and Message Handler. Message Handler is a Symbian Server - thus, dispatcher follows the same client/server framework and is a client that opens a session to Message Handler. This is not done by class CUpnpDispatcher ; the class RUpnpDispatcherSession represents the client interface.

Using AddCustomer/RemoveCustomer functions it is possible to set the active services. Dispatcher is able to forward messages to its customers.

Also SendMessage function is very essential part of the dispatcher.

Inherits from

Public Member Functions
~CUpnpDispatcher ()
IMPORT_C void AddCustomer (const MUpnpDispatcherCustomer &)
IMPORT_C void AddCustomerL (const MUpnpDispatcherCustomer &, TBool )
IMPORT_C void AddLocalDeviceL (const TDesC8 &, const TDesC8 &, const TDesC8 &, const CDesC8Array &, const TBool )
void DeviceListReceivedL ( TInt )
IMPORT_C TInetAddr HttpServerAddress ()
const HBufC8 * MacAddressL ()
IMPORT_C CUpnpDispatcher * NewL ( MUpnpDiscoveryObserver *)
IMPORT_C CUpnpDispatcher * NewLC ( MUpnpDiscoveryObserver *)
IMPORT_C void RemoveCustomer (const MUpnpDispatcherCustomer &)
IMPORT_C void RemoveCustomer (const MUpnpDispatcherCustomer &, TBool )
void RemoveLocalDeviceL (const TDesC8 &, TBool )
IMPORT_C void SearchL (const TDesC8 &)
IMPORT_C void SearchL (const TDesC16 &)
IMPORT_C void SendMessageL (CUpnpHttpMessage *, MUpnpDispatcherCustomer &, TBool )
void SetTransactionCreator (MUpnpHttpServerTransactionCreator *)
IMPORT_C void StartHttpServerL ( TBool , const TInt )
IMPORT_C void StartIPFilteringL ()
IMPORT_C void StopFilteringL (const TDesC8 &)
IMPORT_C void StopHttpServer ()
IMPORT_C void StopIPFiltering ()
IMPORT_C void UpdateDevicesL ( TInt )
Private Member Functions
CUpnpDispatcher ( MUpnpDiscoveryObserver *)
void ConstructL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enum TState { EReceiving , ESending }
Private Attributes
CUpnpDispatcherEngine * iEngine
MUpnpDiscoveryObserver * iParent
TInt iUpdateId

Constructor & Destructor Documentation

CUpnpDispatcher(MUpnpDiscoveryObserver *)

CUpnpDispatcher ( MUpnpDiscoveryObserver * aParent ) [private]

CUpnpDispatcher

Perform the first phase of two phase construction

Parameters

MUpnpDiscoveryObserver * aParent

~CUpnpDispatcher()

IMPORT_C ~CUpnpDispatcher ( ) [virtual]

Destroy the object and release all memory objects

Member Functions Documentation

AddCustomer(const MUpnpDispatcherCustomer &)

IMPORT_C void AddCustomer ( const MUpnpDispatcherCustomer & aCustomer )

Add a customer to the customer list of this dispatcher. In practice, means that messages start being forwarded to that customer.

Parameters

const MUpnpDispatcherCustomer & aCustomer The customer to be added.

AddCustomerL(const MUpnpDispatcherCustomer &, TBool)

IMPORT_C void AddCustomerL ( const MUpnpDispatcherCustomer & aCustomer,
TBool aIsCP
)

Add a customer to the customer list of this dispatcher. In practice, means that messages start being forwarded to that customer.

Parameters

const MUpnpDispatcherCustomer & aCustomer The customer to be added.
TBool aIsCP The customer is control point.

AddLocalDeviceL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const CDesC8Array &, const TBool)

IMPORT_C void AddLocalDeviceL ( const TDesC8 & aUuid,
const TDesC8 & aDeviceType,
const TDesC8 & aDescriptionPath,
const CDesC8Array & aServices,
const TBool aIsRootDevice
)

Adds a local device to Message Handler's device library.

Parameters

const TDesC8 & aUuid UUID of the device.
const TDesC8 & aDeviceType Device type of the device (e.g MediaServer:1)
const TDesC8 & aDescriptionPath URL to device description.
const CDesC8Array & aServices List of services this device provides.
const TBool aIsRootDevice ETrue, if this device is UPnP root device, \ EFalse otherwise.

ConstructL()

void ConstructL ( ) [private]

ConstructL

Perform the second phase construction of a CUpnpDispatcher object

DeviceListReceivedL(TInt)

void DeviceListReceivedL ( TInt aUpdateId ) [virtual]

Parameters

TInt aUpdateId

HttpServerAddress()

IMPORT_C TInetAddr HttpServerAddress ( )

Returns HTTP server address.

MacAddressL()

const HBufC8 * MacAddressL ( )

Returns an active interface's Hardware (MAC) address.

NewL(MUpnpDiscoveryObserver *)

IMPORT_C CUpnpDispatcher * NewL ( MUpnpDiscoveryObserver * aParent ) [static]

Create a CUpnpDispatcher object using two phase construction, and return a pointer to the created object.

A session with Message Handler is initiated during the construction.

Parameters

MUpnpDiscoveryObserver * aParent

NewLC(MUpnpDiscoveryObserver *)

IMPORT_C CUpnpDispatcher * NewLC ( MUpnpDiscoveryObserver * aParent ) [static]

Create a CUpnpDispatcher object using two phase construction, and return a pointer to the created object

A session with Message Handler is initiated during the construction.

Parameters

MUpnpDiscoveryObserver * aParent the object to be used to handle updates from the server

RemoveCustomer(const MUpnpDispatcherCustomer &)

IMPORT_C void RemoveCustomer ( const MUpnpDispatcherCustomer & aCustomer )

Remove a customer from the customer list of this dispatcher. In practice, means that messages stop being forwarded to that customer.

Parameters

const MUpnpDispatcherCustomer & aCustomer The customer to be removed.

RemoveCustomer(const MUpnpDispatcherCustomer &, TBool)

IMPORT_C void RemoveCustomer ( const MUpnpDispatcherCustomer & aCustomer,
TBool aIsCP
)

Remove a customer from the customer list of this dispatcher. In practice, means that messages stop being forwarded to that customer.

Parameters

const MUpnpDispatcherCustomer & aCustomer The customer to be removed.
TBool aIsCP The customer is control point.

RemoveLocalDeviceL(const TDesC8 &, TBool)

void RemoveLocalDeviceL ( const TDesC8 & aUuid,
TBool aSilent
)

Removes a local device from Message Handler's device library.

Parameters

const TDesC8 & aUuid UUID of the device that is to be removed.
TBool aSilent

SearchL(const TDesC8 &)

IMPORT_C void SearchL ( const TDesC8 & aSearchString )

Sends a SSDP Search with 8-bit searchString.

Parameters

const TDesC8 & aSearchString String to use in SSDP ST -header.

SearchL(const TDesC16 &)

IMPORT_C void SearchL ( const TDesC16 & aSearchString )

Sends a SSDP Search with 16-bit searchString. This method makes a conversion to 8-bit and then makes the search

Parameters

const TDesC16 & aSearchString Stfing to use in SSDP ST -header.

SendMessageL(CUpnpHttpMessage *, MUpnpDispatcherCustomer &, TBool)

IMPORT_C void SendMessageL ( CUpnpHttpMessage * aMessage,
MUpnpDispatcherCustomer & aCustomer,
TBool aIsLocal = EFalse
)

Send a message. This function pushes the message to the Message Handler.

Parameters

CUpnpHttpMessage * aMessage The message to be sent.
MUpnpDispatcherCustomer & aCustomer
TBool aIsLocal = EFalse ETrue if is local device, else EFalse if device is local, then action will be send without network layeraMessage has to be EAction type.

SetTransactionCreator(MUpnpHttpServerTransactionCreator *)

void SetTransactionCreator ( MUpnpHttpServerTransactionCreator * aTransactionCreator )
Sets handle to transaction creator interface.
Since
Series60 5.0

Parameters

MUpnpHttpServerTransactionCreator * aTransactionCreator pointer to object implementing MUpnpHttpServerTransactionCreator interface.

StartHttpServerL(TBool, const TInt)

IMPORT_C void StartHttpServerL ( TBool aRegister,
const TInt aPort
)

Starts http server

Parameters

TBool aRegister determines if starting error in message handler process will be checked
const TInt aPort starts server on fixed port

StartIPFilteringL()

IMPORT_C void StartIPFilteringL ( )

StopFilteringL(const TDesC8 &)

IMPORT_C void StopFilteringL ( const TDesC8 & aUuids )

Sends a stop filtering request. Device notification will not be stoped in ssdp.

Parameters

const TDesC8 & aUuids UUids.

StopHttpServer()

IMPORT_C void StopHttpServer ( )

Stops http server

StopIPFiltering()

IMPORT_C void StopIPFiltering ( )

UpdateDevicesL(TInt)

IMPORT_C void UpdateDevicesL ( TInt aNewId )

Informs upper layers about newly found devices.

Parameters

TInt aNewId New update id that needs to be stored.

Member Enumerations Documentation

Enum TState

Enumerators

EReceiving
ESending

Member Data Documentation

CUpnpDispatcherEngine * iEngine

CUpnpDispatcherEngine * iEngine [private]

MUpnpDiscoveryObserver * iParent

MUpnpDiscoveryObserver * iParent [private]

TInt iUpdateId

TInt iUpdateId [private]