Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: AgentClient.h
Link against: GenConn.lib

Class RGenericAgent

RGenericAgent

Support

Supported from 6.1

Description

The generic agent interfaces with NifMan.

From v6.1 onwards, this replaces the NetDial API.

The Network Interface Manager (NifMan) provides a generic framework for controlling network interfaces, and defines a plug-in architecture. The Generic Agent is such a plug-in for handling dial-up networking. TCP/IP uses the Generic Agent to establish a connection, before setting up the PPP connection.

The Generic Agent gets comms settings, such as modem and ISP configuration, from the communications database (CommDb). It uses the Telephony subsystem to make the dial-up connection.

Derivation

RGenericAgentThe generic agent interfaces with NifMan
RHandleBaseHandle to an object
RNifProvides an interface for the client so that it may monitor a connection
RSessionBaseClient-side handle to a session with a server

Defined in RGenericAgent:
AcceptIncomingRequests(), AcceptIncomingRequestsCancel(), CancelOutgoingErrorNotification(), CancelServiceChangeNotification(), DebugMarkEnd(), DebugMarkStart(), DebugSetAllocFail(), DoAcceptIncomingRequestsL(), DoStartOutgoingL(), GetActiveBoolSetting(), GetActiveDesSetting(), GetActiveIntSetting(), GetActiveLongDesSetting(), Open(), PackageOverridesArray(), RGenericAgent(), ResolveError(), ServiceChangeNotification(), StartOutgoing(), iNewISPId, ~RGenericAgent()

Inherited from RHandleBase:
Close(), Duplicate(), Handle(), SetHandle()

Inherited from RNif:
AgentInfo(), CancelProgressNotification(), DisableTimers(), LastProgressError(), NetworkActive(), Progress(), ProgressNotification(), Start(), Stop(), Version()

Inherited from RSessionBase:
Attach(), CreateSession(), EAutoAttach, EExplicitAttach, Send(), SendReceive(), SetRetry(), Share(), TAttachMode


Construction and destruction


RGenericAgent()

RGenericAgent();

Description

Default empty constructor, and is present only to support virtual function table export.


~RGenericAgent()

~RGenericAgent();

Description

Destructor.

[Top]


Member functions


Open()

TInt Open();

Description

Open the network interface.

Return value

TInt

The return value from RNif::Open().


StartOutgoing()

TInt StartOutgoing();

Description

Starts the agent making an outgoing connection and signals to NifMan that a connection has been started. The function will start the agent using the settings from the CommDB. If the setting in the database is to prompt the user for connection parameters, then the agent will automatically start up the dialog server to get information from the user. This function will return without waiting to find out if setting up the connection was successful. There is a asynchronous version of this function available that will wait for the connection set up to complete.

Return value

TInt

KErrNone if successful, KErrInUse if the agent is already in use, i.e. a connection is already in progress, and KErrAlreadyExists (from NifMan) if the agent is already in progress with a connection.


StartOutgoing()

TInt StartOutgoing(CStoreableOverrideSettings& aOverrides);

Description

Starts the agent making an outgoing connection and signals to NifMan that a connection has been started. The function will start the agent using the database override settings specified in the parameter, rather than (or in addition to) using the database settings from the comms database. This function will return without waiting to find out if setting up the connection was successful. There is a asynchronous version of this function available that will wait for the connection set up to complete.

Parameters

CStoreableOverrideSettings& aOverrides

The CommDb override settings.

Return value

TInt

KErrNone if successful, KErrInUse if the agent is already in use, i.e. a connection is already in progress, and KErrAlreadyExists (from NifMan) if the agent is already in progress with a connection.

See also:


StartOutgoing()

void StartOutgoing(TRequestStatus& aStatus);

Description

This is the asynchronous version of StartOutgoing(). This function waits for the connection setup to complete.

Parameters

TRequestStatus& aStatus

On return, KErrNone if setting up the connection was successful, an error code if not.


StartOutgoing()

void StartOutgoing(CStoreableOverrideSettings& aOverrides, TRequestStatus& aStatus);

Description

This is the asynchronous version of StartOutgoing(). This function waits for the connection setup to complete.

Parameters

CStoreableOverrideSettings& aOverrides

The CommDB override settings.

TRequestStatus& aStatus

On return, KErrNone if setting up the connection was successful, an error code if not.

See also:


CancelOutgoingErrorNotification()

void CancelOutgoingErrorNotification();

Description

This does not cancel the connection attempt itself (this may be done using the RNif::Stop() function), but cancels the outstanding request for the error to be returned when the connection is complete.


AcceptIncomingRequests()

TInt AcceptIncomingRequests(TRequestStatus& aStatus);

Description

Tells the agent to begin waiting for incoming requests for connection establishment.

Notes:

Parameters

TRequestStatus& aStatus

On return, KErrNone if successful, KErrAccessDenied if "Incoming GPRS" is disallowed by the global setting in the Comms Database. The other errors are the same as returned by StartOutgoing().

Return value

TInt

KErrNone


AcceptIncomingRequests()

TInt AcceptIncomingRequests(CStoreableOverrideSettings& aOverrides, TRequestStatus& aStatus);

Description

This function is the same as AcceptIncomingRequests(TRequestStatus& aStatus) but allows the caller to override the CommDB settings by providing the aOverrides parameter.

Parameters

CStoreableOverrideSettings& aOverrides

The override settings over the CommDB.

TRequestStatus& aStatus

On return, KErrNone if successful, KErrAccessDenied if "Incoming GPRS" is disallowed by the global setting in the CommDB, KErrNotSupported if an attempt is made to request waiting for a CSD call (by setting the overrides appropriately). The other errors are the same as for StartOutgoing().

Return value

TInt

KErrNone if successful.

See also:


AcceptIncomingRequestsCancel()

void AcceptIncomingRequestsCancel();

Description

Cancels a previous call to accept an incoming request made by AcceptIncomingRequests().

Notes:


ServiceChangeNotification()

void ServiceChangeNotification(TRequestStatus& aStatus, TUint32& aNewISPId, TDes& aNewServiceType);

Description

This asynchronous function allows the user to be notified of a change to the ISP/GPRS AP to which the agent is connected.

Parameters

TRequestStatus& aStatus

On return, KErrNone if the method was successful, KErrInUse if there is already an outstanding ServiceChangeNotification() request, an error otherwise.

TUint32& aNewISPId

On return, the new ISP ID.

TDes& aNewServiceType

On return, describes the new service type.


CancelServiceChangeNotification()

void CancelServiceChangeNotification();

Description

Cancels a previously posted ServiceChangeNotification() call.


GetActiveIntSetting()

TInt GetActiveIntSetting(const TDesC& aTableName, const TDesC& aColumnName, TUint32& aValue);

Description

Gets the "active setting", i.e. the current default or override as a TUint32, for the specified database field.

Parameters

const TDesC& aTableName

The table name of the database field queried.

const TDesC& aColumnName

The column name of the database field queried.

TUint32& aValue

On return, the requested TUint32 value.

Return value

TInt

KErrNone if successful, KErrNotReady if there is no connection in progress, KErrNotFound if the value required is non-existent.

See also:


GetActiveBoolSetting()

TInt GetActiveBoolSetting(const TDesC& aTableName, const TDesC& aColumnName, TBool& aValue);

Description

Gets the "active setting", i.e. the current default or override as a TBool, for the specified database field.

Parameters

const TDesC& aTableName

The table name of the database field queried.

const TDesC& aColumnName

The column name of the database field queried.

TBool& aValue

On return, the requested TBool value.

Return value

TInt

KErrNone if successful, KErrNotReady if there is no connection in progress, KErrNotFound if the value required is non-existent.

See also:


GetActiveDesSetting()

TInt GetActiveDesSetting(const TDesC& aTableName, const TDesC& aColumnName, TDes8& aValue);

Description

Gets the "active setting", i.e. the current default or override as a TDes8, for the specified database field.

Parameters

const TDesC& aTableName

The table name of the database field queried.

const TDesC& aColumnName

The column name of the database field queried.

TDes8& aValue

On return, the requested TDes8 value.

Return value

TInt

KErrNone if successful, KErrNotReady if there is no connection in progress, KErrNotFound if the value required is non-existent.

See also:


GetActiveDesSetting()

TInt GetActiveDesSetting(const TDesC& aTableName, const TDesC& aColumnName, TDes16& aValue);

Description

Gets the "active setting", i.e. the current default or override as a TDes16, for the specified database field.

This function has one extra use. If the value of aTableName is TPtrC(SERVICE_TYPE) and aColumnName is an empty descriptor, the function will return in the aValue the name of the table that is currently in use. This indicates the bearer (GPRS/CSD) that is currently in use.

Parameters

const TDesC& aTableName

The table name of the database field queried or TPtrC(SERVICE_TYPE).

const TDesC& aColumnName

The column name of the database field queried.

TDes16& aValue

On return, the requested TDes16 value.

Return value

TInt

KErrNone if successful, KErrNotReady if there is no connection in progress, KErrNotFound if the value required is non-existent.

See also:


GetActiveLongDesSetting()

TInt GetActiveLongDesSetting(const TDesC& aTableName, const TDesC& aColumnName, TDes& aValue);

Description

Gets the "active setting", i.e. the current default or override as a TDes, for the specified database field.

Parameters

const TDesC& aTableName

The table name of the database field queried.

const TDesC& aColumnName

The column name of the database field queried.

TDes& aValue

On return, the requested TDes value.

Return value

TInt

KErrNone if successful, KErrNotReady if there is no connection in progress, KErrNotFound if the value required is non-existent.

See also:


ResolveError()

static void ResolveError(TInt& aError);

Description

Resolves all agent-specific errors to standard Symbian OS errors. All errors are resolved to KErrGeneral apart from KErrScriptComplete, which is resolved to KErrNone.

Parameters

TInt& aError

The agent error code that should be resolved to a standard Symbian OS error. On return this holds the new error value.


DoStartOutgoingL()

private: void DoStartOutgoingL(CStoreableOverrideSettings& aOverrides);

Description

This member is internal and not intended for use.

Parameters

CStoreableOverrideSettings& aOverrides

[Top]


Internal members


DebugMarkStart()

void DebugMarkStart();

Description

The body of this function is only defined for debug builds and is not intended for use.


DebugMarkEnd()

void DebugMarkEnd(TInt aCount=0);

Description

The body of this function is only defined for debug builds and is not intended for use.

Parameters

TInt aCount=0


DebugSetAllocFail()

void DebugSetAllocFail(TInt aValue=0);

Description

The body of this function is only defined for debug builds and is not intended for use.

Parameters

TInt aValue=0


DoAcceptIncomingRequestsL()

private: void DoAcceptIncomingRequestsL(CStoreableOverrideSettings& aOverrides, TRequestStatus& aStatus);

Description

This member is internal and not intended for use.

Parameters

CStoreableOverrideSettings& aOverrides

TRequestStatus& aStatus


PackageOverridesArray()

private: void PackageOverridesArray(TAny* aPtr, TInt aPtrNum, CStoreableOverrideSettings& aOverrides);

Description

This member is internal and not intended for use.

Parameters

TAny* aPtr

No description.

TInt aPtrNum

No description.

CStoreableOverrideSettings& aOverrides


Data

iNewISPId


private: TPckg<TUint32> iNewISPId;

Description