RUpnpMediaServerClient Class Reference

class RUpnpMediaServerClient : public RUpnpSessionBase

This class provides the client-side interface to the media server session

Inherits from

Public Member Functions
RUpnpMediaServerClient ()
IMPORT_C void AddIcon ( CUpnpIcon *, TRequestStatus &)
void CancelStatusChangeNotify ()
IMPORT_C void Close ()
IMPORT_C TInt Connect ()
IMPORT_C TInt GetAddress ( TInetAddr &)
IMPORT_C void GetAddressL ( TInetAddr &, TRequestStatus &)
void GetSharedContainer ( TInt , TDes8 &, TRequestStatus &)
void GetSharedContainerList ( TInt , TDes8 &, TDes8 &, TRequestStatus &)
void GetSharedContainerListResult ( TDes8 &, TDes8 &, TRequestStatus &)
void GetSharedContainerResult ( TDes8 &, TRequestStatus &)
void GetSharedItem ( TInt , TDes8 &, TRequestStatus &)
void GetSharedItemList ( TInt , TDes8 &, TDes8 &, TRequestStatus &)
void GetSharedItemListResult ( TDes8 &, TDes8 &, TRequestStatus &)
void GetSharedItemResult ( TDes8 &, TRequestStatus &)
void GetTransferEventBody ( TDes8 &, TRequestStatus &)
void ListenTransferEvent ( TDes8 &, TRequestStatus &)
IMPORT_C void RemoveIcon ( TDes8 &, TRequestStatus &)
IMPORT_C void RemoveIcons ( TRequestStatus &)
IMPORT_C TInt Restart ()
IMPORT_C void SetUploadDirectoryL (const TDesC &, TRequestStatus &)
void ShareContainer ( TDes8 &, TDes8 &, TRequestStatus &)
void ShareContainerResult ( TDes8 &, TRequestStatus &)
void ShareItem ( TDes8 &, TDes8 &, TRequestStatus &)
void ShareItemList ( TDes8 &, TDes8 &, TRequestStatus &)
void ShareItemListResult ( TDes8 &, TDes8 &, TRequestStatus &)
void ShareItemResult ( TDes8 &, TRequestStatus &)
void ShareReference ( TDes8 &, TDes8 &, TRequestStatus &)
void ShareReferenceList ( TDes8 &, TDes8 &, TRequestStatus &)
IMPORT_C TInt Start ()
IMPORT_C void Start ( TRequestStatus &)
IMPORT_C TInt StartOffline ()
IMPORT_C TInt Status ( TInt &)
void StatusChangeNotify ( TRequestStatus &)
IMPORT_C TInt Stop ( TServerStopMode )
IMPORT_C TInt Stop ()
void SubscribeEvents ( TRequestStatus &)
void UnshareContainer ( TInt , TRequestStatus &)
void UnshareItem ( TInt , TRequestStatus &)
void UnshareItemListL ( TDes8 &, TDes8 &, TRequestStatus &)
void UnshareRoot ( TRequestStatus &)
void UnsubscribeEvents ()
IMPORT_C void UpdateIcon ( TDes8 &, CUpnpIcon *, TRequestStatus &)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
RUpnpSessionBase::Connect(const TDesC &,TVersion,TInt,TInt,const TDesC &,TUid)
Public Member Enumerations
enum TServerStatus { EStartedOnline , EStartedOffline , EStopped }
enum TServerStopMode { EStopNormal , EStopSilent }
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TPckg < TInetAddr > * iAddressPkg
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RUpnpMediaServerClient()

IMPORT_C RUpnpMediaServerClient ( )

Constructs the object

Member Functions Documentation

AddIcon(CUpnpIcon *, TRequestStatus &)

IMPORT_C void AddIcon ( CUpnpIcon * aIcon,
TRequestStatus & aStatus
)
Adds new icon to Media Server. Media Server performs the following operations:
  • copies file from path specified aIcon object to its private directory,

  • adds icon element to its device description XML file

