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:
This email sent to email@hidden
|