CATExtPluginBase Class Reference

class CATExtPluginBase : public CBase

The base class for implementing AT Extension Plugin.

A concrete AT Extension Plugin must implement this class as an ECom plugin, and it must be ready once it has been instantiated.

The interface UID of the plugin resource must use the value defined in atext_interfaceuid.h.

atextpluginbase.lib
Since
S60 v5.0

Inherits from

Constructor & Destructor Documentation

~CATExtPluginBase()

IMPORT_C ~CATExtPluginBase ( ) [virtual]

Destructor

Member Functions Documentation

GetNextPartOfReply(RBuf8 &)

TInt GetNextPartOfReply ( RBuf8 & aNextReply ) [pure virtual]

Gets the next part of reply initially set by HandleCommandComplete(). Length of aNextReply must be equal or less than KDefaultCmdBufLength.

Since
S60 5.0

Parameters

RBuf8 & aNextReply Next reply

GetSupportedCommands(RPointerArray< HBufC8 > &)

IMPORT_C TInt GetSupportedCommands ( RPointerArray < HBufC8 > & aCmds ) [protected]

Called by concrete extension plugin to inform the array of supported commands should be returned

Since
S60 5.0

Parameters

RPointerArray < HBufC8 > & aCmds

HandleCommand(const TDesC8 &, RBuf8 &, TBool)

void HandleCommand ( const TDesC8 & aCmd,
RBuf8 & aReply,
TBool aReplyNeeded
) [pure virtual]

Handles an AT command. Cancelling of the pending request is done by HandleCommandCancel() . The implementation in the extension plugin should be asynchronous.

The extension plugin which accepts this command is responsible to supply the result codes and response and to format result codes properly, e.g. in BT HFP case, the format should be <cr><lf><result code>=""><cr><lf>

After an extension plugin has handled or decided to reject the given AT command, it must inform ATEXT by HandleCommandCompleted() with a proper error code.

Note that in editor mode the setting of aReplyNeeded is always "ETrue" when a plugin processing the editor mode meets the end condition for the editor mode (!EReplyTypeEditor reply in editor mode). In this case the plugin must create the last reply even when aReplyNeeded is EFalse.

Since
S60 5.0

Parameters

const TDesC8 & aCmd The AT command to be handled. Its format may vary depending on the specification. E.g. in BT HFP case, the command may contain a character carriage return (<cr>) in the end.
RBuf8 & aReply When passed in, contains the built in answer filled by ATEXT if it is not empty; when command handling completes successfully, contains the result codes and responses to this command; Its ownership always belongs to ATEXT, plugin may reallocate its space when needed.
TBool aReplyNeeded Reply needed if ETrue, no reply otherwise. If EFalse, the aReply must not contain the reply, otherwise it must contain verbose or numeric reply (ATV0/1) or an empty string reply (with ATQ).

HandleCommandCancel()

void HandleCommandCancel ( ) [pure virtual]

Cancels a pending HandleCommand request.

Since
S60 5.0

HandleCommandCompleted(TInt, TATExtensionReplyType)

IMPORT_C TInt HandleCommandCompleted ( TInt aError,
TATExtensionReplyType aReplyType
) [protected]

Called by concrete extension plugin to inform that a command handling has been completed or rejected. Instructs ATEXT to complete client request message for HandleCommand() .

Since
S60 5.0

Parameters

TInt aError Completion code
TATExtensionReplyType aReplyType Reply type for the handled AT command

IsCommandSupported(const TDesC8 &)

TBool IsCommandSupported ( const TDesC8 & aCmd ) [pure virtual]

Reports the support status of an AT command. This is a synchronous API.

Parameters

const TDesC8 & aCmd The AT command. Its format may vary depending on the specification. E.g. in BT HFP case, the command may contain a character carriage return (<cr>) in the end.

NewL(TUid, MATExtPluginObserver &, const TDesC8 &)

IMPORT_C CATExtPluginBase * NewL ( TUid aImplementationUid,
MATExtPluginObserver & aObserver,
const TDesC8 & aName
) [static]

Instantiate the AT Extension Plugin via ECom framework.

Since
S60 5.0

Parameters

TUid aImplementationUid The implementation UID of the plugin
MATExtPluginObserver & aObserver The reference of ATEXT observer interface
const TDesC8 & aName Connection name to report to extension plugin

NextReplyPartLength()

TInt NextReplyPartLength ( ) [pure virtual]

Next reply part's length. The value must be equal or less than KDefaultCmdBufLength. When the reply from this method is zero, ATEXT stops calling GetNextPartOfReply() .

