2 // File: IOHIDDevice_.h of HID Utilities
6 // Contains: Definition of the interfaces to <IOHIDDevice_.c>
8 // Copyright © 2007-2009 Apple Inc., All Rights Reserved
10 // Disclaimer: IMPORTANT: This Apple software is supplied to you by
11 // Apple Inc. ("Apple") in consideration of your agreement to the
12 // following terms, and your use, installation, modification or
13 // redistribution of this Apple software constitutes acceptance of these
14 // terms. If you do not agree with these terms, please do not use,
15 // install, modify or redistribute this Apple software.
17 // In consideration of your agreement to abide by the following terms, and
18 // subject to these terms, Apple grants you a personal, non-exclusive
19 // license, under Apple's copyrights in this original Apple software (the
20 // "Apple Software"), to use, reproduce, modify and redistribute the Apple
21 // Software, with or without modifications, in source and/or binary forms;
22 // provided that if you redistribute the Apple Software in its entirety and
23 // without modifications, you must retain this notice and the following
24 // text and disclaimers in all such redistributions of the Apple Software.
25 // Neither the name, trademarks, service marks or logos of Apple Inc.
26 // may be used to endorse or promote products derived from the Apple
27 // Software without specific prior written permission from Apple. Except
28 // as expressly stated in this notice, no other rights or licenses, express
29 // or implied, are granted by Apple herein, including but not limited to
30 // any patent rights that may be infringed by your derivative works or by
31 // other works in which the Apple Software may be incorporated.
33 // The Apple Software is provided by Apple on an "AS IS" basis. APPLE
34 // MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
35 // THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
36 // FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
37 // OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
39 // IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
40 // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42 // INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
43 // MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
44 // AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
45 // STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
46 // POSSIBILITY OF SUCH DAMAGE.
48 #ifndef __IOHIDDevice__
49 #define __IOHIDDevice__
51 //*****************************************************
52 #pragma mark - includes & imports
54 #include <AvailabilityMacros.h>
56 #include <Carbon/Carbon.h>
58 #include "IOHIDLib_.h"
60 //*****************************************************
73 #if PRAGMA_STRUCT_ALIGN
74 #pragma options align=mac68k
75 #elif PRAGMA_STRUCT_PACKPUSH
77 #elif PRAGMA_STRUCT_PACK
81 //*****************************************************
82 #pragma mark - typedef's, struct's, enums, defines, etc.
83 //-----------------------------------------------------
85 //*****************************************************
86 #pragma mark - exported globals
87 //-----------------------------------------------------
89 //*****************************************************
90 #pragma mark - exported function prototypes
91 //-----------------------------------------------------
93 //*************************************************************************
95 // HIDIsValidDevice( inIOHIDDeviceRef )
97 // Purpose: validate this device
99 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
101 // Returns: Boolean - TRUE if we find the device in our( internal ) device list
104 extern Boolean
HIDIsValidDevice( IOHIDDeviceRef inIOHIDDeviceRef
);
106 //*************************************************************************
108 // IOHIDDevice_GetTransport( inIOHIDDeviceRef )
110 // Purpose: get the Transport CFString for this device
112 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
114 // Returns: CFStringRef - the Transport CFString for this device
117 extern CFStringRef
IOHIDDevice_GetTransport( IOHIDDeviceRef inIOHIDDeviceRef
);
119 //*************************************************************************
121 // IOHIDDevice_GetVendorID( inIOHIDDeviceRef )
123 // Purpose: get the vendor ID for this device
125 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
127 // Returns: long - the vendor ID for this device
130 extern long IOHIDDevice_GetVendorID( IOHIDDeviceRef inIOHIDDeviceRef
);
132 //*************************************************************************
134 // IOHIDDevice_GetVendorIDSource( inIOHIDDeviceRef )
136 // Purpose: get the VendorIDSource for this device
138 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
140 // Returns: long - the VendorIDSource for this device
143 extern long IOHIDDevice_GetVendorIDSource( IOHIDDeviceRef inIOHIDDeviceRef
);
145 //*************************************************************************
147 // IOHIDDevice_GetProductID( inIOHIDDeviceRef )
149 // Purpose: get the product ID for this device
151 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
153 // Returns: long - the product ID for this device
156 extern long IOHIDDevice_GetProductID( IOHIDDeviceRef inIOHIDDeviceRef
);
158 //*************************************************************************
160 // IOHIDDevice_GetVersionNumber( inIOHIDDeviceRef )
162 // Purpose: get the VersionNumber CFString for this device
164 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
166 // Returns: long - the VersionNumber for this device
169 extern long IOHIDDevice_GetVersionNumber( IOHIDDeviceRef inIOHIDDeviceRef
);
171 //*************************************************************************
173 // IOHIDDevice_GetManufacturer( inIOHIDDeviceRef )
175 // Purpose: get the Manufacturer CFString for this device
177 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
179 // Returns: CFStringRef - the Manufacturer CFString for this device
182 extern CFStringRef
IOHIDDevice_GetManufacturer( IOHIDDeviceRef inIOHIDDeviceRef
);
184 //*************************************************************************
186 // IOHIDDevice_GetProduct( inIOHIDDeviceRef )
188 // Purpose: get the Product CFString for this device
190 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
192 // Returns: CFStringRef - the Product CFString for this device
195 extern CFStringRef
IOHIDDevice_GetProduct( IOHIDDeviceRef inIOHIDDeviceRef
);
197 //*************************************************************************
199 // IOHIDDevice_GetSerialNumber( inIOHIDDeviceRef )
201 // Purpose: get the SerialNumber CFString for this device
203 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
205 // Returns: CFStringRef - the SerialNumber CFString for this device
208 extern CFStringRef
IOHIDDevice_GetSerialNumber( IOHIDDeviceRef inIOHIDDeviceRef
);
210 //*************************************************************************
212 // IOHIDDevice_GetCountryCode( inIOHIDDeviceRef )
214 // Purpose: get the CountryCode CFString for this device
216 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
218 // Returns: long - the CountryCode for this device
221 extern long IOHIDDevice_GetCountryCode( IOHIDDeviceRef inIOHIDDeviceRef
);
223 //*************************************************************************
225 // IOHIDDevice_GetLocationID( inIOHIDDeviceRef )
227 // Purpose: get the location ID for this device
229 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
231 // Returns: long - the location ID for this device
234 extern long IOHIDDevice_GetLocationID( IOHIDDeviceRef inIOHIDDeviceRef
);
236 //*************************************************************************
238 // IOHIDDevice_GetUsage( inIOHIDDeviceRef )
240 // Purpose: get the usage for this device
242 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
244 // Returns: uint32_t - the usage for this device
247 extern uint32_t IOHIDDevice_GetUsage( IOHIDDeviceRef inIOHIDDeviceRef
);
249 //*************************************************************************
251 // IOHIDDevice_GetUsagePage( inIOHIDDeviceRef )
253 // Purpose: get the usage page for this device
255 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
257 // Returns: uint32_t - the usage page for this device
260 extern uint32_t IOHIDDevice_GetUsagePage( IOHIDDeviceRef inIOHIDDeviceRef
);
262 //*************************************************************************
264 // IOHIDDevice_GetUsagePairs( inIOHIDDeviceRef )
266 // Purpose: get the UsagePairs CFString for this device
268 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
270 // Returns: CFArrayRef - the UsagePairs for this device
273 extern CFArrayRef
IOHIDDevice_GetUsagePairs( IOHIDDeviceRef inIOHIDDeviceRef
);
275 //*************************************************************************
277 // IOHIDDevice_GetPrimaryUsage( inIOHIDDeviceRef )
279 // Purpose: get the PrimaryUsage CFString for this device
281 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
283 // Returns: CFStringRef - the PrimaryUsage CFString for this device
286 extern uint32_t IOHIDDevice_GetPrimaryUsage( IOHIDDeviceRef inIOHIDDeviceRef
);
288 //*************************************************************************
290 // IOHIDDevice_GetPrimaryUsagePage( inIOHIDDeviceRef )
292 // Purpose: get the PrimaryUsagePage CFString for this device
294 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
296 // Returns: CFStringRef - the PrimaryUsagePage CFString for this device
299 extern uint32_t IOHIDDevice_GetPrimaryUsagePage( IOHIDDeviceRef inIOHIDDeviceRef
);
301 //*************************************************************************
303 // IOHIDDevice_GetMaxInputReportSize( inIOHIDDeviceRef )
305 // Purpose: get the MaxInputReportSize for this device
307 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
309 // Returns: long - the MaxInputReportSize for this device
312 extern long IOHIDDevice_GetMaxInputReportSize( IOHIDDeviceRef inIOHIDDeviceRef
);
314 //*************************************************************************
316 // IOHIDDevice_GetMaxOutputReportSize( inIOHIDDeviceRef )
318 // Purpose: get the MaxOutputReportSize for this device
320 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
322 // Returns: long - the MaxOutputReportSize for this device
325 extern long IOHIDDevice_GetMaxOutputReportSize( IOHIDDeviceRef inIOHIDDeviceRef
);
327 //*************************************************************************
329 // IOHIDDevice_GetMaxFeatureReportSize( inIOHIDDeviceRef )
331 // Purpose: get the MaxFeatureReportSize for this device
333 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
335 // Returns: long - the MaxFeatureReportSize for this device
338 extern long IOHIDDevice_GetMaxFeatureReportSize( IOHIDDeviceRef inIOHIDDeviceRef
);
340 //*************************************************************************
342 // IOHIDDevice_GetReportInterval( inIOHIDDeviceRef )
344 // Purpose: get the ReportInterval for this device
346 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
348 // Returns: long - the ReportInterval for this device
351 extern long IOHIDDevice_GetReportInterval( IOHIDDeviceRef inIOHIDDeviceRef
);
353 //*************************************************************************
355 // IOHIDDevice_GetQueue( inIOHIDDeviceRef )
357 // Purpose: get the Queue for this device
359 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
361 // Returns: IOHIDQueueRef - the Queue for this device
364 extern IOHIDQueueRef
IOHIDDevice_GetQueue( IOHIDDeviceRef inIOHIDDeviceRef
);
366 //*************************************************************************
368 // IOHIDDevice_SetQueue( inIOHIDDeviceRef, inQueueRef )
370 // Purpose: Set the Queue for this device
372 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
373 // inQueueRef - the Queue
378 extern void IOHIDDevice_SetQueue( IOHIDDeviceRef inIOHIDDeviceRef
, IOHIDQueueRef inQueueRef
);
380 //*************************************************************************
382 // IOHIDDevice_GetTransaction( inIOHIDDeviceRef )
384 // Purpose: get the Transaction for this device
386 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
388 // Returns: IOHIDTransactionRef - the Transaction for this device
391 extern IOHIDTransactionRef
IOHIDDevice_GetTransaction( IOHIDDeviceRef inIOHIDDeviceRef
);
393 //*************************************************************************
395 // IOHIDDevice_SetTransaction( inIOHIDDeviceRef, inTransactionRef )
397 // Purpose: Set the Transaction for this device
399 // Inputs: inIOHIDDeviceRef - the IDHIDDeviceRef for this device
400 // inTransactionRef - the Transaction
405 extern void IOHIDDevice_SetTransaction( IOHIDDeviceRef inIOHIDDeviceRef
, IOHIDTransactionRef inTransactionRef
);
407 //*****************************************************
408 #if PRAGMA_STRUCT_ALIGN
409 #pragma options align=reset
410 #elif PRAGMA_STRUCT_PACKPUSH
412 #elif PRAGMA_STRUCT_PACK
416 #ifdef PRAGMA_IMPORT_OFF
426 #endif // __IOHIDDevice__ //