CObexClient Class Reference

#include <mw/obexclient.h>

Link against: obex.lib

class CObexClient : public CObex

Inherits from

Public Member Functions
~CObexClient()
IMPORT_C voidAbort()
IMPORT_C voidConnect(TRequestStatus &)
IMPORT_C voidConnect(CObexBaseObject &, TRequestStatus &)
IMPORT_C voidConnectL(CObexBaseObject &, const TDesC &, TRequestStatus &)
IMPORT_C voidConnectL(const TDesC &, TRequestStatus &)
IMPORT_C voidDisconnect(TRequestStatus &)
IMPORT_C TAny *ExtensionInterface(TUid)
IMPORT_C voidGet(CObexBaseObject &, TRequestStatus &)
IMPORT_C const CObexHeaderSet &GetPutFinalResponseHeaders()
IMPORT_C TObexResponseLastServerResponseCode()
IMPORT_C CObexClient *NewL(TObexProtocolInfo &)
IMPORT_C CObexClient *NewL(TObexProtocolInfo &, TObexProtocolPolicy &)
IMPORT_C CObexClient *NewL(TObexTransportInfo &)
IMPORT_C voidPut(CObexBaseObject &, TRequestStatus &)
IMPORT_C voidSetCommandTimeOut(TTimeIntervalMicroSeconds32)
IMPORT_C voidSetFinalPacketObserver(MObexFinalPacketObserver *)
IMPORT_C voidSetPath(TSetPathInfo &, TRequestStatus &)
voidSignalPacketProcessEvent(TInt)
voidTimeOutCompletion()
virtual IMPORT_C voidUserPasswordL(const TDesC &)
Inherited Attributes
CObex::iAuthEngine
CObex::iCallBack
CObex::iChallPassword
CObex::iChallenge
CObex::iConnectState
CObex::iCurrentOperation
CObex::iIncomingChallResp
CObex::iIncomingNonce
CObex::iIncomingRequestDigest
CObex::iLocalInfo
CObex::iNotifyHandler
CObex::iOutgoingChallResp
CObex::iOutgoingNonce
CObex::iRemoteInfo
CObex::iRemoteRealm
CObex::iRemoteUID
CObex::iReserved
CObex::iRespPassword
CObex::iRxChallenge
CObex::iSuppressedObexAuthElements
CObex::iTransportController
CObex::iUserIDRequested
Inherited Enumerations
CObex:TConnectState
CObex:TObexSuppressedAuthElements
CObex:TOperation
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()
CObex::CObex()
CObex::CancelObexConnection()
CObex::ConnectState()const
CObex::ControlledTransportDown()
CObex::Error(TInt)
CObex::ForcedTransportDown()
CObex::GenerateChallenge(CObexPacket &)
CObex::GetConnectState()const
CObex::IsAuthenticating()const
CObex::IsConnected()const
CObex::IsStrictPeer()const
CObex::LocalInfo()const
CObex::NotifyError(TInt)
CObex::NotifyProcess(CObexPacket &)
CObex::NotifyTransportDown(TBool)
CObex::NotifyTransportUp()
CObex::PrepareChallResponseL(const TDesC &)
CObex::Process(CObexPacket &)
CObex::ProcessChallResponseL(const TObexInternalHeader &)
CObex::ProcessChallengeL(const TObexInternalHeader &)
CObex::RemoteAddr(TSockAddr &)
CObex::RemoteInfo()const
CObex::RemoteInfoCleanup()
CObex::SetCallBack(MObexAuthChallengeHandler &)
CObex::SetConnectState(TConnectState)
CObex::SetLocalWho(const TDesC8 &)
CObex::SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements)
CObex::TransportDown(TBool)
CObex::TransportUp()
CObex::~CObex()

Detailed Description

Client side functionality. Connection based. Supports ...
  • Opening IrDA TTP sockets for the OBEX session.

  • Opening an OBEX session over a connected socket

  • Standard OBEX (spec. version 1.2) operations.

This class is not designed for user derivation.

Constructor & Destructor Documentation

~CObexClient ( )

IMPORT_C~CObexClient()

Destructor.

Member Function Documentation

Abort ( )

IMPORT_C voidAbort()

OBEX ABORT operation.

