class CObex : public CBase |
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.
initiation or response to puts & gets
(possible) handling of more generalised 'objects' (prob. with data buffered through a file).
This class is not designed for user derivation
Public Member Functions | |
---|---|
~CObex () | |
void | Error ( TInt ) |
TConnectState | GetConnectState () |
IMPORT_C TBool | IsAuthenticating () |
IMPORT_C TBool | IsConnected () |
IMPORT_C TBool | IsStrictPeer () |
IMPORT_C const TObexConnectInfo & | LocalInfo () |
void | NotifyError ( TInt ) |
void | NotifyProcess ( CObexPacket &) |
void | NotifyTransportDown ( TBool ) |
void | NotifyTransportUp () |
void | Process ( CObexPacket &) |
IMPORT_C void | RemoteAddr ( TSockAddr &) |
IMPORT_C const TObexConnectInfo & | RemoteInfo () |
IMPORT_C void | SetCallBack ( MObexAuthChallengeHandler &) |
IMPORT_C TInt | SetLocalWho (const TDesC8 &) |
IMPORT_C void | SuppressAuthenticationHeaderElements ( TObexSuppressedAuthElements ) |
void | TransportDown ( TBool ) |
void | TransportUp () |
void | UserPasswordL (const TDesC &) |
Protected Member Functions | |
---|---|
CObex () | |
void | CancelObexConnection () |
IMPORT_C TConnectState | ConnectState () |
void | ConstructL ( TObexTransportInfo &) |
void | ControlledTransportDown () |
void | ForcedTransportDown () |
TInt | GenerateChallenge ( CObexPacket &) |
void | OnError ( TInt ) |
void | OnPacketReceive ( CObexPacket &) |
void | OnTransportDown () |
void | OnTransportUp () |
TInt | ParseConnectPacket ( CObexPacket &) |
void | PrepareChallResponseL (const TDesC &) |
void | ProcessChallResponseL (const TObexInternalHeader &) |
void | ProcessChallengeL (const TObexInternalHeader &) |
void | RemoteInfoCleanup () |
void | SetConnectState ( TConnectState ) |
Public Member Enumerations | |
---|---|
enum |
TConnectState
{
EConnIdle , EConnTransport , EConnObex , ESimpleConnRequest , EConnChallRxed , ESimpleConnChallIssued , EChallConnRequested , EChallConnChallIssued , EWaitForFinalResponse , EFinalResponseReceived , EFinalChallRxed , EWaitForUserInput , EDropLink } |
enum | TObexSuppressedAuthElements { EObexNoSuppressedAuthElements = 0x00, EObexSuppressChallengeOptionsAuthElement = 0x01, EObexSuppressRealmAuthElement = 0x02, EObexSuppressAllAuthElements = EObexSuppressChallengeOptionsAuthElement | EObexSuppressRealmAuthElement } |
enum |
TOperation
{
EOpConnect = 0x00, EOpDisconnect = 0x01, EOpPut = 0x02, EOpGet = 0x03, EOpSetPath = 0x05, EOpAbort = 0xFF, EOpAbortNoFBit = 0x7F, EOpGetResponse = 0xFD, EOpIdle = 0xFE } |
CObex | ( | ) | [protected] |
Constructor - set initial values and copy in protocol policy information
void | CancelObexConnection | ( | ) | [protected] |
Put into transport connected state but cancel any outstanding transfers and operations
IMPORT_C TConnectState | ConnectState | ( | ) | const [protected] |
This function is in the protected scope of CObex and so is not externally usable
void | ConstructL | ( | TObexTransportInfo & | aObexTransportInfo | ) | [protected, virtual] |
TObexTransportInfo & aObexTransportInfo |
void | ControlledTransportDown | ( | ) | [protected] |
This function will tear down the transport if the transport layer supports transport reconnection on obex reconnection This is called in conditions other than error conditions
void | Error | ( | TInt | aError | ) | [virtual] |
This function is retained for backwards compatibility and should not be called.
Calling this function has undefined behaviour.
TInt aError |
void | ForcedTransportDown | ( | ) | [protected] |
This function forces the transport to be taken down regardless of whether or not the underlying transport can recover without restarting obex applications However if the transport controller fails to bring the transport down, then only the obex connection is cancelled. This is called in error conditions
TInt | GenerateChallenge | ( | CObexPacket & | aPacket | ) | [protected] |
CObexPacket & aPacket |
TConnectState | GetConnectState | ( | ) | const |
Get the current state of the authentication state machine
IMPORT_C TBool | IsAuthenticating | ( | ) | const |
Indicates if the Server / Client is currently authenticating the OBEX connection.
IMPORT_C TBool | IsConnected | ( | ) | const |
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).
IMPORT_C const TObexConnectInfo & | LocalInfo | ( | ) | const |
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.
void | NotifyProcess | ( | CObexPacket & | aPacket | ) |
CObexPacket & aPacket |
void | OnPacketReceive | ( | CObexPacket & | aPacket | ) | [protected, pure virtual] |
CObexPacket & aPacket |
TInt | ParseConnectPacket | ( | CObexPacket & | aPacket | ) | [protected, pure virtual] |
CObexPacket & aPacket |
void | PrepareChallResponseL | ( | const TDesC & | aPassword | ) | [protected] |
const TDesC & aPassword | Password to use in challenge response |
void | Process | ( | CObexPacket & | aPacket | ) | [virtual] |
This function is retained for backwards compatibility and should not be called.
Calling this function has undefined behaviour.
CObexPacket & aPacket |
void | ProcessChallResponseL | ( | const TObexInternalHeader & | hdr | ) | [protected] |
const TObexInternalHeader & hdr |
void | ProcessChallengeL | ( | const TObexInternalHeader & | hdr | ) | [protected] |
const TObexInternalHeader & hdr |
IMPORT_C void | RemoteAddr | ( | TSockAddr & | anAddr | ) |
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.
TSockAddr & anAddr | Socket address. |
IMPORT_C const TObexConnectInfo & | RemoteInfo | ( | ) | const |
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 IsConnected () == EFalse .
IMPORT_C void | SetCallBack | ( | MObexAuthChallengeHandler & | aCallBack | ) |
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.
MObexAuthChallengeHandler & aCallBack | Authentication challenge handler |
void | SetConnectState | ( | TConnectState | aNewState | ) | [protected] |
Change the state of the authentication state machine
TConnectState aNewState | New state |
IMPORT_C TInt | SetLocalWho | ( | const TDesC8 & | aInfo | ) |
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.
const TDesC8 & aInfo | Who field |
IMPORT_C void | SuppressAuthenticationHeaderElements | ( | TObexSuppressedAuthElements | aSuppressedObexAuthElements | ) |
TObexSuppressedAuthElements aSuppressedObexAuthElements | enum TObexSuppressedAuthElements to indicate which header elements to surpress (if any) |
void | TransportDown | ( | TBool | aForceTransportDeletion | ) | [virtual] |
This function is retained for backwards compatibility and should not be called. Use ControlledTransportDown() or ForcedTransportDown() to disconnect the transport layer. Calling this function will result in an ETransportDownCalled panic.
TBool aForceTransportDeletion |
void | TransportUp | ( | ) | [virtual] |
This function is retained for backwards compatibility and should not be called.
Calling this function has undefined behaviour.
void | UserPasswordL | ( | const TDesC & | aPassword | ) | [pure virtual] |
const TDesC & aPassword |
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 |
waiting for the user drop the link |
Flags to suppress the authentication elements of the authentication challenge header.
EObexNoSuppressedAuthElements = 0x00 | |
EObexSuppressChallengeOptionsAuthElement = 0x01 | |
EObexSuppressRealmAuthElement = 0x02 | |
EObexSuppressAllAuthElements = EObexSuppressChallengeOptionsAuthElement | EObexSuppressRealmAuthElement |
The Obex operation currently being performed.
EOpConnect = 0x00 | |
EOpDisconnect = 0x01 |
Connect |
EOpPut = 0x02 |
Disconnect |
EOpGet = 0x03 |
Put |
EOpSetPath = 0x05 |
Get |
EOpAbort = 0xFF |
SetPath |
EOpAbortNoFBit = 0x7F |
Abort - must fit in one pkt so final bit is always set |
EOpGetResponse = 0xFD |
Abort (internal, never transmitted) |
EOpIdle = 0xFE |
Internal - not actually an obex operation. |
TBuf8 < KChallResponseSize > | iIncomingChallResp | [protected] |
TBuf8 < KObexRespSize > | iIncomingRequestDigest | [protected] |
TBuf8 < KChallResponseSize > | iOutgoingChallResp | [protected] |
CObexTransportControllerBase * | iTransportController | [protected] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.