ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference

 


IOHIDDevicePlugIn.h

Includes:
<sys/cdefs.h>
<CoreFoundation/CoreFoundation.h>
<CoreFoundation/CFPlugInCOM.h>
<IOKit/IOTypes.h>
<IOKit/IOReturn.h>
<IOKit/IOCFPlugIn.h>
<IOKit/hid/IOHIDBase.h>
<IOKit/hid/IOHIDKeys.h>
<IOKit/hid/IOHIDLibObsolete.h>

Overview

This documentation describes the details of the programming interface for accessing Human Interface Devices and interfaces from code running in user space. It is intended that user mode HID drivers properly inplement all interfaces described here in order to be visible via the HID Manager.

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 HID Class Device Interface Guide. Please review documentation before using this reference.

All of the information described in this document is contained in the header file IOHIDLib.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDDevicePlugIn.h.



C Pseudoclasses

IOHIDDeviceDeviceInterface

The object you use to access HID devices from user space, returned by version 1.5 of the IOHIDFamily.

IOHIDDeviceQueueInterface

The object you use to access a HID queue from user space, returned by version 1.5 of the IOHIDFamily.

IOHIDDeviceTransactionInterface

The object you use to access a HID transaction from user space, returned by version 1.5 of the IOHIDFamily.



#defines


kIOHIDDeviceDeviceInterfaceID


#define kIOHIDDeviceDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x47, 0x4b, 0xdc, 0x8e, 0x9f, 0x4a, 0x11, 0xda, \ 
    0xb3, 0x66, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2 ) 
Discussion

This UUID constant is used to obtain a device interface corresponding to an IOHIDDevice service in the kernel. The type of this device interface is IOHIDDeviceDeviceInterface. This device interface is obtained after the IOCFPlugInInterface for the service itself has been obtained.

Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceTransactionInterfaceID, will return a retained instance of an existing IOHIDDeviceTransactionInterface.

Example:

    
    IOCFPluginInterface **          iodev;  // obtained earlier
    
    IOHIDDeviceDeviceInterface **   dev;    // fetching this now
    IOReturn                        err;
    
    err = (*iodev)->QueryInterface(iodev,
                                    CFUUIDGetUUIDBytes(kIOHIDDeviceDeviceInterfaceID),
                                    (LPVoid)&dev);
    
    


kIOHIDDeviceFactoryID


#define kIOHIDDeviceFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x13, 0xAA, 0x9C, 0x44, 0x6F, 0x1B, 0x11, 0xD4, \ 
    0x90, 0x7C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5) 
Discussion

This UUID constant is used internally by the system, and should not have to be used by any driver code to access the device interfaces.


kIOHIDDeviceQueueInterfaceID


#define kIOHIDDeviceQueueInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x2e, 0xc7, 0x8b, 0xdb, 0x9f, 0x4e, 0x11, 0xda, \ 
    0xb6, 0x5c, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2) 
Discussion

This UUID constant is used to obtain a queue interface corresponding to an IOHIDDevice service in the kernel. The type of this queue interface is IOHIDDeviceQueueInterface. This device interface is obtained after the device interface for the service itself has been obtained.

Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceQueueInterfaceID, will return a retained instance of a new IOHIDDeviceQueueInterface.

Example:

    
    IOCFPluginInterface **          iodev; 	// obtained earlier
    
    IOHIDDeviceQueueInterface **    intf;   // fetching this now
    IOReturn                        err;
    
    err = (*iodev)->QueryInterface(iodev,
                                CFUUIDGetUUIDBytes(kIOHIDDeviceQueueInterfaceID),
                                (LPVoid)&intf);
    
    


kIOHIDDeviceTransactionInterfaceID


#define kIOHIDDeviceTransactionInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x1f, 0x2e, 0x78, 0xfa, 0x9f, 0xfa, 0x11, 0xda, \ 
    0x90, 0xb4, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2) 
Discussion

This UUID constant is used to obtain a transaction interface corresponding to an IOHIDDevice service in the kernel. The type of this queue interface is IOHIDDeviceTransactionInterface. This device interface is obtained after the device interface for the service itself has been obtained.

Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceTransactionInterfaceID, will return a retained instance of a new IOHIDDeviceTransactionInterface.

Example:

    
    IOCFPluginInterface **              iodev;  // obtained earlier
    
    IOHIDDeviceTransactionInterface	**  intf;   // fetching this now
    IOReturn                            err;
    
    err = (*iodev)->QueryInterface(iodev,
                                CFUUIDGetUUIDBytes(kIOHIDDeviceTransactionInterfaceID),
                                (LPVoid)&intf);
    
    


kIOHIDDeviceTypeID


#define kIOHIDDeviceTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x7d, 0xde, 0xec, 0xa8, 0xa7, 0xb4, 0x11, 0xda, \ 
    0x8a, 0x0e, 0x00, 0x14, 0x51, 0x97, 0x58, 0xef) 
Discussion

This UUID constant is used to obtain a device interface corresponding to an io_service_t corresponding to an IOHIDDevice in the kernel. Once you have obtained the IOCFPlugInInterface for the service, you must use the QueryInterface function to obtain the device interface for the user client itself.

Example:

    
    io_service_t            hidDeviceRef;   // obtained earlier
        
    IOCFPlugInInterface     **iodev;        // fetching this now
        
    SInt32                  score;          // not used
    IOReturn                err;
        
    err = IOCreatePlugInInterfaceForService(hidDeviceRef,
                                    kIOHIDDeviceTypeID,
                                    kIOCFPlugInInterfaceID,
                                    &iodev,
                                    &score);
    
    


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2009-02-23