This question already has an answer here:
- How to write usb touchscreen driver kext in os x 10.9? 1 answer
System details:
OS X 10.9.1 (13B42)
USB Infrared Touch Screen details:
Low Speed device @ 3 (0x14400000): ............................................. Composite device from unknown vendor Port Information: 0x101a Not Captive Attached to Root Hub External Device Connected Enabled Connected to External Port Number Of Endpoints (includes EP0): Total Endpoints for Configuration 1 (current): 2 Device Descriptor Descriptor Version Number: 0x0100 Device Class: 0 (Composite) Device Subclass: 0 Device Protocol: 0 Device MaxPacketSize: 8 Device VendorID/ProductID: 0x255E/0x0001 (unknown vendor) Device Version Number: 0x0100 Number of Configurations: 1 Manufacturer String: 0 (none) Product String: 0 (none) Serial Number String: 0 (none) Configuration Descriptor (current config) Length (and contents): 25 Raw Descriptor (hex) 0000: 09 02 19 00 01 01 00 A0 FA 09 04 00 00 01 FF 00 Raw Descriptor (hex) 0010: 00 00 07 05 81 03 08 00 0A Number of Interfaces: 1 Configuration Value: 1 Attributes: 0xA0 (bus-powered, remote wakeup) MaxPower: 500 mA Interface #0 - Vendor-specific Alternate Setting 0 Number of Endpoints 1 Interface Class: 255 (Vendor-specific) Interface Subclass; 0 (Vendor-specific) Interface Protocol: 0 Endpoint 0x81 - Interrupt Input Address: 0x81 (IN) Attributes: 0x03 (Interrupt) Max Packet Size: 8 Polling Interval: 10 ms
My test code source(https://github.com/maqinjun/MyDriver/blob/master/MyDriver/MyDriver/MyDriver.cpp).
As the details, my infrared touch screen is not a HID USB device, and report interrupt input event. So, I need to write a custom USB driver for it. And then, I decided to write a USB driver kext.
According to the Mac Developer Library (I/O Kit Fundamentals),I see the Handling Events.To put the role of the work loop in perspective, it helps first to consider the event sources that it is designed for. In the I/O Kit there are five broad categories of asynchronous events:
- 1. Interrupt events—indirect (secondary) interrupts originating from devices
- 2. Timer events—events delivered periodically by timers, such as timeouts
- 3. I/O commands—I/O requests issued by driver clients to their providers
- 4. Power events—typically generated through calls down the driver stack
- 5. Structural events—typically events involving the I/O Registry
I set up their work loops, event sources, and event handlers in their start function.But not works.So, I can't get the data from USB touch screen device.
My questions:
- 1. Is there other ways to receive the report data from USB device in os x USB kext ?
- 2. How to dispatch the coordinate to system, when get the report data ?
Someone help me?