CNifAgentBase Class Reference

class CNifAgentBase : public CBase

Base class for agents. All agents derive from this base class; either directly or via another class that offers additional functionality. CAgentBase ; CStateMachineAgentBase (for v6.1 agx porting)since v9.5. Use MCPRs/CPRs/SCPRs instead of agents.

Inherits from

Public Member Functions
CNifAgentBase ()
void Authenticate ( TDes &, TDes &)
void CancelAuthenticate ()
void CancelConnect ()
void CancelReconnect ()
void CancelRequestNotificationOfServiceChange ( MAgentSessionNotify *)
IMPORT_C TInt CheckReadCapability (const TDesC &, const RMessagePtr2 *)
IMPORT_C TInt CheckWriteCapability (const TDesC &, const RMessagePtr2 *)
void Connect ( TAgentConnectType )
void Connect ( TAgentConnectType , CStoreableOverrideSettings *)
TConnectionSettings & ConnectionSettingsL ()
IMPORT_C TInt Control ( TUint , TUint , TDes8 &)
IMPORT_C TInt Control ( TUint , TUint , TDes8 &, const RProcess &)
void Disconnect ( TInt )
TInt GetExcessData ( TDes8 &)
void GetLastError ( TInt &)
TInt IncomingConnectionReceived ()
void Info ( TNifAgentInfo &)
TBool IsActive ()
TBool IsReconnect ()
TInt Notification ( TNifToAgentEventType , TAny *)
CStoreableOverrideSettings * OverridesL ()
IMPORT_C TInt ReadBool (const TDesC &, TBool &, const RMessagePtr2 *)
IMPORT_C TInt ReadBool (const TDesC &, TBool &)
IMPORT_C TInt ReadDes (const TDesC &, TDes8 &, const RMessagePtr2 *)
IMPORT_C TInt ReadDes (const TDesC &, TDes8 &)
IMPORT_C TInt ReadDes (const TDesC &, TDes16 &, const RMessagePtr2 *)
IMPORT_C TInt ReadDes (const TDesC &, TDes16 &)
IMPORT_C TInt ReadInt (const TDesC &, TUint32 &, const RMessagePtr2 *)
IMPORT_C TInt ReadInt (const TDesC &, TUint32 &)
IMPORT_C HBufC * ReadLongDesLC (const TDesC &, const RMessagePtr2 *)
IMPORT_C HBufC * ReadLongDesLC (const TDesC &)
void Reconnect ()
void RequestNotificationOfServiceChangeL ( MAgentSessionNotify *)
void SetConnectionSettingsL (const TConnectionSettings &)
void SetOverridesL ( CStoreableOverrideSettings *)
IMPORT_C TInt WriteBool (const TDesC &, TBool , const RMessagePtr2 *)
IMPORT_C TInt WriteBool (const TDesC &, TBool )
IMPORT_C TInt WriteDes (const TDesC &, const TDesC8 &, const RMessagePtr2 *)
IMPORT_C TInt WriteDes (const TDesC &, const TDesC8 &)
IMPORT_C TInt WriteDes (const TDesC &, const TDesC16 &, const RMessagePtr2 *)
IMPORT_C TInt WriteDes (const TDesC &, const TDesC16 &)
IMPORT_C TInt WriteInt (const TDesC &, TUint32 , const RMessagePtr2 *)
IMPORT_C TInt WriteInt (const TDesC &, TUint32 )
Protected Member Functions
IMPORT_C TInt DoCheckReadCapability (const TDesC &, const RMessagePtr2 *)
IMPORT_C TInt DoCheckWriteCapability (const TDesC &, const RMessagePtr2 *)
TInt DoReadBool (const TDesC &, TBool &, const RMessagePtr2 *)
TInt DoReadDes (const TDesC &, TDes8 &, const RMessagePtr2 *)
TInt DoReadDes (const TDesC &, TDes16 &, const RMessagePtr2 *)
TInt DoReadInt (const TDesC &, TUint32 &, const RMessagePtr2 *)
HBufC * DoReadLongDesLC (const TDesC &, const RMessagePtr2 *)
TInt DoWriteBool (const TDesC &, TBool , const RMessagePtr2 *)
TInt DoWriteDes (const TDesC &, const TDesC8 &, const RMessagePtr2 *)
TInt DoWriteDes (const TDesC &, const TDesC16 &, const RMessagePtr2 *)
TInt DoWriteInt (const TDesC &, TUint32 , const RMessagePtr2 *)
Private Member Functions
TBool CheckControlPolicy ( TUint , TUint , const RProcess &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Protected Attributes
MNifAgentNotify * iNotify

Constructor & Destructor Documentation

CNifAgentBase()

IMPORT_C CNifAgentBase ( )

Constructor

Member Functions Documentation

Authenticate(TDes &, TDes &)

void Authenticate ( TDes & aUsername,
TDes & aPassword
) [pure virtual]

Parameters

TDes & aUsername
TDes & aPassword

CancelAuthenticate()

void CancelAuthenticate ( ) [pure virtual]

CancelConnect()

void CancelConnect ( ) [pure virtual]

CancelReconnect()

void CancelReconnect ( ) [pure virtual]

CancelRequestNotificationOfServiceChange(MAgentSessionNotify *)

void CancelRequestNotificationOfServiceChange ( MAgentSessionNotify * aSession ) [pure virtual]

Parameters

MAgentSessionNotify * aSession

CheckControlPolicy(TUint, TUint, const RProcess &)

TBool CheckControlPolicy ( TUint aLevel,
TUint aOption,
const RProcess & aProcess
) [private]

Check that a client has the required capabilties

Parameters

TUint aLevel
TUint aOption
const RProcess & aProcess

CheckReadCapability(const TDesC &, const RMessagePtr2 *)

IMPORT_C TInt CheckReadCapability ( const TDesC & aField,
const RMessagePtr2 * aMessage
)

Check that a client has the required capabilities to read a field Ensure that a client has the required capabilites to read a field

Parameters

const TDesC & aField Field Name
const RMessagePtr2 * aMessage Contains client capabilites to validate

CheckWriteCapability(const TDesC &, const RMessagePtr2 *)

IMPORT_C TInt CheckWriteCapability ( const TDesC & aField,
const RMessagePtr2 * aMessage
)

Check that a client has the required capabilities to write a field Ensure that a client has the required capabilites to write a field

Parameters

const TDesC & aField Field Name
const RMessagePtr2 * aMessage Contains client capabilites to validate

Connect(TAgentConnectType)

void Connect ( TAgentConnectType aType ) [pure virtual]

Parameters

TAgentConnectType aType

Connect(TAgentConnectType, CStoreableOverrideSettings *)

void Connect ( TAgentConnectType aType,
CStoreableOverrideSettings * aOverrideSettings
) [pure virtual]

Parameters

TAgentConnectType aType
CStoreableOverrideSettings * aOverrideSettings

ConnectionSettingsL()

TConnectionSettings & ConnectionSettingsL ( ) [pure virtual]

Control(TUint, TUint, TDes8 &)

IMPORT_C TInt Control ( TUint aOptionLevel,
TUint aOptionName,
TDes8 & aOption
) [virtual]

This version of the Control(TUint, TUint, TDes8&) function is now deprecated. DO NOT Override Use the version of CNifAgentBase::Control(TUint, TUint, TDes8&, RProcess) that takes four parameters

This version of the Control() function is now deprecated. Use the version of CNifAgentBase::Control() that takes four parameters

Parameters

TUint aOptionLevel
TUint aOptionName
TDes8 & aOption

Control(TUint, TUint, TDes8 &, const RProcess &)

IMPORT_C TInt Control ( TUint aOptionLevel,
TUint aOptionName,
TDes8 & aOption,
const RProcess & aProcess
) [virtual]

Control() with capability checking

Parameters

TUint aOptionLevel
TUint aOptionName
TDes8 & aOption
const RProcess & aProcess

Disconnect(TInt)

void Disconnect ( TInt aReason ) [pure virtual]

Parameters

TInt aReason

DoCheckReadCapability(const TDesC &, const RMessagePtr2 *)

IMPORT_C TInt DoCheckReadCapability ( const TDesC & aField,
const RMessagePtr2 * aMessage
) [protected, virtual]

Check that a client has the required capabilties to read a field Ensure that a client has the required capabilites to read a field

Parameters

const TDesC & aField Field Name
const RMessagePtr2 * aMessage Contains client capabilites to validate

DoCheckWriteCapability(const TDesC &, const RMessagePtr2 *)

IMPORT_C TInt DoCheckWriteCapability ( const TDesC & aField,
const RMessagePtr2 * aMessage
) [protected, virtual]

Check that a client has the required capabilties to write a field Ensure that a client has the required capabilites to write a field

Parameters

const TDesC & aField Field Name
const RMessagePtr2 * aMessage Contains client capabilites to validate

DoReadBool(const TDesC &, TBool &, const RMessagePtr2 *)

TInt DoReadBool ( const TDesC & aField,
TBool & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Read an boolean field from the connection settings provider

Parameters

const TDesC & aField The name of the field to read
TBool & aValue On return, contains the value of the field read
const RMessagePtr2 * aMessage

DoReadDes(const TDesC &, TDes8 &, const RMessagePtr2 *)

TInt DoReadDes ( const TDesC & aField,
TDes8 & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Read a 8-bit descriptor field from the connection settings provider

Parameters

const TDesC & aField The name of the field to read
TDes8 & aValue On return, contains the value of the field read
const RMessagePtr2 * aMessage

DoReadDes(const TDesC &, TDes16 &, const RMessagePtr2 *)

TInt DoReadDes ( const TDesC & aField,
TDes16 & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Write an 8-bit descriptor field to the connection settings provider

Parameters

const TDesC & aField The name of the field to which to write
TDes16 & aValue The value to be written to the field
const RMessagePtr2 * aMessage

DoReadInt(const TDesC &, TUint32 &, const RMessagePtr2 *)

TInt DoReadInt ( const TDesC & aField,
TUint32 & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Read an integer field from the connection settings provider

Parameters

const TDesC & aField The name of the field to read
TUint32 & aValue On return, contains the value of the field read
const RMessagePtr2 * aMessage

DoReadLongDesLC(const TDesC &, const RMessagePtr2 *)

HBufC * DoReadLongDesLC ( const TDesC & aField,
const RMessagePtr2 * aMessage
) [protected, pure virtual]
Read a 16-bit descriptor field of unknown size from the connection settings provider
Since
v7.0s

Parameters

const TDesC & aField The name of the field to read
const RMessagePtr2 * aMessage

DoWriteBool(const TDesC &, TBool, const RMessagePtr2 *)

TInt DoWriteBool ( const TDesC & aField,
TBool aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Write an boolean field to the connection settings provider

Parameters

const TDesC & aField The name of the field to which to write
TBool aValue The value to be written to the field
const RMessagePtr2 * aMessage

DoWriteDes(const TDesC &, const TDesC8 &, const RMessagePtr2 *)

TInt DoWriteDes ( const TDesC & aField,
const TDesC8 & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Read a 16-bit descriptor field from the connection settings provider

Parameters

const TDesC & aField The name of the field to read
const TDesC8 & aValue On return, contains the value of the field read
const RMessagePtr2 * aMessage

DoWriteDes(const TDesC &, const TDesC16 &, const RMessagePtr2 *)

TInt DoWriteDes ( const TDesC & aField,
const TDesC16 & aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Write an 16-bit descriptor field to the connection settings provider

Parameters

const TDesC & aField The name of the field to which to write
const TDesC16 & aValue The value to be written to the field
const RMessagePtr2 * aMessage

DoWriteInt(const TDesC &, TUint32, const RMessagePtr2 *)

TInt DoWriteInt ( const TDesC & aField,
TUint32 aValue,
const RMessagePtr2 * aMessage
) [protected, pure virtual]

Write an integer field to the connection settings provider

Parameters

const TDesC & aField The name of the field to which to write
TUint32 aValue The value to be written to the field
const RMessagePtr2 * aMessage

GetExcessData(TDes8 &)

TInt GetExcessData ( TDes8 & aBuffer ) [pure virtual]

Return any excess data was received during connection setup

Parameters

TDes8 & aBuffer On return, the buffer contains the excess data from the agent

GetLastError(TInt &)

void GetLastError ( TInt & aError ) [pure virtual]

Parameters

TInt & aError

IncomingConnectionReceived()

TInt IncomingConnectionReceived ( ) [pure virtual]

Info(TNifAgentInfo &)

void Info ( TNifAgentInfo & aInfo ) const [pure virtual]

Parameters

TNifAgentInfo & aInfo

IsActive()

TBool IsActive ( ) const [pure virtual]

IsReconnect()

TBool IsReconnect ( ) const [pure virtual]

Notification(TNifToAgentEventType, TAny *)

TInt Notification ( TNifToAgentEventType aEvent,
TAny * aInfo
) [pure virtual]
Notification of an event from the nif
Since
v6.1

Parameters

TNifToAgentEventType aEvent The type of event that occured
TAny * aInfo Any data associated with the event

OverridesL()

CStoreableOverrideSettings * OverridesL ( ) [pure virtual]

ReadBool(const TDesC &, TBool &, const RMessagePtr2 *)

IMPORT_C TInt ReadBool ( const TDesC & aField,
TBool & aValue,
const RMessagePtr2 * aMessage
)

Read an boolean field from the connection settings provider Read a boolean value

Parameters

const TDesC & aField Field name
TBool & aValue Returned value
const RMessagePtr2 * aMessage For capability checking

ReadBool(const TDesC &, TBool &)

IMPORT_C TInt ReadBool ( const TDesC & aField,
TBool & aValue
)

Read a boolean value

Parameters

const TDesC & aField Field name
TBool & aValue Returned value

ReadDes(const TDesC &, TDes8 &, const RMessagePtr2 *)

IMPORT_C TInt ReadDes ( const TDesC & aField,
TDes8 & aValue,
const RMessagePtr2 * aMessage
)

Read a descriptor field from the connection settings provider Read a descriptor

Parameters

const TDesC & aField The field name
TDes8 & aValue Returned value
const RMessagePtr2 * aMessage For capability checking

ReadDes(const TDesC &, TDes8 &)

IMPORT_C TInt ReadDes ( const TDesC & aField,
TDes8 & aValue
)

Read a descriptor

Parameters

const TDesC & aField The field name
TDes8 & aValue Returned value

ReadDes(const TDesC &, TDes16 &, const RMessagePtr2 *)

IMPORT_C TInt ReadDes ( const TDesC & aField,
TDes16 & aValue,
const RMessagePtr2 * aMessage
)

Read a descriptor field from the connection settings provider Read a descriptor

Parameters

const TDesC & aField The field name
TDes16 & aValue Returned value
const RMessagePtr2 * aMessage For capability checking

ReadDes(const TDesC &, TDes16 &)

IMPORT_C TInt ReadDes ( const TDesC & aField,
TDes16 & aValue
)

Read a descriptor

Parameters

const TDesC & aField The field name
TDes16 & aValue Returned value

ReadInt(const TDesC &, TUint32 &, const RMessagePtr2 *)

IMPORT_C TInt ReadInt ( const TDesC & aField,
TUint32 & aValue,
const RMessagePtr2 * aMessage
)

Read an integer field from the connection settings provider Read an integer

Parameters

const TDesC & aField The field name
TUint32 & aValue Returned value
const RMessagePtr2 * aMessage For capability checking

ReadInt(const TDesC &, TUint32 &)

IMPORT_C TInt ReadInt ( const TDesC & aField,
TUint32 & aValue
)

Read an integer

Parameters

const TDesC & aField The field name
TUint32 & aValue Returned value

ReadLongDesLC(const TDesC &, const RMessagePtr2 *)

IMPORT_C HBufC * ReadLongDesLC ( const TDesC & aField,
const RMessagePtr2 * aMessage
)
Read a descriptor field of unknown size from the connection settings provider
Since
v7.0s
Read a long descriptor value

Parameters

const TDesC & aField Field name
const RMessagePtr2 * aMessage For capability checking

ReadLongDesLC(const TDesC &)

IMPORT_C HBufC * ReadLongDesLC ( const TDesC & aField )

Read a long descriptor value

Parameters

const TDesC & aField Field name

Reconnect()

void Reconnect ( ) [pure virtual]

RequestNotificationOfServiceChangeL(MAgentSessionNotify *)

void RequestNotificationOfServiceChangeL ( MAgentSessionNotify * aSession ) [pure virtual]

Parameters

MAgentSessionNotify * aSession

SetConnectionSettingsL(const TConnectionSettings &)

void SetConnectionSettingsL ( const TConnectionSettings & aSettings ) [pure virtual]

Parameters

const TConnectionSettings & aSettings

SetOverridesL(CStoreableOverrideSettings *)

void SetOverridesL ( CStoreableOverrideSettings * aOverrideSettings ) [pure virtual]

Parameters

CStoreableOverrideSettings * aOverrideSettings

WriteBool(const TDesC &, TBool, const RMessagePtr2 *)

IMPORT_C TInt WriteBool ( const TDesC & aField,
TBool aValue,
const RMessagePtr2 * aMessage
)

Write an boolean field to the connection settings provider Write a boolean value

Parameters

const TDesC & aField Field name
TBool aValue Value to write
const RMessagePtr2 * aMessage for capability checking

WriteBool(const TDesC &, TBool)

IMPORT_C TInt WriteBool ( const TDesC & aField,
TBool aValue
)

Write a boolean value

Parameters

const TDesC & aField Field name
TBool aValue Value to write

WriteDes(const TDesC &, const TDesC8 &, const RMessagePtr2 *)

IMPORT_C TInt WriteDes ( const TDesC & aField,
const TDesC8 & aValue,
const RMessagePtr2 * aMessage
)

Write a descriptor field to the connection settings provider Write a descriptor

Parameters

const TDesC & aField The field name
const TDesC8 & aValue value to write
const RMessagePtr2 * aMessage For capability checking

WriteDes(const TDesC &, const TDesC8 &)

IMPORT_C TInt WriteDes ( const TDesC & aField,
const TDesC8 & aValue
)

Write a descriptor

Parameters

const TDesC & aField The field name
const TDesC8 & aValue value to write

WriteDes(const TDesC &, const TDesC16 &, const RMessagePtr2 *)

IMPORT_C TInt WriteDes ( const TDesC & aField,
const TDesC16 & aValue,
const RMessagePtr2 * aMessage
)

Write a descriptor field to the connection settings provider Write a descriptor

Parameters

const TDesC & aField The field name
const TDesC16 & aValue value to write
const RMessagePtr2 * aMessage For capability checking

WriteDes(const TDesC &, const TDesC16 &)

IMPORT_C TInt WriteDes ( const TDesC & aField,
const TDesC16 & aValue
)

Write a descriptor

Parameters

const TDesC & aField The field name
const TDesC16 & aValue value to write

WriteInt(const TDesC &, TUint32, const RMessagePtr2 *)

IMPORT_C TInt WriteInt ( const TDesC & aField,
TUint32 aValue,
const RMessagePtr2 * aMessage
)

Write an integer field to the connection settings provider Write an integer

Parameters

const TDesC & aField The field name
TUint32 aValue The value
const RMessagePtr2 * aMessage For capability checking

WriteInt(const TDesC &, TUint32)

IMPORT_C TInt WriteInt ( const TDesC & aField,
TUint32 aValue
)

Write an integer

Parameters

const TDesC & aField The field name
TUint32 aValue The value

Member Data Documentation

MNifAgentNotify * iNotify

MNifAgentNotify * iNotify [protected]