Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Talking to a HID



I have a HID (if it matters, a Matrix bill validator.  Takes money, makes
USB signals).

The documented interface is to write 5-byte control packets to the device and
get 5-byte packets back.

On NetBSD, this is easy.

	fd = open("/dev/uhid0", O_RDWR);
	write(fd, packet, 5);
	read(fd, packet, 5);

How do I do this on Mac OS X?  The USB HID toolkit stuff doesn't seem directly
applicable; I don't need to set up event queues, I just need to poll a device
with a slightly odd interface.

I originally thought I'd be writing my own code to attach to the device, but
the HID driver attaches exclusively, so I can't attach using the more generic
USB code.  That said, I would hope that the Mac OS X HID driver has this
functionality somewhere; I have a collection of weird HID devices that are
driven through weird custom messages, and I was hoping to support some of 'em
on Mac OS X.

-s
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.