File: CheckMacHIDAPI.cpp

package info (click to toggle)
freespace2 24.0.2%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 43,188 kB
  • sloc: cpp: 583,107; ansic: 21,729; python: 1,174; sh: 464; makefile: 248; xml: 181
file content (45 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
 * \file CheckMacHIDAPI.cpp
 * \brief C++ source file used by CMake module CheckMacHIDAPI.cmake
 *
 * \author
 * Ryan Pavlik, 2009-2010
 * <rpavlik@iastate.edu>
 * http://academic.cleardefinition.com/
 *
 * \author
 * Based on code extracted from VRPN 07.22 for use as a minimal test case
 *
 * Attempts to compile a difficult bit of code against the Mac
 * HID API, as two different types have been required in the callback
 * function (UInt32 and uint32_t) and testing is the best way to know
 * which one is correct for a given system.
 *
 */


#if defined(__APPLE__)

#include <stdio.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/hid/IOHIDKeys.h>
#include <CoreFoundation/CoreFoundation.h>
void ReaderReportCallback(
						  void *target, IOReturn result, void *refcon, void *sender, MACOSX_HID_UINT32T size
						  )
						  {}
#endif

int main(int argc, char* argv[]) {
#if defined(__APPLE__)
	io_object_t _ioObject;
	IOHIDDeviceInterface122 **_interface;
	unsigned char _buffer[512];
	IOReturn result = (*_interface)->setInterruptReportHandlerCallback(_interface,
															  _buffer, 512,
															  ReaderReportCallback,
																	   NULL, 0);
#endif
	return 0;
}