The function sends the OBEX abort command to the remote machine if a multi-packet operation (i.e. PUT or GET) is in progress. An operation in progress will complete with KErrAbort.

Connect ( TRequestStatus & )

IMPORT_C voidConnect(TRequestStatus &aStatus)

OBEX CONNECT operation to any available remote machine.

ParameterDescription
aStatusAsynchronous status word. On completion, KErrNone if it was successful, or a system-wide error code

Connect ( CObexBaseObject &, TRequestStatus & )

IMPORT_C voidConnect(CObexBaseObject &aObject,
TRequestStatus &aStatus
)

OBEX CONNECT operation to any available remote machine, specifying an object to pass.

ParameterDescription
aObjectOBEX object to pass to the remote machine
aStatusAsynchronous status word. On completion, KErrNone if it was successful, or a system-wide error code

ConnectL ( CObexBaseObject &, const TDesC &, TRequestStatus & )

IMPORT_C voidConnectL(CObexBaseObject &aObject,
const TDesC &aPassword,
TRequestStatus &aStatus
)

OBEX CONNECT operation to any available remote machine, specifying an object to pass and a password.

ParameterDescription
aObjectOBEX object to pass to the remote machine
aPasswordPassword to access remote machine
aStatusAsynchronous status word. On completion, KErrNone if it was successful, or a system-wide error code

ConnectL ( const TDesC &, TRequestStatus & )

IMPORT_C voidConnectL(const TDesC &aPassword,
TRequestStatus &aStatus
)

OBEX CONNECT operation to any available remote machine, specifying a password.

ParameterDescription
aPasswordPassword to access remote machine
aStatusOn completion, KErrNone if it was successful, or a system-wide error code

Disconnect ( TRequestStatus & )

IMPORT_C voidDisconnect(TRequestStatus &aStatus)

OBEX DISCONNECT operation.

This terminates the OBEX connection, and closes the transport on receiving any response from the server.

ParameterDescription
aStatusAsynchronous status word. On completion, KErrNone on normal disconnection, or KErrDisconnected if the server dropped the transport before sending an OBEX response (which is valid behaviour).

ExtensionInterface ( TUid )

IMPORT_C TAny *ExtensionInterface(TUidaUid)

Provides additional interfaces for CObexClient.

ParameterDescription
aUidThe UID of the interface that is required.

Returns: A pointer to an instance implementing the interface represented by aUid.

Get ( CObexBaseObject &, TRequestStatus & )

IMPORT_C voidGet(CObexBaseObject &aObject,
TRequestStatus &aStatus
)

OBEX GET operation.

The caller specifies in aObject the headers to send to the server to specify the object to get: normally just a name is expected. If the server can serve the request, the object it returns will be loaded into aObject on completion. All headers returned by the server that are also allowed by the object s header mask will be loaded into the relevant attributes of aObject. Any object body is stored according to the implementation type of the CObexBaseObject passed.

ParameterDescription
aObjectOBEX object to get; on completion, the retrieved object
aStatusAsynchronous status word. On completion, KErrNone if the server passed back an OBEX object, or the appropriate file error if the data file could not be opened

GetPutFinalResponseHeaders ( )

IMPORT_C const CObexHeaderSet &GetPutFinalResponseHeaders()

This function can be called following the successful completion of a Put, and will return a reference to a CObexHeaderSet containing all the headers that were contained in the final Put response packet returned from the peer Obex server.

The headers in the header set will be deleted by any subsequent call to CObexClient functions that trigger Obex commands (ie. Connect, Disconnect, Put, Get, SetPath).

The reference should not be retained beyond the end of the lifetime of the CObexClient object.

Returns: const reference to a Headerset containing headers returned in final Put response packet.

LastServerResponseCode ( )

IMPORT_C TObexResponseLastServerResponseCode()const

Get last server response code This method returns the last received OBEX response code. The method must not be called prior to a response notification being received by the client application. If the method is called a panic will be raised.

panic
ENoResponseCodeToReturn Panics if the method is called prior to a response being received from the OBEX server.

Returns: The last received OBEX response code.

NewL ( TObexProtocolInfo & )

IMPORT_C CObexClient *NewL(TObexProtocolInfo &aObexProtocolInfoPtr)[static]

Allocates and constructs a new OBEX client object.

The received protocol information object, aObexProtocolInfoPtr, specifies the transport protocol to use: For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo for Bluetooth, TObexUsbProtocolInfo for USB.

