java access to USB MAC OS X  
Author Message
Gadgetman





PostPosted: 2008-1-1 0:03:00 Top

java-programmer, java access to USB MAC OS X I have a simple requirement at this point an Apple MAC OS X - that is
to detect the presence or lack of a USB device from java.

I have read about JSR 80, javax.usb, jUSB and all indicate not
available in Mac OS X.
I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
get a list of devices connected to the machine.
Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
etc.

Any suggestions on how to get the presence or lack of a USB device
from java on Mac OS X??

 
Michael Ash





PostPosted: 2008-1-1 0:36:00 Top

java-programmer >> java access to USB MAC OS X In comp.sys.mac.programmer.help Gadgetman <email***@***.com> wrote:
> I have a simple requirement at this point an Apple MAC OS X - that is
> to detect the presence or lack of a USB device from java.
>
> I have read about JSR 80, javax.usb, jUSB and all indicate not
> available in Mac OS X.
> I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
> get a list of devices connected to the machine.
> Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
> etc.

No, Mac OS X is *not* "Linux". OS X is UNIX, Linux is a UNIX lookalike.
(This is not meant to disparage Linux in any way, it's just the facts.)
This is why OS X doesn't have /proc, it's a Linuxism.

> Any suggestions on how to get the presence or lack of a USB device
> from java on Mac OS X??

IOKit, but you'll have to use JNI to talk to it.

--
Michael Ash
Rogue Amoeba Software
 
Steve W. Jackson





PostPosted: 2008-1-3 1:33:00 Top

java-programmer >> java access to USB MAC OS X In article
<email***@***.com>,
Gadgetman <email***@***.com> wrote:

> I have a simple requirement at this point an Apple MAC OS X - that is
> to detect the presence or lack of a USB device from java.
>
> I have read about JSR 80, javax.usb, jUSB and all indicate not
> available in Mac OS X.
> I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
> get a list of devices connected to the machine.
> Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
> etc.
>
> Any suggestions on how to get the presence or lack of a USB device
> from java on Mac OS X??

And where, exactly, did you hear that Mac OS X is "linux" again?

Mac OS X is based on BSD. You'll also find that some of the other
operating systems with a Un*x basis also don't use /proc. As I recall
from my very earliest days with AT&T System V Unix, it didn't. I think
the first one I encountered that did was Sun's Solaris.
--
Steve W. Jackson
Montgomery, Alabama
 
 
Martin Gregorie





PostPosted: 2008-1-3 4:48:00 Top

java-programmer >> java access to USB MAC OS X Steve W. Jackson wrote:
> In article
> <email***@***.com>,
> Gadgetman <email***@***.com> wrote:
>
>> I have a simple requirement at this point an Apple MAC OS X - that is
>> to detect the presence or lack of a USB device from java.
>>
>> I have read about JSR 80, javax.usb, jUSB and all indicate not
>> available in Mac OS X.
>> I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
>> get a list of devices connected to the machine.
>> Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
>> etc.
>>
>> Any suggestions on how to get the presence or lack of a USB device
>> from java on Mac OS X??
>
> And where, exactly, did you hear that Mac OS X is "linux" again?
>
> Mac OS X is based on BSD. You'll also find that some of the other
> operating systems with a Un*x basis also don't use /proc. As I recall
> from my very earliest days with AT&T System V Unix, it didn't. I think
> the first one I encountered that did was Sun's Solaris.
>
I'm told that /proc is uniquely a Linux-ism. I certainly haven't noticed
it on Solaris or any Unix SVR4 system. I think Linux borrowed the
concept from Plan9, which was the first OS I heard of that implemented
it (yes, even before OS-9's 1979 introduction the idea of naming all
memory modules, hanging them off a linked list to act as an index and
providing the mdir utility to show you what's in memory.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
 
Patricia Shanahan





PostPosted: 2008-1-3 5:08:00 Top

java-programmer >> java access to USB MAC OS X Martin Gregorie wrote:
> Steve W. Jackson wrote:
>> In article
>> <email***@***.com>,
>> Gadgetman <email***@***.com> wrote:
>>
>>> I have a simple requirement at this point an Apple MAC OS X - that is
>>> to detect the presence or lack of a USB device from java.
>>>
>>> I have read about JSR 80, javax.usb, jUSB and all indicate not
>>> available in Mac OS X.
>>> I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
>>> get a list of devices connected to the machine.
>>> Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
>>> etc.
>>>
>>> Any suggestions on how to get the presence or lack of a USB device
>>> from java on Mac OS X??
>>
>> And where, exactly, did you hear that Mac OS X is "linux" again?
>>
>> Mac OS X is based on BSD. You'll also find that some of the other
>> operating systems with a Un*x basis also don't use /proc. As I recall
>> from my very earliest days with AT&T System V Unix, it didn't. I
>> think the first one I encountered that did was Sun's Solaris.
> >
> I'm told that /proc is uniquely a Linux-ism. I certainly haven't noticed
> it on Solaris or any Unix SVR4 system. I think Linux borrowed the
> concept from Plan9, which was the first OS I heard of that implemented
> it (yes, even before OS-9's 1979 introduction the idea of naming all
> memory modules, hanging them off a linked list to act as an index and
> providing the mdir utility to show you what's in memory.

I don't know where /proc originated, but it certainly exists in Solaris.
See http://docs.sun.com/app/docs/doc/817-5432/6mkt028lc?l=en&a=view,

"Solaris 8 2/04 Reference Manual Collection >> man pages section 4: File
Formats >> File Formats >> proc(4) ?/proc, the process file system"

Patricia


 
 
Martin Gregorie





PostPosted: 2008-1-3 22:49:00 Top

java-programmer >> java access to USB MAC OS X Patricia Shanahan wrote:
>
> I don't know where /proc originated, but it certainly exists in Solaris.
> See http://docs.sun.com/app/docs/doc/817-5432/6mkt028lc?l=en&a=view,
>
Thanks for the correction - I was quoting somebody over on u.c.o.l. who
usually seems to know what he is talking about. My experience with
Solaris is small and its quite possible I've never looked at the
contents of /


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
 
steve





PostPosted: 2008-2-12 21:33:00 Top

java-programmer >> java access to USB MAC OS X On Tue, 1 Jan 2008 00:02:43 +0800, Gadgetman wrote
(in article
<email***@***.com>):

> I have a simple requirement at this point an Apple MAC OS X - that is
> to detect the presence or lack of a USB device from java.
>
> I have read about JSR 80, javax.usb, jUSB and all indicate not
> available in Mac OS X.
> I also know that in linux, I can do a "cat /proc/bus/usb/devices" and
> get a list of devices connected to the machine.
> Now Mac OS X is "linux" - yet there doesn't appear to be /proc/dev/...
> etc.
>
> Any suggestions on how to get the presence or lack of a USB device
> from java on Mac OS X??
>


try this

http://www.serialio.com/support/jspCommAPI.php

it gives serial via usb, which should allow a detection.

But i have also seen a usb library available for osx, but not the crap listed
above.