|
|
Log In | Not a Member? |
Contact ADC |
|
ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOHIDValue |
| Includes: |
IOHIDValue defines a value at a given time from an parsed item (IOHIDElement) contained within a Human Interface Device (HID) object. It is used to obtain either integer or data element values along with scaled values based on physical or calibrated settings. IOHIDValue is a CFType object and as such conforms to all the conventions expected such object.
This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications
For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts
in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications.
This documentation also assumes you have read Human Interface Device & Force Feedback.
Please review documentation before using this reference.
All of the information described in this document is contained in the header file IOHIDValue.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDValue.h.
IOHIDValueCreateWithBytes |
Creates a new element value using byte data.
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithBytes( CFAllocatorRef allocator, IOHIDElementRef element, uint64_t timeStamp, const uint8_t *bytes, CFIndex length) ;
allocatorelementtimeStampbyteslengthReturns a reference to a new IOHIDValueRef.
IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime.
To obtain the OS AbsoluteTime, please reference the APIs declared in
IOHIDValueCreateWithBytesNoCopy |
Creates a new element value using byte data without performing a copy.
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithBytesNoCopy( CFAllocatorRef allocator, IOHIDElementRef element, uint64_t timeStamp, const uint8_t *bytes, CFIndex length) ;
allocatorelementtimeStampbyteslengthReturns a reference to a new IOHIDValueRef.
The timestamp value passed should represent OS AbsoluteTime, not CFAbsoluteTime.
To obtain the OS AbsoluteTime, please reference the APIs declared in
IOHIDValueCreateWithIntegerValue |
Creates a new element value using an integer value.
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithIntegerValue( CFAllocatorRef allocator, IOHIDElementRef element, uint64_t timeStamp, CFIndex value) ;
allocatorelementtimeStampvalueReturns a reference to a new IOHIDValueRef.
IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime.
To obtain the OS AbsoluteTime, please reference the APIs declared in
IOHIDValueGetBytePtr |
Returns a byte pointer to the value contained in this IOHIDValueRef.
CF_EXPORT const uint8_t * IOHIDValueGetBytePtr( IOHIDValueRef value) ;
valueReturns a pointer to the value.
IOHIDValueGetElement |
Returns the element value associated with this IOHIDValueRef.
CF_EXPORT IOHIDElementRef IOHIDValueGetElement( IOHIDValueRef value) ;
valueReturns a IOHIDElementRef referenced by this value.
IOHIDValueGetIntegerValue |
Returns an integer representaion of the value contained in this IOHIDValueRef.
CF_EXPORT CFIndex IOHIDValueGetIntegerValue( IOHIDValueRef value) ;
valueReturns an integer representation of the value.
The value is based on the logical element value contained in the report returned by the device.
IOHIDValueGetLength |
Returns the size, in bytes, of the value contained in this IOHIDValueRef.
CF_EXPORT CFIndex IOHIDValueGetLength( IOHIDValueRef value) ;
valueReturns length of the value.
IOHIDValueGetScaledValue |
Returns an scaled representaion of the value contained in this IOHIDValueRef based on the scale type.
CF_EXPORT double_t IOHIDValueGetScaledValue( IOHIDValueRef value, IOHIDValueScaleType type) ;
valuetypeReturns an scaled floating point representation of the value.
The scaled value is based on the range described by the scale type's min and max, such that:
scaledValue = ((value - min) * (scaledMax - scaledMin) / (max - min)) + scaledMin
Note:
There are currently two types of scaling that can be applied:
IOHIDValueGetTimeStamp |
Returns the timestamp value contained in this IOHIDValueRef.
CF_EXPORT uint64_t IOHIDValueGetTimeStamp( IOHIDValueRef value) ;
valueReturns a uint64_t representing the timestamp of this value.
The timestamp value returned represents OS AbsoluteTime, not CFAbsoluteTime.
IOHIDValueGetTypeID |
Returns the type identifier of all IOHIDValue instances.
CF_EXPORT CFTypeID IOHIDValueGetTypeID( void) ;
|