Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: obexbase.h
Link against: obex.lib

Class CObex

class CObex : public CBase, protected MObexNotify;

Description

This class is the common base class for CObexClient and CObexServer. It is an abstract class and cannot be instantiated in itself. However, it does contain user functionality common to both client and server connections.

Provides the basic OBEX transport functionality (sending and receiving files) Client and server provide the more specialied APIs for

This class is not designed for user derivation

Derivation

Members

Defined in CObex:
ConnectState(), ConstructL(), EChallConnChallIssued, EChallConnRequested, EConnChallRxed, EConnIdle, EConnObex, EConnTransport, EDropLink, EFinalChallRxed, EFinalResponseReceived, EObexNoSuppressedAuthElements, EObexSuppressAllAuthElements, EObexSuppressChallengeOptionsAuthElement, EObexSuppressRealmAuthElement, EOpAbort, EOpAbortNoFBit, EOpConnect, EOpDisconnect, EOpGet, EOpGetResponse, EOpIdle, EOpPut, EOpSetPath, ESimpleConnChallIssued, ESimpleConnRequest, EWaitForFinalResponse, EWaitForUserInput, IsAuthenticating(), IsConnected(), IsStrictPeer(), LocalInfo(), OnError(), OnPacketReceive(), OnTransportDown(), OnTransportUp(), ParseConnectPacket(), RemoteAddr(), RemoteInfo(), SetCallBack(), SetLocalWho(), SuppressAuthenticationHeaderElements(), TConnectState, TObexSuppressedAuthElements, TOperation, TSetPathInfo, UserPasswordL(), iAuthEngine, iCallBack, iChallPassword, iChallenge, iConnectState, iCurrentOperation, iIncomingChallResp, iIncomingNonce, iIncomingRequestDigest, iLocalInfo, iNotifyHandler, iOutgoingChallResp, iOutgoingNonce, iRemoteInfo, iRemoteRealm, iRemoteUID, iReserved, iRespPassword, iRxChallenge, iSuppressedObexAuthElements, iTransportController, iUserIDRequested, ~CObex()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CObex()

virtual ~CObex();

Description

Destructor.


ConstructL()

protected: virtual void ConstructL(TObexTransportInfo &aObexTransportInfo);

Description

Parameters

TObexTransportInfo &aObexTransportInfo

[Top]


Member functions


SetCallBack()

IMPORT_C void SetCallBack(MObexAuthChallengeHandler &aCallBack);

Description

Sets the authentication challenge handler.

The caller must supply a MObexAuthChallengeHandler implementation to handle calls from the Server/Client for a request for a password.

Parameters

MObexAuthChallengeHandler &aCallBack

Authentication challenge handler


IsConnected()

IMPORT_C TBool IsConnected() const;

Description

Returns ETrue if this CObex is connected at an OBEX level, merely having a transport connected does not satisfy this condition. I.e. the two devices must have completed the OBEX connection request/response . All other states return EFalse. This will be unreliable if either the server blindly returns the client’s who header (always reporting ETrue), or if neither supply "who" headers (always reporting EFalse).

Return value

TBool

ETrue if this CObex is connected at an OBEX level. EFalse otherwise.


IsStrictPeer()

IMPORT_C TBool IsStrictPeer() const;

Description

Return value

TBool

ETrue if the "who" header specified in the server’s connect response matched that of the client’s connect request, and both had a length greater than 0 (i.e. both specified a "who" field). Undefined if IsConnected() == EFalse.


LocalInfo()

IMPORT_C const TObexConnectInfo &LocalInfo() const;

Description

Use this member to gain access to (and alter, if necessary) the CObex::TConnectInfo structure which will be sent to the OBEX peer as part of the connection process. Only alter the contents of this having read and understood the purpose of the fields, as defined in the OBEX spec. Altering this structure after a connection has been made will have no effect on the current session, but will be used for future connection attempts.

Return value

const TObexConnectInfo &