ParameterDescription
aObexProtocolInfoPtrProtocol information object describing the transport to use

Returns: New OBEX client object

NewL ( TObexProtocolInfo &, TObexProtocolPolicy & )

IMPORT_C CObexClient *NewL(TObexProtocolInfo &aObexProtocolInfoPtr,
TObexProtocolPolicy &aObexProtocolPolicy
)[static]

Allocates and constructs a new OBEX client object with packet sizing information.

The received protocol information object, aObexProtocolInfoPtr, specifies the transport protocol to use: For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo for Bluetooth, TObexUsbProtocolInfo for USB.

The aObexProtocolPolicy parameter specifies the packet sizing policy for this OBEX object.

ParameterDescription
aObexProtocolInfoPtrProtocol information object describing the transport to use
aObexProtocolPolicyProtocol policy object specifying the packet sizes to use

Returns: New OBEX client object

NewL ( TObexTransportInfo & )

IMPORT_C CObexClient *NewL(TObexTransportInfo &aObexTransportInfo)[static]

Allocates and constructs a new OBEX client object with packet sizing information.

The received transport information object, aObexTransportInfo, specifies the transport protocol packet sizes to use: For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo for Bluetooth, TObexUsbProtocolInfo for USB.

capability
WriteDeviceData If the TObexIrV3TransportInfo is passed as the argument and the associated name is valid.
ParameterDescription
aObexTransportInfoTransport information object describing the transport and packet sizes to use

Returns: New OBEX client object

Put ( CObexBaseObject &, TRequestStatus & )

IMPORT_C voidPut(CObexBaseObject &aObject,
TRequestStatus &aStatus
)

OBEX PUT operation.

Any valid header that is also present in aObject s header mask will be sent to the server, along with the object body specified by the implementation of aObject.

ParameterDescription
aObjectOBEX object to put
aStatusAsynchronous status word. On completion, KErrNone if the server accepted the object and received it fully, or the appropriate file error if the data file could not be opened

SetCommandTimeOut ( TTimeIntervalMicroSeconds32 )

IMPORT_C voidSetCommandTimeOut(TTimeIntervalMicroSeconds32aTimeOut)

Sets the Command Idle Time-out.

This function sets the timer period to be observed during the progress of all OBEX commands. If the OBEX server does not respond within the set period the current OBEX command will be completed with an error of KErrIrObexRespTimedOut and the transport will be disconnected.

Setting a time-out value of 0, all OBEX commands will be allowed to continue indefinitely.

ParameterDescription
aTimeOutThe time-out period in Microseconds.

SetFinalPacketObserver ( MObexFinalPacketObserver * )

IMPORT_C voidSetFinalPacketObserver(MObexFinalPacketObserver *aObserver)

Sets a final packet observer.

This replaces any previous observer. The observer will receive a callback when a final packet for a put or get request begins to be sent and another when the send completes. Although the start and finish callbacks are guaranteed to be in order, no guarantees are made about the ordering with respect to the completion of the put or get request.

This does not transfer ownership.

ParameterDescription
aObserverThe observer to receive packet process events. This may be NULL.

SetPath ( TSetPathInfo &, TRequestStatus & )

IMPORT_C voidSetPath(TSetPathInfo &aPathInfo,
TRequestStatus &aStatus
)

OBEX SETPATH operation.

This changes the remote device's current path.

ParameterDescription
aPathInfoInformation to send in the SETPATH command. If you do not which to send a name, make sure CObex::TSetPathInfo::iNamePresent is set to false.
aStatusAsynchronous status word. On completion, KErrNone if successful, or a system-wide error code

SignalPacketProcessEvent ( TInt )

voidSignalPacketProcessEvent(TIntaEvent)

Signals an event has ocurred.

ParameterDescription
aEventThe event that has ocurred (TObexPacketProcessEvent)

TimeOutCompletion ( )

voidTimeOutCompletion()

UserPasswordL ( const TDesC & )

IMPORT_C voidUserPasswordL(const TDesC &aPassword)[virtual]

A call back from the the service with the password required for use with generating the challenge response.

leave
KErrNotReady if this function is not called from a MObexAuthChallengeHandler::GetUserPasswordL callback.
ParameterDescription
aPasswordPassword