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 voidAddIcon(CUpnpIcon *, TRequestStatus &)
voidCancelStatusChangeNotify()
IMPORT_C voidClose()
IMPORT_C TIntConnect()
IMPORT_C TIntGetAddress(TInetAddr &)
IMPORT_C voidGetAddressL(TInetAddr &, TRequestStatus &)
voidGetSharedContainer(TInt, TDes8 &, TRequestStatus &)
voidGetSharedContainerList(TInt, TDes8 &, TDes8 &, TRequestStatus &)
voidGetSharedContainerListResult(TDes8 &, TDes8 &, TRequestStatus &)
voidGetSharedContainerResult(TDes8 &, TRequestStatus &)
voidGetSharedItem(TInt, TDes8 &, TRequestStatus &)
voidGetSharedItemList(TInt, TDes8 &, TDes8 &, TRequestStatus &)
voidGetSharedItemListResult(TDes8 &, TDes8 &, TRequestStatus &)
voidGetSharedItemResult(TDes8 &, TRequestStatus &)
voidGetTransferEventBody(TDes8 &, TRequestStatus &)
voidListenTransferEvent(TDes8 &, TRequestStatus &)
IMPORT_C voidRemoveIcon(TDes8 &, TRequestStatus &)
IMPORT_C voidRemoveIcons(TRequestStatus &)
IMPORT_C TIntRestart()
IMPORT_C voidSetUploadDirectoryL(const TDesC &, TRequestStatus &)
voidShareContainer(TDes8 &, TDes8 &, TRequestStatus &)
voidShareContainerResult(TDes8 &, TRequestStatus &)
voidShareItem(TDes8 &, TDes8 &, TRequestStatus &)
voidShareItemList(TDes8 &, TDes8 &, TRequestStatus &)
voidShareItemListResult(TDes8 &, TDes8 &, TRequestStatus &)
voidShareItemResult(TDes8 &, TRequestStatus &)
voidShareReference(TDes8 &, TDes8 &, TRequestStatus &)
voidShareReferenceList(TDes8 &, TDes8 &, TRequestStatus &)
IMPORT_C TIntStart()
IMPORT_C voidStart(TRequestStatus &)
IMPORT_C TIntStartOffline()
IMPORT_C TIntStatus(TInt &)
voidStatusChangeNotify(TRequestStatus &)
IMPORT_C TIntStop(TServerStopMode)
IMPORT_C TIntStop()
voidSubscribeEvents(TRequestStatus &)
voidUnshareContainer(TInt, TRequestStatus &)
voidUnshareItem(TInt, TRequestStatus &)
voidUnshareItemListL(TDes8 &, TDes8 &, TRequestStatus &)
voidUnshareRoot(TRequestStatus &)
voidUnsubscribeEvents()
IMPORT_C voidUpdateIcon(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
enumTServerStatus { EStartedOnline, EStartedOffline, EStopped }
enumTServerStopMode { EStopNormal, EStopSilent }
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TPckg< TInetAddr > *iAddressPkg
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RUpnpMediaServerClient()

IMPORT_CRUpnpMediaServerClient()

Constructs the object

Member Functions Documentation

AddIcon(CUpnpIcon *, TRequestStatus &)

IMPORT_C voidAddIcon(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 * aIconicon
TRequestStatus & aStatusrequest status

CancelStatusChangeNotify()

voidCancelStatusChangeNotify()

Cancel notifycation about media server operational status

Close()

IMPORT_C voidClose()

Connect()

IMPORT_C TIntConnect()

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 TIntGetAddress(TInetAddr &aAddr)

Gets media server inet address

Parameters

TInetAddr & aAddr

GetAddressL(TInetAddr &, TRequestStatus &)

IMPORT_C voidGetAddressL(TInetAddr &aAddr,
TRequestStatus &aStatus
)

Gets media server inet address asynchronously

Parameters

TInetAddr & aAddr
TRequestStatus & aStatus

GetSharedContainer(TInt, TDes8 &, TRequestStatus &)

voidGetSharedContainer(TIntaContainerId,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Gets shared container

Parameters

TInt aContainerId
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

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

voidGetSharedContainerList(TIntaContainerId,
TDes8 &aSend,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Gets shared container list

Parameters

TInt aContainerId
TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

GetSharedContainerListResult(TDes8 &, TDes8 &, TRequestStatus &)

voidGetSharedContainerListResult(TDes8 &aResult,
TDes8 &aTotalMatches,
TRequestStatus &aStatus
)

Gets shared container list results

Parameters

TDes8 & aResultbuffer for result
TDes8 & aTotalMatches
TRequestStatus & aStatusrequest status

GetSharedContainerResult(TDes8 &, TRequestStatus &)

voidGetSharedContainerResult(TDes8 &aResult,
TRequestStatus &aStatus
)

Gets shared container result

Parameters

TDes8 & aResultbuffer for result
TRequestStatus & aStatusrequest status

GetSharedItem(TInt, TDes8 &, TRequestStatus &)

voidGetSharedItem(TIntaItemId,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Gets shared item

Parameters

TInt aItemId
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

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

voidGetSharedItemList(TIntaContainerId,
TDes8 &aSend,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Gets shared item list

Parameters

TInt aContainerId
TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

GetSharedItemListResult(TDes8 &, TDes8 &, TRequestStatus &)

voidGetSharedItemListResult(TDes8 &aResult,
TDes8 &aTotalMatches,
TRequestStatus &aStatus
)

Gets shared item list result

Parameters

TDes8 & aResultbuffer for result
TDes8 & aTotalMatches
TRequestStatus & aStatusrequest status

GetSharedItemResult(TDes8 &, TRequestStatus &)

voidGetSharedItemResult(TDes8 &aResult,
TRequestStatus &aStatus
)

Gets shared item result

Parameters

TDes8 & aResultbuffer for result
TRequestStatus & aStatusrequest status

GetTransferEventBody(TDes8 &, TRequestStatus &)

voidGetTransferEventBody(TDes8 &aResult,
TRequestStatus &aStatus
)

Requests single events list body

Parameters

TDes8 & aResultbuffer for events list
TRequestStatus & aStatusrequest status

ListenTransferEvent(TDes8 &, TRequestStatus &)

voidListenTransferEvent(TDes8 &aEventSize,
TRequestStatus &aStatus
)

Requests single events list

Parameters

TDes8 & aEventSizesize of buffer for events list to be allocated by client
TRequestStatus & aStatusrequest status

RemoveIcon(TDes8 &, TRequestStatus &)

IMPORT_C voidRemoveIcon(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 & aUrlicon url from XML description
TRequestStatus & aStatus

RemoveIcons(TRequestStatus &)

IMPORT_C voidRemoveIcons(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 TIntRestart()

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 voidSetUploadDirectoryL(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 & aPathupload directory path
TRequestStatus & aStatusrequest status

ShareContainer(TDes8 &, TDes8 &, TRequestStatus &)

voidShareContainer(TDes8 &aSend,
TDes8 &aRcvd,
TRequestStatus &aStatus
)

Shares container

Parameters

TDes8 & aSend
TDes8 & aRcvd
TRequestStatus & aStatusrequest status

ShareContainerResult(TDes8 &, TRequestStatus &)

voidShareContainerResult(TDes8 &aResult,
TRequestStatus &aStatus
)

Gets share container result

Parameters

TDes8 & aResultbuffer for result
TRequestStatus & aStatusrequest status

ShareItem(TDes8 &, TDes8 &, TRequestStatus &)

voidShareItem(TDes8 &aSend,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Shares item

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

ShareItemList(TDes8 &, TDes8 &, TRequestStatus &)

voidShareItemList(TDes8 &aSend,
TDes8 &aRcvd,
TRequestStatus &aStatus
)

Shares item list

Parameters

TDes8 & aSend
TDes8 & aRcvd
TRequestStatus & aStatusrequest status

ShareItemListResult(TDes8 &, TDes8 &, TRequestStatus &)

voidShareItemListResult(TDes8 &aResult,
TDes8 &aExecStatus,
TRequestStatus &aStatus
)

Gets share item result

Parameters

TDes8 & aResultbuffer for result
TDes8 & aExecStatus
TRequestStatus & aStatusrequest status

ShareItemResult(TDes8 &, TRequestStatus &)

voidShareItemResult(TDes8 &aResult,
TRequestStatus &aStatus
)

Gets share item result

Parameters

TDes8 & aResultbuffer for result
TRequestStatus & aStatusrequest status

ShareReference(TDes8 &, TDes8 &, TRequestStatus &)

voidShareReference(TDes8 &aSend,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

Creates a single reference upon given object

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

ShareReferenceList(TDes8 &, TDes8 &, TRequestStatus &)

voidShareReferenceList(TDes8 &aSend,
TDes8 &aRcvdBufSize,
TRequestStatus &aStatus
)

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

Parameters

TDes8 & aSend
TDes8 & aRcvdBufSize
TRequestStatus & aStatusrequest status

Start()

IMPORT_C TIntStart()
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 voidStart(TRequestStatus &aStatus)

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

Parameters

TRequestStatus & aStatus

StartOffline()

IMPORT_C TIntStartOffline()

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 TIntStatus(TInt &aStat)

Gets media server operational status

Parameters

TInt & aStat

StatusChangeNotify(TRequestStatus &)

voidStatusChangeNotify(TRequestStatus &aStatus)

Notify about media server operational status

Parameters

TRequestStatus & aStatusrequest status

Stop(TServerStopMode)

IMPORT_C TIntStop(TServerStopModeaMode)

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 aModeone 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 TIntStop()

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

SubscribeEvents(TRequestStatus &)

voidSubscribeEvents(TRequestStatus &aStatus)

Subscribe Media Server events

Parameters

TRequestStatus & aStatusrequest status

UnshareContainer(TInt, TRequestStatus &)

voidUnshareContainer(TIntaItemId,
TRequestStatus &aStatus
)

Unshares container

Parameters

TInt aItemId
TRequestStatus & aStatusrequest status

UnshareItem(TInt, TRequestStatus &)

voidUnshareItem(TIntaItemId,
TRequestStatus &aStatus
)

Unshares item

Parameters

TInt aItemId
TRequestStatus & aStatusrequest status

UnshareItemListL(TDes8 &, TDes8 &, TRequestStatus &)

voidUnshareItemListL(TDes8 &aSend,
TDes8 &aExecStatus,
TRequestStatus &aStatus
)

Unshares item list

Parameters

TDes8 & aSend
TDes8 & aExecStatus
TRequestStatus & aStatusrequest status

UnshareRoot(TRequestStatus &)

voidUnshareRoot(TRequestStatus &aStatus)

Unshares root

Parameters

TRequestStatus & aStatusrequest status

UnsubscribeEvents()

voidUnsubscribeEvents()

Unsubscribe Media Server events

UpdateIcon(TDes8 &, CUpnpIcon *, TRequestStatus &)

IMPORT_C voidUpdateIcon(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 & aUrlicon url from XML description
CUpnpIcon * aIconicon
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]