The connect info which will be sent to the OBEX peer.


SetLocalWho()

IMPORT_C TInt SetLocalWho(const TDesC8 &aInfo);

Description

Sets the local Who field.

This is used to identify the local end of the OBEX session when the OBEX connection is made. If it is required, set it before establishing the connection.

Parameters

const TDesC8 &aInfo

Who field

Return value

TInt

KErrNone or KErrArgument if aInfo is empty


RemoteInfo()

IMPORT_C const TObexConnectInfo &RemoteInfo() const;

Description

Use this member to read the details of the remote machine’s connection information, as specified by it in during OBEX connection. This data can not be altered, as this serves no purpose. The content of this structure is undefined when

Return value

const TObexConnectInfo &

The connect info from the remote machine.

See also:


SuppressAuthenticationHeaderElements()

IMPORT_C void SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements aSuppressedObexAuthElements);

Description

Must be called by an application that wishes to suppress the authentication or(not excusive) the realm of the authentication challenge

Parameters

TObexSuppressedAuthElements aSuppressedObexAuthElements

enum TObexSuppressedAuthElements to indicate which header elements to surpress (if any)

Panic codes

KErrArgument

if invalid value is passed in for enum


UserPasswordL()

virtual void UserPasswordL(const TDesC &aPassword)=0;

Description

Parameters

const TDesC &aPassword


RemoteAddr()

IMPORT_C void RemoteAddr(TSockAddr &anAddr);

Description

Get the socket address of the remote device.

This is the address of the device OBEX is connected to over an IrDA or Bluetooth socket.

Parameters

TSockAddr &anAddr

Socket address.


IsAuthenticating()

IMPORT_C TBool IsAuthenticating() const;

Description

Indicates if the Server / Client is currently authenticating the OBEX connection.

Return value

TBool

ETrue if the Server / Client is currently authenticating the OBEX connection otherwise EFalse.


ParseConnectPacket()

protected: virtual TInt ParseConnectPacket(CObexPacket &aPacket)=0;

Description

Parameters

CObexPacket &aPacket

Return value

TInt


ConnectState()

protected: IMPORT_C TConnectState ConnectState() const;

Description

This function is in the protected scope of CObex and so is not externally usable

Return value

TConnectState


OnPacketReceive()

protected: virtual void OnPacketReceive(CObexPacket &aPacket)=0;

Description

Parameters

CObexPacket &aPacket


OnError()

protected: virtual void OnError(TInt aError)=0;

Description

Parameters

TInt aError


OnTransportUp()

protected: virtual void OnTransportUp()=0;

Description


OnTransportDown()

protected: virtual void OnTransportDown()=0;

Description

[Top]


Member classes


Class TSetPathInfo

class TSetPathInfo;

Description

Describes the information set or received in a SETPATH command.

The first bit of iFlags, 0, can be set to indicate to the receiver of SETPATH to backup a level before applying the path name. The second bit of iFlags, 1, can be set to indicate to the receiver of SETPATH to NOT create the directory if it doesn't exist. The iConstants variable is always set to zero as it is reserved. The iName variable indicates the directory to create or go to, and does not include the root directory of the receiver (i.e. if the directory to be set is C: then iName is set to "notes"). If a name is not set then set CObex::TSetPathInfo::iNamePresent to false.

Members

Defined in CObex::TSetPathInfo:
Parent(), TSetPathInfo(), iConstants, iFlags, iName, iNamePresent

Construction and destruction


TSetPathInfo()

IMPORT_C TSetPathInfo();

Description

Constructor.

This is the path information used in the SETPATH command. The variable iFlags is set to zero by default. The variable iConstants is always set to zero as this is a reserved varaible. The path name is NOT present by default.

Member functions


Parent()

IMPORT_C TBool Parent() const;

Description

Returns true if the flags are set so that the receiver will backup a level before applying the path name

Return value

TBool

