Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Three things you might check:</p> <h2>Canonical mode / non canonical mode mixup 1</h2> <p>You are mixing the canonical mode and the the non-canonical mode stuff:</p> <pre><code>ptr-&gt;serialdev.c_lflag = ( ICANON ); // ... ptr-&gt;serialdev.c_cc[VMIN] = 1; </code></pre> <p>The <code>termios(3)</code> manpage states about VMIN:</p> <blockquote> <p><strong>VMIN</strong> Minimum number of characters for <strong>non</strong>-canonical read.</p> </blockquote> <p>So clearly your timeout will not work the way you think.</p> <h2>Canonical mode / non canonical mode mixup 2</h2> <p>Additionally the manpage says further below:</p> <blockquote> <p>These symbolic subscript values are all different, except that VTIME, <strong>VMIN</strong> <strong>may</strong> have the same value as VEOL, <strong>VEOF</strong>, respectively. In non- canonical mode the special character meaning is replaced by the timeout meaning. For an explanation of VMIN and VTIME, see the description of non-canonical mode below.</p> </blockquote> <p>So please check if the definitions of these constants are different for your two platforms. It might be, that the EOL/EOF logic might be spoiled by the wrong setting. Both EOL and EOF migh cause a return from <code>read</code>.</p> <h2>Non-initialized <code>c_cc</code></h2> <p>Your code does not show a proper initialization of the <code>c_cc</code> array. You neither read the existing settings not provide suitable defaults for the values required for canonical modes. The code shown so far does not even clear the values. Therefore unpredictable values might be used. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload