ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOHIDQueueInterface |
Declared In: |
CFPlugin object subclass which provides an interface for input queues from HID devices. Created by an IOHIDDeviceInterface object.
Adds an element to the queue.
Disposes of the current queue.
Creates the current queue.
Creates an async event source.
Creates an async port.
Disposes of the current queue.
Obtains the current event source.
Obtains the current async port.
Gets the event callout.
Reads next event from the queue.
Checks whether an element has been added to the queue.
Removes an element from the queue.
Sets the event callout to be called when the queue transitions to non-empty.
Starts event delivery to the queue.
Stops event delivery to the queue.
addElement |
Adds an element to the queue.
IOReturn ( *addElement)( void *self, IOHIDElementCookie elementCookie, uint32_t flags);
elementCookie
The element of interest.
flags
Returns an IOReturn code.
If the element has already been added to queue, an error will be returned.
create(void *) |
Disposes of the current queue.
IOReturn ( *dispose)( void *self);
Returns an IOReturn code.
create(void *, uint32_t, uint32_t) |
Creates the current queue.
IOReturn ( *create)( void *self, uint32_t flags, uint32_t depth);
flags
Pass kIOHIDQueueOptionsTypeEnqueueAll option to force the IOHIDQueue to enqueue all events, relative or absolute, regardless of change.
depth
The maximum number of elements in the queue before the oldest elements in the queue begin to be lost.
Returns an IOReturn code.
createAsyncEventSource |
Creates an async event source.
IOReturn ( *createAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
source
The newly created event source.
Returns an IOReturn code.
This will be used with setEventCallout.
createAsyncPort |
Creates an async port.
IOReturn ( *createAsyncPort)( void *self, mach_port_t *port);
port
The newly created async port.
Returns an IOReturn code.
This will be used with createAsyncEventSource.
dispose |
Disposes of the current queue.
IOReturn ( *dispose)( void *self);
Returns an IOReturn code.
getAsyncEventSource |
Obtains the current event source.
CFRunLoopSourceRef ( *getAsyncEventSource)( void *self);
Returns a CFRunLoopSourceRef.
getAsyncPort |
Obtains the current async port.
mach_port_t ( *getAsyncPort)( void *self);
Returns a mach_port_t.
getEventCallout |
Gets the event callout.
IOReturn ( *getEventCallout)( void *self, IOHIDCallbackFunction *outCallback, void **outCallbackTarget, void **outCallbackRefcon);
callback
if non-NULL is a callback to be called when data is inserted to the queue
callbackTarget
The callback target passed to the callback
callbackRefcon
The callback refcon passed to the callback
Returns an IOReturn code.
This callback will be called the queue transitions to non-empty.
getNextEvent |
Reads next event from the queue.
IOReturn ( *getNextEvent)( void *self, IOHIDEventStruct *event, AbsoluteTime maxTime, uint32_t timeoutMS);
event
The event that will be filled. If a long value is present, it is up to the caller to deallocate it.
maxtime
UNSUPPORTED. If non-zero, limits read events to those that occured on or before maxTime.
timoutMS
UNSUPPORTED. The timeout in milliseconds, a zero timeout will cause this call to be non-blocking (returning queue empty) if there is a NULL callback, and blocking forever until the queue is non-empty if there is a valid callback.
Returns an IOReturn code.
hasElement |
Checks whether an element has been added to the queue.
Boolean ( *hasElement)( void *self, IOHIDElementCookie elementCookie);
elementCookie
The element of interest.
Returns a Boolean value.
Will return true if present, otherwise will return false.
removeElement |
Removes an element from the queue.
IOReturn ( *removeElement)( void *self, IOHIDElementCookie elementCookie);
elementCookie
The element of interest.
Returns an IOReturn code.
If the element has not been added to queue, an error will be returned.
setEventCallout |
Sets the event callout to be called when the queue transitions to non-empty.
IOReturn ( *setEventCallout)( void *self, IOHIDCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
callback
if non-NULL is a callback to be called when data is inserted to the queue
callbackTarget
The callback target passed to the callback
callbackRefcon
The callback refcon passed to the callback.
Returns an IOReturn code.
In order for this to work correctly, you must call createAsyncPort and createAsyncEventSource.
start |
Starts event delivery to the queue.
IOReturn ( *start)( void *self);
Returns an IOReturn code.
stop |
Stops event delivery to the queue.
IOReturn ( *stop)( void *self);
Returns an IOReturn code.
|
Last Updated: 2009-02-23