Byte-banging a USB device attached on ugen

Karl Denninger karl at denninger.net
Tue Apr 26 20:14:01 UTC 2016


So I've got one of these....

ugen0.5: <X10 Wireless Technology Inc> at usbus0

Which is a CM15.

It does not appear to attach as an HID or expose a serial-like interface
(on a tty or cua device node.)

I have documentation of two end-points that this device uses, one for
transmitting data to the host and one for receiving commands from the
host, along with the byte-format protocol that is expected on each.  As
such if I can determine how to programmatically access those two
end-points I should be good.

What I'm having trouble finding documentation on is how to open the
device and attach a byte stream to those endpoints on FreeBSD (e.g. how
to get it open and specify which endpoint to associate with the handle)
and once I do, can I expect to use the usual select() paradigm to see if
they're ready for read (e.g. something is on the bus inbound to me) and
ready for write (can be written to.)

Is there a pointer available somewhere to a code fragment that shows how
to do this?  I also want to get the device specification as part of the
setup, obviously, to make sure I'm talking to the right device and not
some other random thing that was plugged in -- my intent is to handle
the situation where my code can detect a hot-plug (or unplug) of the
device and initialize and/or shut down the channel accordingly and thus
I want to iterate over the ugen devices I find and check them for the
correct device specification.

Thanks in advance!

-- 
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2996 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-usb/attachments/20160426/1fd9e944/attachment.bin>


More information about the freebsd-usb mailing list