Mailing Lists: Apple Mailing Lists

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

Re: Listing serial ports



On 15/6/06 3:54, André-John Mas <email@hidden> wrote:

> Hi,
> 
> What is the right way to list serial ports, as to get user-friendly
> display names. I am currently using this following implementation of
> the javax.comm API:
> 
> http://www.rxtx.org/
> 
> Though it returns very unix like /dev/cu.* and /dev/tty.* entries.
> If I can I would be tempted to update it so that something more
> suitable to displaying to a user is implemented.

Use the IOKit.

There's some code showing how to dynamically detect serial USB devices being
connected and disconnected at
<http://www.cocoadev.com/index.pl?StillCannotUnderstandIORegistry> (note not
the first code snippet, the second one which has DeviceAddedCallback and
DeviceRemovedCallback.) It works really nicely, and you hardly have to
understand IOKit to use it (which is the best part :-)

That page references an Apple document which may help (and references some
Apple sample code):

<http://developer.apple.com/documentation/DeviceDrivers/Conceptual/WorkingWS
erial/index.html>

Cheers,

Chris


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

This email sent to email@hidden

References: 
 >Listing serial ports (From: AndrĂ©-John Mas <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.