wich condition(events) can produce EOF in serial port in blocked raw mode????

From: cvv (cvv_serial_at_email.zp.ua)
Date: 11/09/05


Date: 9 Nov 2005 03:50:36 -0800

OS:linux 2.4.26

sometimes, possible after noise in line, I receive situation when
select() on port return then there are data available for read but
following read() return 0 bytes.

according to man tcsetattr and analogue with socket I understand this
situation as EOF.

All following pair select()/read() return same situation regardless
from data in port.

serial port open/tune via code:

<code>
port->fd = open(devfile, O_RDWR | O_NOCTTY);

    if (port->fd == -1) {syslog(LOG_ERR,"watcher_open_port():error
opening '%s': %m", devfile); free(port);return NULL; }

    if (tcgetattr(port->fd, &ti) < 0)

       { syslog(LOG_ERR, "%s(%s):error getting terminal line modes:
%m",__func__, devfile); close(port->fd);free(port); return
NULL; }

    cfmakeraw(&ti);

    cfsetispeed(&ti, WATCHER_PORT_SPEED);

    cfsetospeed(&ti, WATCHER_PORT_SPEED);

        //c_iflag &=
~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);

    ti.c_iflag |= IGNBRK;//???возможно имеет смысл
оставить этот флаг снятым а вместо
него поднять BRKINT???
    ti.c_iflag |= IGNPAR;//Ignore framing errors and parity errors.

    ti.c_iflag &= ~(INPCK | PARMRK);

    ti.c_iflag &= ~(IXOFF | IXON | IXANY); /* disable start/stop i/o
flow control*/

        //c_oflag &= ~OPOST;

    ti.c_cflag &= ~(PARENB | PARODD); /* no parity */

    ti.c_cflag &= ~CSTOPB; /* 1 stop bit */

    ti.c_cflag &= ~CRTSCTS; /* no i/o rts/cts flow control
*/
    ti.c_cflag |= CLOCAL;

    ti.c_cflag |= HUPCL;

    ti.c_cflag |= CREAD;

        //c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);

        //Disable flushing the input and output queues when
generating the SIGINT, SIGQUIT and SIGSUSP signals.
        //ti.c_lflag &= ~(NOFLSH);//???возможно
потребуется установить/снять???

    ti.c_cc[VMIN] = 0;

    ti.c_cc[VTIME] = 0;

    if (tcsetattr(port->fd, TCSANOW, &ti) < 0)

       { syslog(LOG_ERR,"%s(%s):error setting terminal line modes: %m",
__func__, devfile); close(port->fd);free(port); return
 NULL; }
</code>

any idea???



Relevant Pages

  • Re: Noise simulation problems
    ... I am getting a bit confused with the Noise Simulation with Spectre. ... Psin port as output, having R=50 as well. ... problem with my set-up, NF simulations, or perhaps the rfLib component? ...
    (comp.cad.cadence)
  • Re: to make a TSR
    ... I use port 61h. ... then i run B25 i have always a low frequency noise. ... i run again B12 and i have always a noise ... Bitfields for KB ctrller port B control register ...
    (alt.lang.asm)
  • Whats the status of Seaside on D6
    ... I know Esteban has been working on a port of Seaside for Dolphin... ... As there is a lot of noise in the Ruby camp about how good Ruby and Rails ...
    (comp.lang.smalltalk.dolphin)
  • Re: Looking for firewall that logs port scans
    ... every port scan, especially to the point of filling up your log files. ... is noise is noise. ... have a small home network. ... suitable alternative to the SMC. ...
    (comp.security.firewalls)
  • Re: input-referred port noise
    ... I am doing spectre noise analysis and I am expecting the input-referred ... noise power of a power to be just 4kTR, where R is the port impedance. ... The input referred noise is referred back to the source within the port - and so ...
    (comp.cad.cadence)