Parameters

CUpnpIcon * aIcon icon
TRequestStatus & aStatus request status

CancelStatusChangeNotify()

void CancelStatusChangeNotify ( )

Cancel notifycation about media server operational status

Close()

IMPORT_C void Close ( )

Connect()

IMPORT_C TInt Connect ( )

RMediaServerClient checks if Media Server Engine exists. If not creates new process. During Media Server Engine process initialization the CUpnpMediaServer class is instantiated. When Media Server Engine is created RMediaServerClient creates session to it. Each time session is created the session counter is incremented. Note: During a first start the private directory structure is created and device/service description files are copied there from Z: drive.

GetAddress(TInetAddr &)

IMPORT_C TInt GetAddress ( TInetAddr & aAddr )

Gets media server inet address

Parameters

TInetAddr & aAddr

GetAddressL(TInetAddr &, TRequestStatus &)

IMPORT_C void GetAddressL ( TInetAddr & aAddr,
TRequestStatus & aStatus
)

Gets media server inet address asynchronously

Parameters

TInetAddr & aAddr
TRequestStatus & aStatus

GetSharedContainer(TInt, TDes8 &, TRequestStatus &)

void GetSharedContainer ( TInt aContainerId,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Gets shared container

Parameters

TInt aContainerId
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

GetSharedContainerList(TInt, TDes8 &, TDes8 &, TRequestStatus &)

void GetSharedContainerList ( TInt aContainerId,
TDes8 & aSend,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Gets shared container list

Parameters

TInt aContainerId
TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

GetSharedContainerListResult(TDes8 &, TDes8 &, TRequestStatus &)

void GetSharedContainerListResult ( TDes8 & aResult,
TDes8 & aTotalMatches,
TRequestStatus & aStatus
)

Gets shared container list results

Parameters

TDes8 & aResult buffer for result
TDes8 & aTotalMatches
TRequestStatus & aStatus request status

GetSharedContainerResult(TDes8 &, TRequestStatus &)

void GetSharedContainerResult ( TDes8 & aResult,
TRequestStatus & aStatus
)

Gets shared container result

Parameters

TDes8 & aResult buffer for result
TRequestStatus & aStatus request status

GetSharedItem(TInt, TDes8 &, TRequestStatus &)

void GetSharedItem ( TInt aItemId,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Gets shared item

Parameters

TInt aItemId
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

GetSharedItemList(TInt, TDes8 &, TDes8 &, TRequestStatus &)

void GetSharedItemList ( TInt aContainerId,
TDes8 & aSend,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Gets shared item list

Parameters

TInt aContainerId
TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

GetSharedItemListResult(TDes8 &, TDes8 &, TRequestStatus &)

void GetSharedItemListResult ( TDes8 & aResult,
TDes8 & aTotalMatches,
TRequestStatus & aStatus
)

Gets shared item list result

Parameters

TDes8 & aResult buffer for result
TDes8 & aTotalMatches
TRequestStatus & aStatus request status

GetSharedItemResult(TDes8 &, TRequestStatus &)

void GetSharedItemResult ( TDes8 & aResult,
TRequestStatus & aStatus
)

Gets shared item result

Parameters

TDes8 & aResult buffer for result
TRequestStatus & aStatus request status

GetTransferEventBody(TDes8 &, TRequestStatus &)

void GetTransferEventBody ( TDes8 & aResult,
TRequestStatus & aStatus
)

Requests single events list body

Parameters

TDes8 & aResult buffer for events list
TRequestStatus & aStatus request status

ListenTransferEvent(TDes8 &, TRequestStatus &)

void ListenTransferEvent ( TDes8 & aEventSize,
TRequestStatus & aStatus
)

Requests single events list

Parameters

TDes8 & aEventSize size of buffer for events list to be allocated by client
TRequestStatus & aStatus request status

RemoveIcon(TDes8 &, TRequestStatus &)

IMPORT_C void RemoveIcon ( TDes8 & aUrl,
TRequestStatus & aStatus
)
Removes icon of given url. Media Server performs the following operations:
  • deletes its private copy of icon file,

  • deletes respective icon element from description XML flie Usage example:

iIcon = CUpnpIcon::NewL(aPath, aWidth, aHeight, aDepth, aMimeType); iDevice.SetIcon( iIcon );

Parameters

TDes8 & aUrl icon url from XML description
TRequestStatus & aStatus

RemoveIcons(TRequestStatus &)

IMPORT_C void RemoveIcons ( TRequestStatus & aStatus )
Removes all icons Media Server performs the following operations:
  • deletes all private copies of icon files,

  • deletes all icon elements from description XML flie

Parameters

TRequestStatus & aStatus

Restart()

IMPORT_C TInt Restart ( )

This operation performs restart on CUpnpDevice only. This causes sending "bye-bye" and "alive" notification to the network. In order to activate changes in Central Repository use Stop() /Start() sequence.

SetUploadDirectoryL(const TDesC &, TRequestStatus &)

IMPORT_C void SetUploadDirectoryL ( const TDesC & aPath,
TRequestStatus & aStatus
)

Method performs 2 steps: 1. Changes Central Repository KUpnpMediaServerUploadDirectory key value, 2. Forces Media Server to switch to new upload directory.

Note: In case of Media Server is not started request status is set to KErrNotReady, but Central Repository key is changed. During starting Media Server is initiated with new value. First param aPath should end with double backslash ('\'). for example default value equals c:\Download\Media\

Parameters

const TDesC & aPath upload directory path
TRequestStatus & aStatus request status

ShareContainer(TDes8 &, TDes8 &, TRequestStatus &)

void ShareContainer ( TDes8 & aSend,
TDes8 & aRcvd,
TRequestStatus & aStatus
)

Shares container

Parameters

TDes8 & aSend
TDes8 & aRcvd
TRequestStatus & aStatus request status

ShareContainerResult(TDes8 &, TRequestStatus &)

void ShareContainerResult ( TDes8 & aResult,
TRequestStatus & aStatus
)

Gets share container result

Parameters

TDes8 & aResult buffer for result
TRequestStatus & aStatus request status

ShareItem(TDes8 &, TDes8 &, TRequestStatus &)

void ShareItem ( TDes8 & aSend,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Shares item

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

ShareItemList(TDes8 &, TDes8 &, TRequestStatus &)

void ShareItemList ( TDes8 & aSend,
TDes8 & aRcvd,
TRequestStatus & aStatus
)

Shares item list

Parameters

TDes8 & aSend
TDes8 & aRcvd
TRequestStatus & aStatus request status

ShareItemListResult(TDes8 &, TDes8 &, TRequestStatus &)

void ShareItemListResult ( TDes8 & aResult,
TDes8 & aExecStatus,
TRequestStatus & aStatus
)

Gets share item result

Parameters

TDes8 & aResult buffer for result
TDes8 & aExecStatus
TRequestStatus & aStatus request status

ShareItemResult(TDes8 &, TRequestStatus &)

void ShareItemResult ( TDes8 & aResult,
TRequestStatus & aStatus
)

Gets share item result

Parameters

TDes8 & aResult buffer for result
TRequestStatus & aStatus request status

ShareReference(TDes8 &, TDes8 &, TRequestStatus &)

void ShareReference ( TDes8 & aSend,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Creates a single reference upon given object

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

ShareReferenceList(TDes8 &, TDes8 &, TRequestStatus &)

void ShareReferenceList ( TDes8 & aSend,
TDes8 & aRcvdBufSize,
TRequestStatus & aStatus
)

Creates some reference items, located at specific container, pointing specific objects

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatus request status

Start()

IMPORT_C TInt Start ( )
Starts media server - UPnP device. Sets device description values accoriding to Content Directory settings. After that instantiates services needed for Media Server operation:
  • Content Directory Service

  • Connection Manager Service Finally sets internal status variable to true (that means server is up and running).

Panic occurs if session is not connected. Returns one of the system-wide error codes in case of wrong Central Repository settings:
  • KUPnPStackIapId

  • KUpnpMediaServerMediaTypes

KErrNotFound if following Central Repository settings has empty values.
  • KUpnpMediaServerFriendlyName

  • KUpnpMediaServerManufacturer

  • KUpnpMediaServerModelName

Start(TRequestStatus &)

IMPORT_C void Start ( TRequestStatus & aStatus )

Starts media server (asynchonous version) See Start() description for details

Parameters

TRequestStatus & aStatus

StartOffline()

IMPORT_C TInt StartOffline ( )

Starts media server in offline mode, Media Server is not visible in UPnP network It instantiate only Content Directory without Upnp framework. This mode is used for local sharing purpose.

Status(TInt &)

IMPORT_C TInt Status ( TInt & aStat )

Gets media server operational status

Parameters

TInt & aStat

StatusChangeNotify(TRequestStatus &)

void StatusChangeNotify ( TRequestStatus & aStatus )

Notify about media server operational status

Parameters

TRequestStatus & aStatus request status

Stop(TServerStopMode)

IMPORT_C TInt Stop ( TServerStopMode aMode )

Stops the media server. This operation is complementary to Start operation. It destroys all services and device itself. The Media Server process is not terminated, it goes to a idle state.

Note: Process is terminated when last session is disconnected and media Server Engine is stopped. To disconnect session use: RMediaServerClient::Close() which is inherited from RSessionBase();

Parameters

TServerStopMode aMode one of the following modes:EStopNormal - ssdp:bye-bye messages are sent before stop (the same as stop)EStopSilent - server is stopped silently without ssdp:bye-bye messages

Stop()

IMPORT_C TInt Stop ( )

Stops media server. It equals to the Stop( EStopNormal ).

SubscribeEvents(TRequestStatus &)

void SubscribeEvents ( TRequestStatus & aStatus )

Subscribe Media Server events

Parameters

TRequestStatus & aStatus request status

UnshareContainer(TInt, TRequestStatus &)

void UnshareContainer ( TInt aItemId,
TRequestStatus & aStatus
)

Unshares container

Parameters

TInt aItemId
TRequestStatus & aStatus request status

UnshareItem(TInt, TRequestStatus &)

void UnshareItem ( TInt aItemId,
TRequestStatus & aStatus
)

Unshares item

Parameters

TInt aItemId
TRequestStatus & aStatus request status

UnshareItemListL(TDes8 &, TDes8 &, TRequestStatus &)

void UnshareItemListL ( TDes8 & aSend,
TDes8 & aExecStatus,
TRequestStatus & aStatus
)

Unshares item list

Parameters

TDes8 & aSend
TDes8 & aExecStatus
TRequestStatus & aStatus request status

UnshareRoot(TRequestStatus &)

void UnshareRoot ( TRequestStatus & aStatus )

Unshares root

Parameters

TRequestStatus & aStatus request status

UnsubscribeEvents()

void UnsubscribeEvents ( )

Unsubscribe Media Server events

UpdateIcon(TDes8 &, CUpnpIcon *, TRequestStatus &)

IMPORT_C void UpdateIcon ( TDes8 & aUrl,
CUpnpIcon * aIcon,
TRequestStatus & aStatus
)
Updates icon of given url. Media Server performs the following operations:
  • replaces its private copy of icon file,

  • replaces respective icon element from description XML flie url value remains unchanged

Parameters

TDes8 & aUrl icon url from XML description
CUpnpIcon * aIcon icon
TRequestStatus & aStatus

Member Enumerations Documentation

Enum TServerStatus

Enumerators

EStartedOnline
EStartedOffline
EStopped

Enum TServerStopMode

Enumerators

EStopNormal
EStopSilent

Member Data Documentation

TPckg< TInetAddr > * iAddressPkg

TPckg < TInetAddr > * iAddressPkg [private]