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: Handling of events on serial port



If you specifically want WaitCommEven-like informationt, you use select or poll and when an event happens you use an ioctl() to ask the status of the device contol lines.  In general, it is not useful to watch CTS/RTS events, since hardware flow control is handles in the line discipline layer, below the covers.

Additionally, if there is an on-to-off DCD transition, if the device is the controlling tty for a process, that process will be sent a SIGHUP if the TTY flag HUPCL is set and the flag CLOCAL is not set.

Finally, if it is the initial open, and DCD is low, the open will block until there is an off-to-on DCD transition, unless the device is the non-modem control node, or you specify O_NDELAY, either leaving all I/O as non-blocking or as part of performing the partial open hack.

Reading the getty sources might enlighten you some, but any UNIX serial programming guide worth the name will have already given you the information.

-- Terry

On Nov 3, 2008, at 2:46 AM, Rakesh Singhal <email@hidden> wrote:
Thanks but I have already gone through both things. Even I have read Serial programming Guide for POSIX Operating Systems from net. In Windows there are kind of events related APIs are given like WaitCommEvent etc. So I was thinking what is there in Mac for events. 
Regards
On Mon, Nov 3, 2008 at 3:59 PM, Phil <email@hidden> wrote:
On Mon, Nov 3, 2008 at 11:11 PM, Rakesh Singhal
<email@hidden> wrote:
> I am using the POSIX APIs to write a library to provide the wrapper functios
> for these APIs. I would like to know about handling the events for serial
> ports. How to handle these events occuring on serial ports? Which APIs I
> have to use?
>


_______________________________________________
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
 _______________________________________________
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: 
 >Handling of events on serial port (From: "Rakesh Singhal" <email@hidden>)
 >Re: Handling of events on serial port (From: Phil <email@hidden>)
 >Re: Handling of events on serial port (From: "Rakesh Singhal" <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.