Ulogger::MInputPlugin Class Reference

#include <uloggerinputplugin.h>

Link against: uloggerpluginframework.lib

class Ulogger::MInputPlugin

Abstract class for input plug-ins.

Public Attributes
const CPlugin::TPluginInterfaceiInterfaceId
Public Member Functions
virtual ~MInputPlugin()
pure virtual voidCancelReadData()
pure virtual voidCloseInputPlugin()
pure virtual TInt ConfigureInputPlugin(const RPointerArray< TPluginConfiguration > &)
pure virtual TInt ReadData(TRequestStatus &, TDes8 &)
pure virtual TInt SendAcknowledgment(const TDesC8 &)

Detailed Description

A ULogger input plug-in listens for ULogger commands on some communication medium, such as serial, usb or a TCP socket. Whenever a command is received by the input plug-in, it passes this command to ULogger, which then interprets the command, acts on it, and returns a response to the input plug-in. The input plug-in sends any response coming from ULogger back to the client that sent the command in the first place.

All input plug-ins must derive from this class in order to be compatible with ULogger. They must also derive from ULogger::CPlugin (whose header is already included by this header, for convenience) in order to be compatible with the ECom framework, which ULogger uses to load its input plug-ins.

Member Attribute Documentation

iInterfaceId

const CPlugin::TPluginInterfaceiInterfaceId[static]

Input plug-in interface id. This is for ULogger to distinguish between the different types of plug-ins (e.g. Intput vs Output plug-ins).

Constructor & Destructor Documentation

~MInputPlugin ( )

~MInputPlugin()[inline, virtual]

Virtual destructor.

Member Function Documentation

CancelReadData ( )

voidCancelReadData()[pure virtual]

Cancels asynchronous operation issued by ReadData method.

CloseInputPlugin ( )

voidCloseInputPlugin()[pure virtual]

Called by ULogger to indicate that the input plug-in must flush all buffers and release any locked resources. Any resources may be locked only after any other method is called.

ConfigureInputPlugin ( const RPointerArray< TPluginConfiguration > & )

TInt ConfigureInputPlugin(const RPointerArray< TPluginConfiguration > &aConfigs)[pure virtual]

Called by ULogger as first method after construction or after changes in config file. This allows the input plug-in to initialize itself with its private settings.

ParameterDescription
aConfigsactual configurations valid for this instance

Returns: KErrNone, if successful; otherwise one of the other system wide error codes.

ReadData ( TRequestStatus &, TDes8 & )

TInt ReadData(TRequestStatus &aStatus,
TDes8 &aData
)[pure virtual]

Asynchronous method that reads command data from the input medium. ULogger calls this when it's ready to receive command data from the input plug-in. When the input plug-in completes the read operation it notifies the caller via the TRequestStatus that is passed into this method by reference. It provides the command data that has been received in the descriptor that is passed into this method by reference. Input plug-ins typically implement this method by simply passing the TRequestStatus and descriptor arguments on to another asynchronous method, such as for example a socket's ReadOneOrMore method.

ParameterDescription
aStatusThe request status used to contain completion information for the function. On completion, contains a system-wide error code.
aDataA descriptor reference to store data obtained from input channel.

Returns: KErrNone if operation was finished without any problems, system wide error code otherwise.

SendAcknowledgment ( const TDesC8 & )

TInt SendAcknowledgment(const TDesC8 &aData)[pure virtual]

Synchronous Method that sends the given acknowledgment data back to the client that is sending command data to the input plug-in. ULogger calls this method whenever it needs to send a response to a previously received command.

ParameterDescription
aDataA descriptor which contains error code or other results, for example, array of filters. Format of this data depends on previously obtained command.

Returns: KErrNone is send operation finished with success otherwise system wide error code.