Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Finding and Accessing Devices

This chapter assumes you have an application or other user-space code that needs to access one or more specific types of device and that you:

This chapter provides a generic blueprint for accessing devices with I/O Kit device interfaces and device files. It describes several ways to find devices in the I/O Registry and how to examine each device you find. It then describes how to access a device through a device interface or a device file.

Your code will implement many of the functions discussed in this chapter because some actions, such as getting a Mach port to communicate with the I/O Kit and looking up your devices in the I/O Registry, are common to all applications that use the I/O Kit API to access hardware.

Important: Bear in mind that individual I/O Kit families are free to define access to their devices as they choose. Although your application will follow the steps this chapter outlines, some of the particulars, such as determining matching keys and values, vary by family. Be sure to consult the documentation for the device family you’ll be working with.

This chapter describes how to use several I/O Kit and Core Foundation functions. You can view the header file describing the I/O Kit functions in /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h and the Core Foundation functions in various files in /System/Library/Frameworks/CoreFoundation.framework/Headers. You can also view header documentation for these files on disk in /Developer/Documentation or on the web in the Device Drivers Reference Library. Complete sample projects are available in Sample Code > Hardware & Drivers and, when you install the Developer package, in /Developer/Examples/IOKit.

Contents:

Finding Devices in the I/O Registry
Examining Matching Objects
Putting It All Together: Accessing a Device




< Previous PageNext Page > Hide TOC


Last updated: 2007-02-08




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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice