ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOHIDValue.h |
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.
Creates a new element value using byte data.
Creates a new element value using byte data without performing a copy.
Creates a new element value using an integer value.
Returns a byte pointer to the value contained in this IOHIDValueRef.
Returns the element value associated with this IOHIDValueRef.
Returns an integer representaion of the value contained in this IOHIDValueRef.
Returns the size, in bytes, of the value contained in this IOHIDValueRef.
Returns an scaled representaion of the value contained in this IOHIDValueRef based on the scale type.
Returns the timestamp value contained in this IOHIDValueRef.
Returns the type identifier of all IOHIDValue instances.
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) ;
allocator
The CFAllocator which should be used to allocate memory for the value. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
element
IOHIDElementRef associated with this value.
timeStamp
OS absolute time timestamp for this value.
bytes
Pointer to a buffer of uint8_t to be copied to this object.
length
Number of bytes in the passed buffer.
Returns a reference to a new IOHIDValueRef.
IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime.
To obtain the OS AbsoluteTime, please reference the APIs declared in Creates a new element value using byte data without performing a copy.
The CFAllocator which should be used to allocate memory for the value. This
parameter may be NULL in which case the current default CFAllocator is used. If this
reference is not a valid CFAllocator, the behavior is undefined. IOHIDElementRef associated with this value. OS absolute time timestamp for this value. Pointer to a buffer of uint8_t to be referenced by this object. Number of bytes in the passed buffer. Returns 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 Creates a new element value using an integer value.
The CFAllocator which should be used to allocate memory for the value. This
parameter may be NULL in which case the current default CFAllocator is used. If this
reference is not a valid CFAllocator, the behavior is undefined. IOHIDElementRef associated with this value. OS absolute time timestamp for this value. Integer value to be copied to this object. Returns a reference to a new IOHIDValueRef.
IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime.
To obtain the OS AbsoluteTime, please reference the APIs declared in Returns a byte pointer to the value contained in this IOHIDValueRef.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Returns a pointer to the value.
Returns the element value associated with this IOHIDValueRef.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Returns a IOHIDElementRef referenced by this value.
Returns an integer representaion of the value contained in this IOHIDValueRef.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Returns an integer representation of the value.
The value is based on the logical element value contained in the report returned by the device.
Returns the size, in bytes, of the value contained in this IOHIDValueRef.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Returns length of the value.
Returns an scaled representaion of the value contained in this IOHIDValueRef based on the scale type.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. The type of scaling to be performed. Returns 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:
Returns the timestamp value contained in this IOHIDValueRef.
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Returns a uint64_t representing the timestamp of this value.
The timestamp value returned represents OS AbsoluteTime, not CFAbsoluteTime.
Returns the type identifier of all IOHIDValue instances.
IOHIDValueCreateWithBytesNoCopy
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithBytesNoCopy(
CFAllocatorRef allocator,
IOHIDElementRef element,
uint64_t timeStamp,
const uint8_t * bytes,
CFIndex length) ;
Parameters
allocator
element
timeStamp
bytes
length
Return Value
Discussion
IOHIDValueCreateWithIntegerValue
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithIntegerValue(
CFAllocatorRef allocator,
IOHIDElementRef element,
uint64_t timeStamp,
CFIndex value) ;
Parameters
allocator
element
timeStamp
value
Return Value
Discussion
IOHIDValueGetBytePtr
CF_EXPORT const uint8_t * IOHIDValueGetBytePtr(IOHIDValueRef value) ;
Parameters
value
Return Value
IOHIDValueGetElement
CF_EXPORT IOHIDElementRef IOHIDValueGetElement(
IOHIDValueRef value) ;
Parameters
value
Return Value
IOHIDValueGetIntegerValue
CF_EXPORT CFIndex IOHIDValueGetIntegerValue(
IOHIDValueRef value) ;
Parameters
value
Return Value
Discussion
IOHIDValueGetLength
CF_EXPORT CFIndex IOHIDValueGetLength(
IOHIDValueRef value) ;
Parameters
value
Return Value
IOHIDValueGetScaledValue
CF_EXPORT double_t IOHIDValueGetScaledValue(
IOHIDValueRef value,
IOHIDValueScaleType type) ;
Parameters
value
type
Return Value
Discussion
scaledValue = ((value - min) * (scaledMax - scaledMin) / (max - min)) + scaledMin
Note:
There are currently two types of scaling that can be applied:
IOHIDValueGetTimeStamp
CF_EXPORT uint64_t IOHIDValueGetTimeStamp(
IOHIDValueRef value) ;
Parameters
value
Return Value
Discussion
IOHIDValueGetTypeID
CF_EXPORT CFTypeID IOHIDValueGetTypeID(
void) ;
Did this document help you?