Since
S60 5.0

ReceiveUnsolicitedResult()

void ReceiveUnsolicitedResult ( ) [pure virtual]

Receives unsolicited results. Cancelling of the pending request is done by ReceiveUnsolicitedResultCancel() . The implementation in the extension plugin should be asynchronous.

Since
S60 5.0

ReceiveUnsolicitedResultCancel()

void ReceiveUnsolicitedResultCancel ( ) [pure virtual]

Cancels a pending ReceiveUnsolicitedResult request.

Since
S60 5.0

ReportCharacterChange(TATExtensionCharType, TInt8)

IMPORT_C TInt ReportCharacterChange ( TATExtensionCharType aCharType,
TInt8 aNewChar
)

Reports change to a value of a character

Since
S60 5.0

Parameters

TATExtensionCharType aCharType New character's type
TInt8 aNewChar New character value

ReportConnectionName(const TDesC8 &)

void ReportConnectionName ( const TDesC8 & aName ) [pure virtual]

Reports connection identifier name to the extension plugin.

Since
S60 5.0

Parameters

const TDesC8 & aName Connection identifier name

ReportExternalHandleCommandError()

void ReportExternalHandleCommandError ( ) [pure virtual]

Reports about external handle command error condition. This is for cases when for example DUN decided the reply contained an error condition but the plugin is still handling the command internally. Example: in command line "AT+TEST;ATDT1234" was given. "AT+TEST" returns "OK" and "ATDT" returns "CONNECT". Because "OK" and "CONNECT" are different reply types the condition is "ERROR" and DUN ends processing. This solution keeps the pointer to the last AT command handling plugin inside ATEXT and calls this function there to report the error. It is to be noted that HandleCommandCancel() is not sufficient to stop the processing as the command handling has already finished.

Since
S60 5.0

ReportNvramStatusChange(const TDesC8 &)

void ReportNvramStatusChange ( const TDesC8 & aNvram ) [pure virtual]

Reports NVRAM status change to the plugins.

Since
S60 5.0

Parameters

const TDesC8 & aNvram New NVRAM status. Each call of this function is a result of DUN extracting the form notified by CATExtCommonBase::SendNvramStatusChange(). Each of the settings from SendNvramStatusChange() is separated to one call of ReportNvramStatusChange().

ReportQuietModeChange(TBool)

IMPORT_C void ReportQuietModeChange ( TBool aMode )

Reports change to quiet mode. The quiet mode is off by default.

Since
S60 5.0

Parameters

TBool aMode ETrue if quiet mode changed on, EFalse if off

ReportVerboseModeChange(TBool)

IMPORT_C void ReportVerboseModeChange ( TBool aMode )

Reports change to verbose mode. The verbose mode is on by default.

Since
S60 5.0

Parameters

TBool aMode ETrue if verbose mode changed on, EFalse if off

SendUnsolicitedResult(const TDesC8 &)

IMPORT_C TInt SendUnsolicitedResult ( const TDesC8 & aAT ) [protected]

Called by concrete extension plugin when there is an unsolicited result code should be sent to remote device. Instructs ATEXT to complete client request message for ReceiveUnsolicitedResult() .

The extension plugin which accepts this command is responsible to supply the result codes and response. The responses must be formatted to the format set by ATS3 and ATS4 commands or the format included in ReportNvramStatusChange() API call.

Since
S60 5.0

Parameters

const TDesC8 & aAT the unsolicited result code to be sent.

SetObserver(MATExtPluginObserver &)

IMPORT_C void SetObserver ( MATExtPluginObserver & aObserver ) [private]

Sets the observer.

Since
S60 5.0

Parameters

MATExtPluginObserver & aObserver the observer.

Member Data Documentation

TChar iBackspace

TChar iBackspace [protected]

Character for backspace

TChar iCarriageReturn

TChar iCarriageReturn [protected]

Character for carriage return

TUid iInstanceUid

TUid iInstanceUid [private]

UID set by ECOM when the instance is created. Used when the instance is destroyed.

TChar iLineFeed

TChar iLineFeed [protected]

Character for line feed

MATExtPluginObserver * iObserver

MATExtPluginObserver * iObserver [private]

The reference of ATEXT interface

TBool iQuietMode

TBool iQuietMode [protected]

Flag indicating whether quiet mode is on or off (ATQ)

TBool iVerboseMode

TBool iVerboseMode [protected]

Flag indicating whether verbose mode is on or off (ATV)