The Pedigree Project 0.1
Classes | Functions
HidUtils Namespace Reference

Various utility functions used in HID. More...

Classes

class  InputState
 Held input belongs to a report instance and is retired with that instance. More...
 

Functions

uint64_t getBufferField (uint8_t *pBuffer, size_t nStart, size_t nLength)
 Retrieves a field in a buffer.
 
void fixNegativeMinimum (int64_t &nMin, int64_t nMax)
 Converts.
 
void fixNegativeValue (int64_t nMin, int64_t nMax, int64_t &nValue)
 Converts.
 
void sendInputToManager (HidDeviceType deviceType, uint16_t nUsagePage, uint16_t nUsage, int64_t nRelativeValue, InputState &state)
 Sends the input to the right handler in HidInputManager or InputManager.
 

Detailed Description

Various utility functions used in HID.

Function Documentation

◆ fixNegativeMinimum()

void HidUtils::fixNegativeMinimum ( int64_t &  nMin,
int64_t  nMax 
)

Converts.

Parameters
nMinto a negative value, if it has the signed bit set

Definition at line 74 of file HidUtils.cc.

Referenced by HidReport::parseDescriptor().

+ Here is the caller graph for this function:

◆ fixNegativeValue()

void HidUtils::fixNegativeValue ( int64_t  nMin,
int64_t  nMax,
int64_t &  nValue 
)

Converts.

Parameters
nValueto a negative value, if it has the signed bit set

Definition at line 90 of file HidUtils.cc.

◆ getBufferField()

uint64_t HidUtils::getBufferField ( uint8_t *  pBuffer,
size_t  nStart,
size_t  nLength 
)

Retrieves a field in a buffer.

Definition at line 65 of file HidUtils.cc.

Referenced by HidReport::InputBlock::feedInput().

+ Here is the caller graph for this function:

◆ sendInputToManager()

void HidUtils::sendInputToManager ( HidDeviceType  deviceType,
uint16_t  nUsagePage,
uint16_t  nUsage,
int64_t  nRelativeValue,
InputState &  state 
)

Sends the input to the right handler in HidInputManager or InputManager.

Definition at line 108 of file HidUtils.cc.

References HidInputManager::instance(), InputManager::instance(), InputManager::joystickUpdate(), HidInputManager::keyDown(), HidInputManager::keyUp(), and InputManager::mouseUpdate().

Referenced by HidReport::InputBlock::feedInput().

+ Here is the caller graph for this function: