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()
voidCommandResult(TInt, TInt)
TInt ConnectedL(TInt, const TDesC8 &)
TUint CountryCodeL(TInt)
TInt DataIn(TInt, CHidTransport::THidChannelType, const TDesC8 &)
voidDataOutL(TInt, TUint8, const TDesC8 &, TUint16)
TInt Disconnected(TInt)
TInt DriverActive(TInt, CHidTransport::TDriverState)
voidGetIdleL(TInt, TUint8, TUint16)
voidGetProtocolL(TInt, TUint16)
voidGetReportL(TInt, TUint8, TUint16, TUint16)
IMPORT_C CGenericHid *NewL(MTransportLayer *)
IMPORT_C CGenericHid *NewLC(MTransportLayer *)
TUint ProductIdL(TInt)
CReportRoot *ReportDescriptor(TInt)
voidSetIdleL(TInt, TUint8, TUint8, TUint16, CHidDriver *)
voidSetProtocolL(TInt, TUint16, MDriverAccess::TProtocols, CHidDriver *)
voidSetReportL(TInt, TUint8, MDriverAccess::TReportType, const TDesC8 &, TUint16, CHidDriver *)
TUint VendorIdL(TInt)
Protected Member Functions
CGenericHid(MTransportLayer *)
voidConstructL()
Private Member Functions
voidRemoveDrivers()
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)

voidCommandResult(TIntaConnectionId,
TIntaCmdAck
)[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 aConnectionIdThe device ID
TInt aCmdAckStatus of the last Set... command

ConnectedL(TInt, const TDesC8 &)

TInt ConnectedL(TIntaConnectionId,
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 aConnectionIdThe tansport-layer enumeration for the connection
const TDesC8 & aDescriptorThe report descriptor for the connected HID device

ConstructL()

voidConstructL()[protected]

CountryCodeL(TInt)

TUint CountryCodeL(TIntaConnectionID)

Fromm class MDriverAccess Retrieves the country code for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionIDThe device identifier

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

TInt DataIn(TIntaConnectionId,
CHidTransport::THidChannelTypeaChannel,
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 aConnectionIdThe tansport-layer enumeration for the connection
CHidTransport::THidChannelType aChannelChannel ID (Interrupt or Control)
const TDesC8 & aPayloadThe complete report payload

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

voidDataOutL(TIntaConnectionId,
TUint8aReportId,
const TDesC8 &aPayload,
TUint16aInterface
)

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 aConnectionIdThe device ID
TUint8 aReportIdreport id which payload to be send
const TDesC8 & aPayloadThe report containing the device setup packet
TUint16 aInterfaceThe device interface being used by the driver

Disconnected(TInt)

TInt Disconnected(TIntaConnectionId)[virtual]

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

Since
S60 v5.0

Parameters

TInt aConnectionIdThe tansport-layer enumeration for the connection

DriverActive(TInt, CHidTransport::TDriverState)

TInt DriverActive(TIntaConnectionId,
CHidTransport::TDriverStateaActive
)[virtual]

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

Since
S60 v5.0

Parameters

TInt aConnectionIdThe tansport-layer enumeration for the connection
CHidTransport::TDriverState aActiveEActive to start the driver(s), ESuspend to suspend

GetIdleL(TInt, TUint8, TUint16)

voidGetIdleL(TIntaConnectionId,
TUint8aReportId,
TUint16aInterface
)

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 aConnectionIdThe device identifier
TUint8 aReportIdThe report ID for which we want the idle rate
TUint16 aInterfaceThe device interface being used by the driver

GetProtocolL(TInt, TUint16)

voidGetProtocolL(TIntaConnectionId,
TUint16aInterface
)

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 aConnectionIdThe device identifier
TUint16 aInterfaceThe hid interface

GetReportL(TInt, TUint8, TUint16, TUint16)

voidGetReportL(TIntaConnectionId,
TUint8aReportId,
TUint16aInterface,
TUint16aLength
)

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 aConnectionIdThe device identifier
TUint8 aReportIdreport id to be get
TUint16 aInterfaceThe device interface being used by the driver
TUint16 aLengthreport 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 * aTransportLayerThe 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 * aTransportLayerThe owning transport layer

ProductIdL(TInt)

TUint ProductIdL(TIntaConnectionId)

Fromm class MDriverAccess Retrieves the product identifier for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionIdThe device identifier

RemoveDrivers()

voidRemoveDrivers()[private]

Remove drivers

Since
S60 v5.0

ReportDescriptor(TInt)

CReportRoot *ReportDescriptor(TIntaConnectionId)

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

Since
S60 v5.0

Parameters

TInt aConnectionIdThe device ID

SeekConnectionInfo(TInt)

CConnectionInfo *SeekConnectionInfo(TIntaConnectionId)[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 *)

voidSetIdleL(TIntaConnectionId,
TUint8aDuration,
TUint8aReportId,
TUint16aInterface,
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 aConnectionIdThe device ID
TUint8 aDurationThe number of 0.04ms intervals to wait between reports
TUint8 aReportIdThe report for which the idle rate is being set
TUint16 aInterfaceThe device interface being used by the driver aDriver Calling driver
CHidDriver * aDriver

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

voidSetProtocolL(TIntaConnectionId,
TUint16aInterface,
MDriverAccess::TProtocolsaProtocol,
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 aConnectionIdThe device identifier
TUint16 aInterfaceThe device interface being used by the driver
MDriverAccess::TProtocols aProtocolThe requested report protocol (boot or report) aDriver Calling driver
CHidDriver * aDriver

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

voidSetReportL(TIntaConnectionId,
TUint8aReportId,
MDriverAccess::TReportTypeaReportType,
const TDesC8 &aPayload,
TUint16aInterface,
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 aConnectionIdThe device ID
TUint8 aReportIdThe report id
MDriverAccess::TReportType aReportTypeType of report (input/output/feature)
const TDesC8 & aPayloadThe report containing the device setup packet
TUint16 aInterfaceThe device interface being used by the driver aDriver Calling driver
CHidDriver * aDriver

VendorIdL(TInt)

TUint VendorIdL(TIntaConnectionId)

Fromm class MDriverAccess Retrieves the country code for the HID device

Since
S60 v5.0

Parameters

TInt aConnectionIdThe 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.