CGenericHid Class Reference

class CGenericHid : public CHidTransport

Generic HID main class Generic HID layer, allowing the HID Transport layers and device drivers to pass data to the Generic HID

generichid.lib
Since
S60 v5.0

Inherits from

Public Member Functions
~CGenericHid ()
void CommandResult ( TInt , TInt )
TInt ConnectedL ( TInt , const TDesC8 &)
TUint CountryCodeL ( TInt )
TInt DataIn ( TInt , CHidTransport::THidChannelType , const TDesC8 &)
void DataOutL ( TInt , TUint8 , const TDesC8 &, TUint16 )
TInt Disconnected ( TInt )
TInt DriverActive ( TInt , CHidTransport::TDriverState )
void GetIdleL ( TInt , TUint8 , TUint16 )
void GetProtocolL ( TInt , TUint16 )
void GetReportL ( TInt , TUint8 , TUint16 , TUint16 )
IMPORT_C CGenericHid * NewL ( MTransportLayer *)
IMPORT_C CGenericHid * NewLC ( MTransportLayer *)
TUint ProductIdL ( TInt )
CReportRoot * ReportDescriptor ( TInt )
void SetIdleL ( TInt , TUint8 , TUint8 , TUint16 , CHidDriver *)
void SetProtocolL ( TInt , TUint16 , MDriverAccess::TProtocols , CHidDriver *)
void SetReportL ( TInt , TUint8 , MDriverAccess::TReportType , const TDesC8 &, TUint16 , CHidDriver *)
TUint VendorIdL ( TInt )
Protected Member Functions
CGenericHid ( MTransportLayer *)
void ConstructL ()
Private Member Functions
void RemoveDrivers ()
CConnectionInfo * SeekConnectionInfo ( TInt )
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()
Inherited Enumerations
CHidTransport:TDriverState
CHidTransport:THidChannelType
Private Attributes
RPointerArray < CConnectionInfo > iConnectionInfo
TSglQue < CDriverListItem > iDriverList
CHidInputDataHandlingReg * iInputHandlingReg
CParser * iParser
MTransportLayer * iTransportLayer

Constructor & Destructor Documentation

CGenericHid(MTransportLayer *)

CGenericHid ( MTransportLayer * aTransportLayer ) [protected]

Parameters

MTransportLayer * aTransportLayer

~CGenericHid()

~CGenericHid ( ) [virtual]

Member Functions Documentation

CommandResult(TInt, TInt)

void CommandResult ( TInt aConnectionId,
TInt aCmdAck
) [virtual]

From class CHidTransport Called by the transport layers to inform the generic HID of the success of the last Set... command.

Since
S60 v5.0

Parameters

TInt aConnectionId The device ID
TInt aCmdAck Status of the last Set... command

ConnectedL(TInt, const TDesC8 &)

TInt ConnectedL ( TInt aConnectionId,
const TDesC8 & aDescriptor
) [virtual]

From class CHidTransport Called by a transport layer when a device has connected and the report descriptors have been obtained

Since
S60 v5.0

Parameters

TInt aConnectionId The tansport-layer enumeration for the connection
const TDesC8 & aDescriptor The report descriptor for the connected HID device

ConstructL()

void ConstructL ( ) [protected]

CountryCodeL(TInt)

TUint CountryCodeL ( TInt aConnectionID )

Fromm class MDriverAccess Retrieves the country code for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionID The device identifier

DataIn(TInt, CHidTransport::THidChannelType, const TDesC8 &)

TInt DataIn ( TInt aConnectionId,
CHidTransport::THidChannelType aChannel,
const TDesC8 & aPayload
) [virtual]

From class CHidTransport Called by the transport layer when a device has sent a report on the interrupt or control channel

Since
S60 v5.0

Parameters

TInt aConnectionId The tansport-layer enumeration for the connection
CHidTransport::THidChannelType aChannel Channel ID (Interrupt or Control)
const TDesC8 & aPayload The complete report payload

DataOutL(TInt, TUint8, const TDesC8 &, TUint16)

void DataOutL ( TInt aConnectionId,
TUint8 aReportId,
const TDesC8 & aPayload,
TUint16 aInterface
)

Fromm class MDriverAccess A request to send a report payload to the HID device in Interrupt Channel Leaves whit KErrInUse The request was not successful because the transport layer is busy with previous request and KErrNotReady The request failed because the device is currently unavailable

Since
S60 v5.0

Parameters

TInt aConnectionId The device ID
TUint8 aReportId report id which payload to be send
const TDesC8 & aPayload The report containing the device setup packet
TUint16 aInterface The device interface being used by the driver

Disconnected(TInt)

TInt Disconnected ( TInt aConnectionId ) [virtual]

From class CHidTransport Called by a transport layer when a device has been disconnected

Since
S60 v5.0

Parameters

TInt aConnectionId The tansport-layer enumeration for the connection

DriverActive(TInt, CHidTransport::TDriverState)

TInt DriverActive ( TInt aConnectionId,
CHidTransport::TDriverState aActive
) [virtual]

From class CHidTransport Called by the transport layer to suspend or resume a driver

Since
S60 v5.0

Parameters

TInt aConnectionId The tansport-layer enumeration for the connection
CHidTransport::TDriverState aActive EActive to start the driver(s), ESuspend to suspend

GetIdleL(TInt, TUint8, TUint16)

void GetIdleL ( TInt aConnectionId,
TUint8 aReportId,
TUint16 aInterface
)

