Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <obexclient.h>
Link against: obex.lib

Class CObexClient

class CObexClient : public CObex;

Description

Client side functionality. Connection based. Supports ...

This class is not designed for user derivation.

Derivation

Members

Defined in CObexClient:

Inherited from CBase:

Inherited from CObex:


Construction and destruction


~CObexClient()

IMPORT_C ~CObexClient();

Description

Destructor.


NewL(TObexProtocolInfo &)

Capability: WriteDeviceData Conditional on: KObexIrTTPProtocolV3

IMPORT_C static CObexClient* NewL(TObexProtocolInfo &aObexProtocolInfoPtr);

Description

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.

Parameters

TObexProtocolInfo &aObexProtocolInfoPtr

Protocol information object describing the transport to use

Return value

CObexClient *

New OBEX client object


NewL(TObexProtocolInfo &,TObexProtocolPolicy &)

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

Description

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.

Parameters

TObexProtocolInfo &aObexProtocolInfoPtr

Protocol information object describing the transport to use

TObexProtocolPolicy &aObexProtocolPolicy

Protocol policy object specifying the packet sizes to use

Return value

CObexClient *

New OBEX client object


NewL(TObexTransportInfo &)

Capability: WriteDeviceData If the

IMPORT_C static CObexClient* NewL(TObexTransportInfo &aObexTransportInfo);

Description

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.

Parameters

TObexTransportInfo &aObexTransportInfo

Transport information object describing the transport and packet sizes to use

Return value

CObexClient *

New OBEX client object


ConstructL(TObexTransportInfo &)

private: virtual void ConstructL(TObexTransportInfo &aObexTransportInfo);

Description

Parameters

TObexTransportInfo &aObexTransportInfo

[Top]


Member functions


Connect(TRequestStatus &)

IMPORT_C void Connect(TRequestStatus &aStatus);

Description

OBEX CONNECT operation to any available remote machine.

Parameters

TRequestStatus &aStatus

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


Connect(CObexBaseObject &,TRequestStatus &)

IMPORT_C void Connect(CObexBaseObject &aObject, TRequestStatus &aStatus);

Description

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

Parameters

CObexBaseObject &aObject

OBEX object to pass to the remote machine

TRequestStatus &aStatus

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


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

IMPORT_C void ConnectL(CObexBaseObject &aObject, const TDesC &aPassword, TRequestStatus &aStatus);

Description

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

Parameters

CObexBaseObject &aObject

OBEX object to pass to the remote machine

const TDesC16 &aPassword

Password to access remote machine

TRequestStatus &aStatus

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


ConnectL(const TDesC &,TRequestStatus &)

IMPORT_C void ConnectL(const TDesC &aPassword, TRequestStatus &aStatus);

Description

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

Parameters

const TDesC16 &aPassword

Password to access remote machine

TRequestStatus &aStatus

On completion, KErrNone if it was successful, or a system-wide error code


Disconnect(TRequestStatus &)

IMPORT_C void Disconnect(TRequestStatus &aStatus);

Description

OBEX DISCONNECT operation.

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

Parameters

TRequestStatus &aStatus

Asynchronous 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).


Put(CObexBaseObject &,TRequestStatus &)

IMPORT_C void Put(CObexBaseObject &aObject, TRequestStatus &aStatus);

Description

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.

Parameters

CObexBaseObject &aObject

OBEX object to put

TRequestStatus &aStatus

Asynchronous 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


Get(CObexBaseObject &,TRequestStatus &)

IMPORT_C void Get(CObexBaseObject &aObject, TRequestStatus &aStatus);

Description

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.

Parameters

CObexBaseObject &aObject

OBEX object to get; on completion, the retrieved object

TRequestStatus &aStatus

Asynchronous 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


SetPath(TSetPathInfo &,TRequestStatus &)

IMPORT_C void SetPath(TSetPathInfo &aPathInfo, TRequestStatus &aStatus);

Description

OBEX SETPATH operation.

This changes the remote device's current path.

Parameters

TSetPathInfo &aPathInfo

Information to send in the SETPATH command. If you do not which to send a name, make sure CObex::TSetPathInfo::iNamePresent is set to false.

TRequestStatus &aStatus

Asynchronous status word. On completion, KErrNone if successful, or a system-wide error code


Abort()

IMPORT_C void Abort();

Description

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.


UserPasswordL(const TDesC &)

IMPORT_C virtual void UserPasswordL(const TDesC &aPassword);

Description

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

Parameters

const TDesC16 &aPassword

Password

Leave codes

KErrNotReady

if this function is not called from a MObexAuthChallengeHandler::GetUserPasswordL callback.


GetPutFinalResponseHeaders()

IMPORT_C const CObexHeaderSet& GetPutFinalResponseHeaders();

Description

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.

Return value

const CObexHeaderSet &

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


SetFinalPacketObserver(MObexFinalPacketObserver *)

IMPORT_C void SetFinalPacketObserver(MObexFinalPacketObserver *aObserver);

Description

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.

Parameters

MObexFinalPacketObserver *aObserver

The observer to receive packet process events. This may be NULL.


LastServerResponseCode()const

IMPORT_C TObexResponse LastServerResponseCode() const;

Description

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.

Return value

TObexResponse

The last received OBEX response code.

Panic codes

ENoResponseCodeToReturn

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


SetCommandTimeOut(TTimeIntervalMicroSeconds32)

IMPORT_C void SetCommandTimeOut(TTimeIntervalMicroSeconds32 aTimeOut);

Description

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.

Parameters

TTimeIntervalMicroSeconds32 aTimeOut

The time-out period in Microseconds.


ExtensionInterface(TUid)

IMPORT_C TAny* ExtensionInterface(TUid aUid);

Description

Provides additional interfaces for CObexClient.

Parameters

TUid aUid

The UID of the interface that is required.

Return value

TAny *

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


OnPacketReceive(CObexPacket &)

private: virtual void OnPacketReceive(CObexPacket &aPacket);

Description

Parameters

CObexPacket &aPacket


OnError(TInt)

private: virtual void OnError(TInt aError);

Description

Parameters

TInt aError


OnTransportUp()

private: virtual void OnTransportUp();

Description


OnTransportDown()

private: virtual void OnTransportDown();

Description


ParseConnectPacket(CObexPacket &)

private: virtual TInt ParseConnectPacket(CObexPacket &aPacket);

Description

Parameters

CObexPacket &aPacket

Return value

TInt