Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

USB connection via I/O Kit functions

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  Bootcamp advice: Vista or XP?  
Author Message
H

External


Since: Jun 26, 2006
Posts: 18



(Msg. 1) Posted: Sun Feb 17, 2008 8:42 pm
Post subject: USB connection via I/O Kit functions
Archived from groups: comp>sys>mac>programmer>help (more info?)

I want to connect to a USB device via the I/O Kit functions.
Unfortunately, this does not work.

Actually my device has got basically a serial interface with an internal
USB - RS232 converter from Prolific. When using the BSD functions and
the driver /dev/cu.usbserial everything works when I set the
communication parameters correctly. My device needs XON/XOFF handshaking
and a start and stop bit. Furthermore, the data is 8 bit.
How do I tell the IOUSBInterfaceInterface environment that I need the
before mentioned parameters?

Hartwig

 >> Stay informed about: USB connection via I/O Kit functions 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 694



(Msg. 2) Posted: Mon Feb 18, 2008 1:57 pm
Post subject: Re: USB connection via I/O Kit functions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article , H
wrote:

> I want to connect to a USB device via the I/O Kit functions.
> Unfortunately, this does not work.
>
> Actually my device has got basically a serial interface with an internal
> USB - RS232 converter from Prolific. When using the BSD functions and
> the driver /dev/cu.usbserial everything works when I set the
> communication parameters correctly. My device needs XON/XOFF handshaking
> and a start and stop bit. Furthermore, the data is 8 bit.
> How do I tell the IOUSBInterfaceInterface environment that I need the
> before mentioned parameters?

Why do you need to use IOKit functions? Why not use the IOKit functions
to get the POSIX name of the device, and manipulate the device from then
on using POSIX calls. Use ioctl() to set the handshaking and bytesize.

 >> Stay informed about: USB connection via I/O Kit functions 
Back to top
Login to vote
H

External


Since: Jun 26, 2006
Posts: 18



(Msg. 3) Posted: Mon Feb 18, 2008 9:34 pm
Post subject: Re: USB connection via I/O Kit functions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
David Phillip Oster wrote:

> In article , H
> wrote:
>
> > I want to connect to a USB device via the I/O Kit functions.
> > Unfortunately, this does not work.
> >
> > Actually my device has got basically a serial interface with an internal
> > USB - RS232 converter from Prolific. When using the BSD functions and
> > the driver /dev/cu.usbserial everything works when I set the
> > communication parameters correctly. My device needs XON/XOFF handshaking
> > and a start and stop bit. Furthermore, the data is 8 bit.
> > How do I tell the IOUSBInterfaceInterface environment that I need the
> > before mentioned parameters?
>
> Why do you need to use IOKit functions? Why not use the IOKit functions
> to get the POSIX name of the device, and manipulate the device from then
> on using POSIX calls. Use ioctl() to set the handshaking and bytesize.

I will have to do so but I prefer the IOKit interface style. In addition
to this - I would call it matter of taste, I get more information about
the attached device from the IOKit functions than from POSIX calls.
OK, I could mix both styles but this is something I personally do not
like at all.

Hartwig
 >> Stay informed about: USB connection via I/O Kit functions 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 694



(Msg. 4) Posted: Mon Feb 18, 2008 9:34 pm
Post subject: Re: USB connection via I/O Kit functions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article , H
wrote:

> In article ,
> David Phillip Oster wrote:
>
> > In article , H
> > wrote:
> >
> > > I want to connect to a USB device via the I/O Kit functions.
> > > Unfortunately, this does not work.
> > >
> > > Actually my device has got basically a serial interface with an internal
> > > USB - RS232 converter from Prolific. When using the BSD functions and
> > > the driver /dev/cu.usbserial everything works when I set the
> > > communication parameters correctly. My device needs XON/XOFF handshaking
> > > and a start and stop bit. Furthermore, the data is 8 bit.
> > > How do I tell the IOUSBInterfaceInterface environment that I need the
> > > before mentioned parameters?
> >
> > Why do you need to use IOKit functions? Why not use the IOKit functions
> > to get the POSIX name of the device, and manipulate the device from then
> > on using POSIX calls. Use ioctl() to set the handshaking and bytesize.
>
> I will have to do so but I prefer the IOKit interface style. In addition
> to this - I would call it matter of taste, I get more information about
> the attached device from the IOKit functions than from POSIX calls.
> OK, I could mix both styles but this is something I personally do not
> like at all.

Quoting:
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/Work...WSerial

"To communicate with a serial device from your Mac OS X application, use I/O Kit functions to obtain a path to the device file for that device. Then, implement traditional UNIX serial port access using the POSIX termios API. Your application can read and write data using the device file."
 >> Stay informed about: USB connection via I/O Kit functions 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
wchar_t functions with 10.2 compatibility - I'm using in a project wchar_t support functions (mbstowcs, swprintf, wclen...) and I've seen that the 10.2 libSystem doesn't have them, since my program fails with unresolved symbols if I launch it on 10.2. So I wrote some functions to replace them, bu...

Change Notification functions in Darwin? - Hi, I'm pretty new to the Mac, having a Windows and to some extent BSD background. I'm still making my way round the documentation. Apologies if I'm asking an obvious question, but I can't find the answer. I need to use change notification..

Newbie: Where to find documentation of functions - I'm new to the Mac, and am porting an application from Ms Windows using the wxWindows GUI framework, onto an iBook running OSX 10.1, using C++ with the Apple Development tools in makefiles etc. However I need to do a few system calls. What I cannot fin...

Stepping into functions broken in Xcode 1.2? - I upgraded to 1.2 and have noticed that attempting to step into a function call acts as if I told it to continue: it doesn't stop at the first instruction of the called function, but proceeds apace with execution. Anyone else noticed this, or have I..

Trouble with Functions in iTunes for Windows SDK - I'm running into some issues with functions in the iTunes for Windows SDK and am hoping someone here will be able to help. There are a few functions in the API/SDK that just don't seem to work, no matter how many different ways I try them. The one that...
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]