Fromm class MDriverAccess Request for the current idle setting for the device This is an asynchronous request. The idle value will come through at a later time. Leaves whit KErrInUse The request was not successful because the transport layer is busy with previous request and KErrNotReady The request failed because the device is currently unavailable

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier
TUint8 aReportId The report ID for which we want the idle rate
TUint16 aInterface The device interface being used by the driver

GetProtocolL(TInt, TUint16)

void GetProtocolL ( TInt aConnectionId,
TUint16 aInterface
)

Fromm class MDriverAccess Requests the current protocol from the HID device. This is an asynchronous request. The protocol value will come through at a later time

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier
TUint16 aInterface The hid interface

GetReportL(TInt, TUint8, TUint16, TUint16)

void GetReportL ( TInt aConnectionId,
TUint8 aReportId,
TUint16 aInterface,
TUint16 aLength
)

Fromm class MDriverAccess A request for a report from the device. This is an asynchronous request. The report will come through at a later time

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier
TUint8 aReportId report id to be get
TUint16 aInterface The device interface being used by the driver
TUint16 aLength report lenght

NewL(MTransportLayer *)

IMPORT_C CGenericHid * NewL ( MTransportLayer * aTransportLayer ) [static]

Constructs a generic HID layer with a reference to the owner so commands can be sent to connected devices

Since
S60 v5.0

Parameters

MTransportLayer * aTransportLayer The owning transport layer

NewLC(MTransportLayer *)

IMPORT_C CGenericHid * NewLC ( MTransportLayer * aTransportLayer ) [static]

Constructs a generic HID layer with a reference to the owner so commands can be sent to connected devices

Since
S60 v5.0

Parameters

MTransportLayer * aTransportLayer The owning transport layer

ProductIdL(TInt)

TUint ProductIdL ( TInt aConnectionId )

Fromm class MDriverAccess Retrieves the product identifier for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier

RemoveDrivers()

void RemoveDrivers ( ) [private]

Remove drivers

Since
S60 v5.0

ReportDescriptor(TInt)

CReportRoot * ReportDescriptor ( TInt aConnectionId )

From class MDriverAccess Gives the device driver access to the results of the report descriptor parsing

Since
S60 v5.0

Parameters

TInt aConnectionId The device ID

SeekConnectionInfo(TInt)

CConnectionInfo * SeekConnectionInfo ( TInt aConnectionId ) [private]

Attempts to find a driver that is handling reports from the HID device

Since
S60 v5.0

Parameters

TInt aConnectionId

SetIdleL(TInt, TUint8, TUint8, TUint16, CHidDriver *)

void SetIdleL ( TInt aConnectionId,
TUint8 aDuration,
TUint8 aReportId,
TUint16 aInterface,
CHidDriver * aDriver
)

Fromm class MDriverAccess Request to the HID device to set the specified idle rate A request to send a report payload to the HID device Leaves whit KErrInUse The request was not successful because the transport layer is busy with previous request and KErrNotReady The request failed because the device is currently unavailable

Since
S60 v5.0

Parameters

TInt aConnectionId The device ID
TUint8 aDuration The number of 0.04ms intervals to wait between reports
TUint8 aReportId The report for which the idle rate is being set
TUint16 aInterface The device interface being used by the driver aDriver Calling driver
CHidDriver * aDriver

SetProtocolL(TInt, TUint16, MDriverAccess::TProtocols, CHidDriver *)

void SetProtocolL ( TInt aConnectionId,
TUint16 aInterface,
MDriverAccess::TProtocols aProtocol,
CHidDriver * aDriver
)

Fromm class MDriverAccess Sets the protocol to be used for reports. Leaves KErrInUse The request was not successful because the transport layer is busy with a previous request, KErrNotReady The request failed because the device is currently unavailable and KErrNotFound The request was unsuccessful

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier
TUint16 aInterface The device interface being used by the driver
MDriverAccess::TProtocols aProtocol The requested report protocol (boot or report) aDriver Calling driver
CHidDriver * aDriver

SetReportL(TInt, TUint8, MDriverAccess::TReportType, const TDesC8 &, TUint16, CHidDriver *)

void SetReportL ( TInt aConnectionId,
TUint8 aReportId,
MDriverAccess::TReportType aReportType,
const TDesC8 & aPayload,
TUint16 aInterface,
CHidDriver * aDriver
)

Fromm class MDriverAccess A request to send a report payload to the HID device Leaves whit KErrInUse The request was not successful because the transport layer is busy with previous request and KErrNotReady The request failed because the device is currently unavailable

Since
S60 v5.0

Parameters

TInt aConnectionId The device ID
TUint8 aReportId The report id
MDriverAccess::TReportType aReportType Type of report (input/output/feature)
const TDesC8 & aPayload The report containing the device setup packet
TUint16 aInterface The device interface being used by the driver aDriver Calling driver
CHidDriver * aDriver

VendorIdL(TInt)

TUint VendorIdL ( TInt aConnectionId )

Fromm class MDriverAccess Retrieves the country code for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionId The device identifier

Member Data Documentation

RPointerArray< CConnectionInfo > iConnectionInfo

RPointerArray < CConnectionInfo > iConnectionInfo [private]

Connection information

TSglQue< CDriverListItem > iDriverList

TSglQue < CDriverListItem > iDriverList [private]

Instantiated driver list

CHidInputDataHandlingReg * iInputHandlingReg

CHidInputDataHandlingReg * iInputHandlingReg [private]

Input data handling registry Own.

CParser * iParser

CParser * iParser [private]

Parser Own.

MTransportLayer * iTransportLayer

MTransportLayer * iTransportLayer [private]

Parser Not own.