Menu

#2 unwanted CR/LF translations

Unstable (example)
open
nobody
None
5
2018-12-14
2018-06-26
PypeBros
No

I noted CR/LF translations within VISCA packets exchanged with an old version of libvisca (1.0.0?) which I fixed with

--- a/src/libvisca.c Thu Jun 21 10:08:32 2018 +0200
+++ b/src/libvisca.c Tue Jun 26 13:25:33 2018 +0200
@@ -272,9 +272,11 @@
/ input flags /
interface->options.c_iflag &= ~(INPCK | ISTRIP); / no parity /
interface->options.c_iflag &= ~(IXON | IXOFF | IXANY); / no soft ctl /
+ interface->options.c_iflag &= ~( INLCR | IGNCR | ICRNL); / binary protocol /

   /* output flags */
   interface->options.c_oflag &= ~OPOST; /* raw output */
  • interface->options.c_oflag &= ~( ONLCR | ONOCR | OCRNL | ONLRET ); / binary protocol /

    tcsetattr(fd, TCSANOW, &interface->options);

You seem to have similar fix in libvisca_posix on 1.1.0 for input flags, but not for output flags, which were also set on my platform.

Discussion

  • PypeBros

    PypeBros - 2018-06-26
    --- a/src/libvisca.c    Thu Jun 21 10:08:32 2018 +0200
    +++ b/src/libvisca.c    Tue Jun 26 13:25:33 2018 +0200
    @@ -272,9 +272,11 @@
           /* input flags */
           interface->options.c_iflag &= ~(INPCK | ISTRIP); /* no parity */
           interface->options.c_iflag &= ~(IXON | IXOFF | IXANY); /* no soft ctl */
    +      interface->options.c_iflag &= ~( INLCR | IGNCR | ICRNL); /* binary protocol */
    
           /* output flags */
           interface->options.c_oflag &= ~OPOST; /* raw output */
    +      interface->options.c_oflag &= ~( ONLCR | ONOCR | OCRNL | ONLRET ); /* binary protocol */
    
           tcsetattr(fd, TCSANOW, &interface->options);
    
     
  • Damien Douxchamps

    So you recommend uncommenting the to input flag lines too?
    (those are commented out in the current release)

    interface->options.c_iflag &= ~(INPCK | ISTRIP); /* no parity */
    interface->options.c_iflag &= ~(IXON | IXOFF | IXANY); /* no soft ctl */
    

    I haven't touched libvisca in years so I really can't tell if this is a good idea or not... Please enlighten me ;-)

     
  • PypeBros

    PypeBros - 2018-12-14

    if I'm reading my patch correctly, it looks like the lines about parity and soft control were already in the code. the lines with a + are the only one to change (sorry if this is obvious, which would mean I misunderstood your question).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.