[NTLUG:Discuss] serial communications
james osburn
jjosburn at hotmail.com
Mon Nov 8 13:07:44 CST 2004
an how would a call to select or poll figure into this?
what i have inherited is a slot machine that was written a combination
of java and c and serial port monitor process written in c.
the serial port monitor reads from the serial port and has an open
message queue.
i am originally a visuall c++ programmer and i have some exposure
to linux and unix in college. so getting my mind around how to use
the serial port has been frustrating but ....
i like your analogy about block versus non blocking.
so if you use non block io ... how would then know when values are
available?
something like this:
while(1)
{
int ret = read(serial_fd,buff,size);
if(ret > 0 )
{
do something with the received bytes
}
}
what about using the function select?
thanks again to the group
jim
<html><DIV></DIV></html>
>From: "Burton M. Strauss III" <Burton_Strauss at comcast.net>
>Reply-To: NTLUG Discussion List <discuss at ntlug.org>
>To: "NTLUG Discussion List" <discuss at ntlug.org>
>Subject: RE: [NTLUG:Discuss] serial communications
>Date: Mon, 8 Nov 2004 11:47:47 -0600
>
>Pretty much what it sounds like ...
>
>Blocking I/O means that the user process is blocked (stopped) until the I/O
>completes.
>
>Non-Blocking I/O means that the user process can continue while the I/O is
>actually going on. It's then your responsibility to check later on to make
>sure it works.
>
>Think of it like calling me (Blocking) vs. sending eMail (non-Blocking).
>
>-----Burton
>
>
> > -----Original Message-----
> > From: discuss-bounces at ntlug.org [mailto:discuss-bounces at ntlug.org]On
> > Behalf Of james osburn
> > Sent: Monday, November 08, 2004 11:27 AM
> > To: discuss at ntlug.org
> > Subject: [NTLUG:Discuss] serial communications
> >
> >
> > whas is difference between block and non blocking io ?
> > jim
>
>
>_______________________________________________
>https://ntlug.org/mailman/listinfo/discuss
More information about the Discuss
mailing list