TItem Class Reference

class TItem

HID item class A HID report descriptor is comprised of a sequence of "items" that provide information about the device. Items consist of a header and zero or more bytes of data. The header contains the item type (main/global/local), an item "tag" (subtype) and the item size. Items can be "short" (containing a maximum of 4 bytes of data) or "long" (a maximum of 255 bytes of data).

A TItem represents a single HID report descriptor item. It is constructed from an eight bit non-modifiable (Symbian-) descriptor, which is assumed to contain report (HID-) descriptor data.

generichid.lib
Since
S60 v5.0
Public Member Functions
TItem(const TDesC8 &)
TUint32 Data()
TInt DataSize()
TBool IsGlobal()
TBool IsLocal()
TBool IsLong()
TBool IsMain()
TInt ItemSize()
TInt32 SignedData()
TInt Tag()
TItemType Type()
TUint8 operator[](TInt)
Public Member Enumerations
enumTItemType { EMain = 0, EGlobal = 1, ELocal = 2, EReserved = 3 }
Private Attributes
TInt iDataOffset
TPtrC8 iRawData
TInt iSize
TInt iTag
TItemType iType

Constructor & Destructor Documentation

TItem(const TDesC8 &)

TItem(const TDesC8 &aRawData)

The constructor takes a an eight bit non-modifiable (Symbian-) descriptor containing report (HID-) descriptor data. The item tag, type, data size and offset are calculated here.

Since
S60 v5.0

Parameters

const TDesC8 & aRawDataThe raw item data, represented as a Symbian descriptor. The item data is assumed to be at the beginning of the descriptor. The size of the TDesC8 may be greater than the size of the item, as the item size will be calculated from the raw HID descriptor data. Of course, the TDesC8 should be at least as long as the raw item data.

Member Functions Documentation

Data()

TUint32 Data()const

Data() returns the data associated with the item, represented as a 32-bit unsigned integer. This is only meaningful if the data length is less than 4 bytes.

Since
S60 v5.0

DataSize()

TInt DataSize()const

DataSize() returns the size of the item data in bytes. This is the total item size minus the size of any header information. (A short item header is a single byte, a long item header is three bytes long.)

Since
S60 v5.0

IsGlobal()

TBool IsGlobal()const

Check if item is global

Since
S60 v5.0

IsLocal()

TBool IsLocal()const

Check if item is local

Since
S60 v5.0

IsLong()

TBool IsLong()const

Check if item is global

Since
S60 v5.0

IsMain()

TBool IsMain()const

Check if item is main

Since
S60 v5.0

ItemSize()

TInt ItemSize()const

ItemSize() returns the total size of this item, including the header data.

Since
S60 v5.0

SignedData()

TInt32 SignedData()const

SignedData() returns the data associated with the item, represented as a 32-bit signed integer. This is only meaningful if the data length is less than 4 bytes.

Since
S60 v5.0

Tag()

TInt Tag()const

Tag() returns the tag (subtype) value for this item.

Since
S60 v5.0

Type()

TItemType Type()const

Type() returns the item type (e.g. "global").

Since
S60 v5.0

operator[](TInt)

TUint8 operator[](TIntaIndex)const

Returns the byte at the given offset within the item data block.

Since
S60 v5.0

Parameters

TInt aIndexThe index within the data block for the current tag.

Member Enumerations Documentation

Enum TItemType

The possible item types: main, global or local. Item type is a two-bit field -- the 11b value is reserved for "long items", which are only used for vendor-specific commands.

Enumerators

EMain = 0
EGlobal = 1
ELocal = 2
EReserved = 3

Member Data Documentation

TInt iDataOffset

TInt iDataOffset[private]

Offset in bytes of the data block

TPtrC8 iRawData

TPtrC8 iRawData[private]

Pointer to the raw report descriptor data

TInt iSize

TInt iSize[private]

Item data size

TInt iTag

TInt iTag[private]

Item tag value

TItemType iType

TItemType iType[private]

Item type