#include <mw/obexbase.h>
class CObex : public CBase |
Public Member Enumerations | |
---|---|
enum | TConnectState { EConnIdle, EConnTransport, EConnObex, ESimpleConnRequest, ..., EDropLink } |
enum | TObexSuppressedAuthElements { EObexNoSuppressedAuthElements, EObexSuppressChallengeOptionsAuthElement, EObexSuppressRealmAuthElement, EObexSuppressAllAuthElements } |
enum | TOperation { EOpConnect, EOpDisconnect, EOpPut, EOpGet, ..., EOpIdle } |
Public Member Functions | |
---|---|
virtual | ~CObex() |
virtual 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() |
virtual 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) |
virtual void | TransportDown(TBool) |
virtual void | TransportUp() |
pure virtual void | UserPasswordL(const TDesC &) |
Protected Member Functions | |
---|---|
CObex() | |
void | CancelObexConnection() |
IMPORT_C TConnectState | ConnectState() |
virtual void | ConstructL(TObexTransportInfo &) |
void | ControlledTransportDown() |
void | ForcedTransportDown() |
TInt | GenerateChallenge(CObexPacket &) |
pure virtual void | OnError(TInt) |
pure virtual void | OnPacketReceive(CObexPacket &) |
pure virtual void | OnTransportDown() |
pure virtual void | OnTransportUp() |
pure virtual TInt | ParseConnectPacket(CObexPacket &) |
void | PrepareChallResponseL(const TDesC &) |
void | ProcessChallResponseL(const TObexInternalHeader &) |
void | ProcessChallengeL(const TObexInternalHeader &) |
void | RemoteInfoCleanup() |
void | SetConnectState(TConnectState) |
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
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.
Flags to suppress the authentication elements of the authentication challenge header.
The Obex operation currently being performed.
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] |
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
See also: ForcedTransportDown()
void | Error | ( | TInt | aError | ) | [virtual] |
This function is retained for backwards compatibility and should not be called.
Calling this function has undefined behaviour.
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
See also: ControlledTransportDown()
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.
Returns: ETrue if the Server / Client is currently authenticating the OBEX connection otherwise EFalse.
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).
Returns: ETrue if this CObex is connected at an OBEX level. EFalse otherwise.
IMPORT_C TBool | IsStrictPeer | ( | ) | const |
Returns: 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.
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.
Returns: The connect info which will be sent to the OBEX peer.
void | OnPacketReceive | ( | CObexPacket & | aPacket | ) | [protected, pure virtual] |
TInt | ParseConnectPacket | ( | CObexPacket & | aPacket | ) | [protected, pure virtual] |
void | PrepareChallResponseL | ( | const TDesC & | aPassword | ) | [protected] |
Parameter | Description |
---|---|
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.
void | ProcessChallResponseL | ( | const TObexInternalHeader & | hdr | ) | [protected] |
void | ProcessChallengeL | ( | const TObexInternalHeader & | hdr | ) | [protected] |
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.
Parameter | Description |
---|---|
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
See also: IsConnected () == EFalse.
Returns: The connect info from the remote machine.
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.
Parameter | Description |
---|---|
aCallBack | Authentication challenge handler |
void | SetConnectState | ( | TConnectState | aNewState | ) | [protected] |
Change the state of the authentication state machine
Parameter | Description |
---|---|
aNewState | New state |
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.
Parameter | Description |
---|---|
aInfo | Who field |
Returns: KErrNone or KErrArgument if aInfo is empty
IMPORT_C void | SuppressAuthenticationHeaderElements | ( | TObexSuppressedAuthElements | aSuppressedObexAuthElements | ) |
Parameter | Description |
---|---|
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.