ETrue if the flags are set so that the receiver will backup a level before applying the path name othewise EFalse.

Member data


iFlags

TUint8 iFlags;

Description


iConstants

TUint8 iConstants;

Description


iName

TBuf< KObexObjectDescriptionSize > iName;

Description


iNamePresent

TBool iNamePresent;

Description

Whether iName is present in this SETPATH info

[Top]


Member enumerations


Enum TConnectState

TConnectState

Description

Current obex connection state In general, the further through the enum the values are, the further through the connection process the state machine will be.

EConnIdle

EConnTransport

Nothing is happening

EConnObex

Transport Link connected not yet established true Link

ESimpleConnRequest

full connection established

EConnChallRxed

Connect without Auth has been sent by ClientReceived by Server

ESimpleConnChallIssued

Server has issued a challenge, to a Client cionnect

EChallConnRequested

Server, received Simple Connect but Server Challenge issued

EChallConnChallIssued

Connect with Auth has been sent by Client/Received by Server

EWaitForFinalResponse

Server has sent a Challenge & Resp to a Client EChallConnRequest

EFinalResponseReceived

Client, waiting for final success/fail not chall-response expected Server, Waiting for final Resp fromm Client to Challenge

EFinalChallRxed

Server, the final response has been received

EWaitForUserInput

Server, Client connect with challenge, Server responds with challenge, Client re-issued original/new challenge

EDropLink

drop the link


Enum TOperation

TOperation

Description

The Obex operation currently being performed.

EOpConnect

EOpDisconnect

Connect

EOpPut

Disconnect

EOpGet

Put

EOpSetPath

Get

EOpAbort

SetPath

EOpAbortNoFBit

Abort - must fit in one pkt so final bit is always set

EOpGetResponse

Abort (internal, never transmitted)

EOpIdle

Internal - not actually an obex operation.


Enum TObexSuppressedAuthElements

TObexSuppressedAuthElements

Description

Flags to suppress the authentication elements of the authentication challenge header.

EObexNoSuppressedAuthElements

EObexSuppressChallengeOptionsAuthElement

EObexSuppressRealmAuthElement

EObexSuppressAllAuthElements

[Top]


Member data


iConnectState

protected: TConnectState iConnectState;

Description


iTransportController

protected: CObexTransportControllerBase * iTransportController;

Description


iLocalInfo

protected: TObexConnectInfo iLocalInfo;

Description


iRemoteInfo

protected: TObexConnectInfo iRemoteInfo;

Description


iCallBack

protected: MObexAuthChallengeHandler * iCallBack;

Description


iOutgoingNonce

protected: TNonce iOutgoingNonce;

Description


iIncomingNonce

protected: TNonce iIncomingNonce;

Description


iChallPassword

protected: HBufC8 * iChallPassword;

Description


iRespPassword

protected: HBufC8 * iRespPassword;

Description


iRxChallenge

protected: HBufC8 * iRxChallenge;

Description


iOutgoingChallResp

protected: TBuf8< KChallResponseSize > iOutgoingChallResp;

Description


iIncomingChallResp

protected: TBuf8< KChallResponseSize > iIncomingChallResp;

Description


iIncomingRequestDigest

protected: TBuf8< KObexRespSize > iIncomingRequestDigest;

Description


iRemoteUID

protected: HBufC * iRemoteUID;

Description


iRemoteRealm

protected: HBufC * iRemoteRealm;

Description


iAuthEngine

protected: CObexAuthenticator * iAuthEngine;

Description


iChallenge

protected: TBool iChallenge;

Description


iUserIDRequested

protected: TBool iUserIDRequested;

Description


iReserved

protected: TBool iReserved;

Description


iCurrentOperation

protected: TOperation iCurrentOperation;

Description


iNotifyHandler

protected: CObexNotifyHandlerBase * iNotifyHandler;

Description


iSuppressedObexAuthElements

protected: TUint iSuppressedObexAuthElements;

Description