RPtp Class Reference

class RPtp : public RSessionBase

RPtp class is used to create a PTP Server session and a connection to the selected transport medium.

Inherits from

Public Member Functions
RPtp ()
IMPORT_C void CancelIsDpsPrinter ()
IMPORT_C void CancelObjectReceivedNotify ()
IMPORT_C void CancelSendObject ()
IMPORT_C void Close ()
IMPORT_C TInt Connect ()
IMPORT_C TInt CreatePtpStack (const TUid )
IMPORT_C void DestroyPtpStatck ()
IMPORT_C TInt GetNameByObjectHandle ( TDes &, const TUint32 )
IMPORT_C TInt GetObjectHandleByName (const TDesC &, TUint32 &, TBool )
IMPORT_C void IsDpsPrinter ( TRequestStatus &)
IMPORT_C void ObjectReceivedNotify (const TDesC &, TDes &, TRequestStatus &, TBool )
IMPORT_C const TDesC & PtpFolder ()
IMPORT_C void SendObject (const TDesC &, TRequestStatus &, TBool , TInt , TBool )
Private Member Functions
TInt DoConnect ()
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()
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TBool iConnected
TBuf < KFileExtLength > iExt
TFileName iFile
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RPtp()

IMPORT_C RPtp ( )

Member Functions Documentation

CancelIsDpsPrinter()

IMPORT_C void CancelIsDpsPrinter ( )

Cancels previously issued Asynch request IsDpsPrinter

CancelObjectReceivedNotify()

IMPORT_C void CancelObjectReceivedNotify ( )

Cancel Object received notification

CancelSendObject()

IMPORT_C void CancelSendObject ( )

Cancel object sending request.

Close()

IMPORT_C void Close ( )

Connect()

IMPORT_C TInt Connect ( )

Creates new session to PTP Server. This also register the observer to the ptp server. This should be only used by the client

CreatePtpStack(const TUid)

IMPORT_C TInt CreatePtpStack ( const TUid aTransport )

Creates connection to the server and initializes the ptp stack based on specified transport medium.

Parameters

const TUid aTransport

DestroyPtpStatck()

IMPORT_C void DestroyPtpStatck ( )

Closes the connection to PTP server.

DoConnect()

TInt DoConnect ( ) [private]

GetNameByObjectHandle(TDes &, const TUint32)

IMPORT_C TInt GetNameByObjectHandle ( TDes & aNameAndPath,
const TUint32 aHandle
)

Gets the file name.

Parameters

TDes & aNameAndPath
const TUint32 aHandle

GetObjectHandleByName(const TDesC &, TUint32 &, TBool)

IMPORT_C TInt GetObjectHandleByName ( const TDesC & aNameAndPath,
TUint32 & aHandle,
TBool aAdd = EFalse
)

Gets the object handle (whether the object exists). The client may use this function to delete certain file (mainly for dps now)

Parameters

const TDesC & aNameAndPath
TUint32 & aHandle
TBool aAdd = EFalse if ETrue, this object is added to the list if not found.

IsDpsPrinter(TRequestStatus &)

IMPORT_C void IsDpsPrinter ( TRequestStatus & aStatus )

Performs DPS discovery.

Parameters

TRequestStatus & aStatus the result of the Dps discovery, either EAvailable or NotAvailable from TDpsPrinterState enum

ObjectReceivedNotify(const TDesC &, TDes &, TRequestStatus &, TBool)

IMPORT_C void ObjectReceivedNotify ( const TDesC & aFileExtension,
TDes & aNameAndPath,
TRequestStatus & aStatus,
TBool aDelete = EFalse
)

Registers the certain DPS files arrival (from the host) notification. Note that the received file is deleted when next call on this API is made. . The recveived file is always deleted when next call to any method on this API is made.

Parameters

const TDesC & aFileExtension
TDes & aNameAndPath name and path of the file.
TRequestStatus & aStatus
TBool aDelete = EFalse

PtpFolder()

IMPORT_C const TDesC & PtpFolder ( )

Returns name and path of folder. Note: while this still returns a valid folder name, that folder is no more used for anything.

SendObject(const TDesC &, TRequestStatus &, TBool, TInt, TBool)

IMPORT_C void SendObject ( const TDesC & aNameAndPath,
TRequestStatus & aStatus,
TBool aTimeout,
TInt aSize = 0,
TBool aAdd = EFalse
)

Client sends object and get informed when the object is received by the host. This method is intended for sending DPS files only. 5.2 5.2

Parameters

const TDesC & aNameAndPath
TRequestStatus & aStatus
TBool aTimeout whether the client needs the reply for this request. If it needs the timeout will be true, which means if timout happened, the reply is KErrTimedout.
TInt aSize = 0 size of the object to be sent. Not used.
TBool aAdd = EFalse Not used.

Member Data Documentation

TBool iConnected

TBool iConnected [private]

TBuf< KFileExtLength > iExt

TBuf < KFileExtLength > iExt [private]

TFileName iFile

TFileName iFile [private]