Communication with USB HID devices?

Phil Davis davis.phil at
Fri Jul 9 17:32:09 CDT 2004

Thanks for the effort. So far, no cigar.

I ran the script and it returned empty.

I haven't succeeded in opening or even copying "/dev/cu.modem" (my only 'cu'
file) yet - it hangs things up when I try. (I tried copying it to Desktop
via Terminal and via Rev 'shell' command. I also tried Rev 'put url' into
fld, but it hung.)

Other thoughts?


============ original post ============
I have an HID-compliant USB 1.1 device that I want to interact with via a
Rev stack. The device has no custom driver - it relies on the HID driver
included with the operating system.

The device enumerates correctly when plugged in, so the OS recognizes it;
but Rev can't see the driver (it doesn't list it in 'the driverNames' on
OSX), so I don't know how to use Rev to communicate with it.

Any suggestions? Observations? Guesses?

=========== end original =============

----- Original Message -----
From: "Dar Scott" <dsc at>
To: "How to use Revolution" <use-revolution at>
Sent: Friday, July 09, 2004 2:53 PM
Subject: Re: Communication with USB HID devices?

> On Jul 9, 2004, at 3:43 PM, Phil Davis wrote:
> > The docs suggest that on OSX/Unix I should be able to find device
> > names in
> > the "/dev/tty" file. That file is empty on my machine - the device
> > isn't
> > listed there, maybe? because it doesn't have a custom driver.
> >
> > Try again!
> Look for /dev/tty*.  For example the built-in modem is shown as
> /dev/tty.modem.
> Look for /dev/cu*.  Those are the one you will use.
> I was going to suggest something else and based on what you are saying,
> it may work out.  Many devices have (sometimes in addition to other
> interfaces) a interface that looks like a serial device.
> Sometimes driverNames() will miss devices.  Try this:
> -- Ken Ray and Dar Scott did this
> function deviceNames
>    local theNames="", ioregOutput, skipLines, temp
>    local IOTTYDevice, IODialinDevice, IOCalloutDevice
>    set the hideConsoleWindows to true
>    put shell("ioreg -n IOSerialBSDClient") into ioregOutput
>    repeat forever
>      put lineOffset("IOSerialBSDCLient",ioregOutput) into skipLines
>      if skipLines is zero then return thenames
>      delete line 1 to skipLines of ioregOutput
>      -- Get all the data between the braces
>      put char(offset("{",ioregOutput)) to (offset("}",ioregOutput)) of
> ioregOutput into temp
>      get matchText(temp,"\"IOTTYDevice\" = \"(.*?)\"",IOTTYDevice)
>      if it is not true then next repeat
>      get matchText(temp,"\"IODialinDevice\" = \"(.*?)\"",IODialinDevice)
>      if it is not true then next repeat
>      get matchText(temp,"\"IOCalloutDevice\" =
> \"(.*?)\"",IOCalloutDevice)
>      if it is not true then next repeat
>      put IOTTYDevice,IODialinDevice,IOCalloutDevice & lineFeed after
> theNames
>    end repeat
> end deviceNames
> For example, this will find my internal modem.
> Dar Scott
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the use-livecode mailing list