Revision: 6990
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6990&view=rev
Author:   thjc
Date:     2008-08-30 01:51:59 +0000 (Sat, 30 Aug 2008)

Log Message:
-----------
[ 2074625 ] serialstream fix for osx

Modified Paths:
--------------
    
code/player/branches/release-2-1-patches/server/drivers/opaque/serialstream.cc

Modified: 
code/player/branches/release-2-1-patches/server/drivers/opaque/serialstream.cc
===================================================================
--- 
code/player/branches/release-2-1-patches/server/drivers/opaque/serialstream.cc  
    2008-08-30 01:40:04 UTC (rev 6989)
+++ 
code/player/branches/release-2-1-patches/server/drivers/opaque/serialstream.cc  
    2008-08-30 01:51:59 UTC (rev 6990)
@@ -61,6 +61,9 @@
 - buffer_size (integer
   - The size of the buffer to be used when reading, this is the maximum that 
can be read in one read command
   - Default 4096
+ 
+- parity
+ - The parity that you want. Vaid vaules are "none" (default), "even", "odd"
 
 @par Example
 
@@ -394,7 +397,9 @@
   }
 
   // save the current io settings
-  tcgetattr(opaque_fd, &oldtio);
+  if (tcgetattr(opaque_fd, &oldtio) < 0) {
+       PLAYER_WARN("Failed to get old tty attributes");
+  }
 
   // set up new settings
   UpdateFlags();
@@ -420,7 +425,13 @@
        // set up new settings
        struct termios newtio;
        memset(&newtio, 0,sizeof(newtio));
-       newtio.c_cflag = CS8 | CREAD;
+       
+       if(tcgetattr( this->opaque_fd, &newtio ) < 0 )
+               PLAYER_WARN("Failed to get old tty attribltes");
+       
+       newtio.c_cc[VMIN] = 0;
+       newtio.c_cc[VTIME] = 0;
+       newtio.c_cflag = CS8 | CREAD; 
        newtio.c_iflag = INPCK;
        newtio.c_oflag = 0;
        newtio.c_lflag = 0;
@@ -432,8 +443,9 @@
                newtio.c_cflag |= PARENB | PARODD;
        else
                PLAYER_WARN("Invalid parity. Defaulting to none.");
-
-       tcsetattr(opaque_fd, TCSANOW, &newtio);
+       
+       if(tcsetattr(opaque_fd, TCSANOW, &newtio) < 0)
+               PLAYER_ERROR("Failed to set new tty device attributes");
        tcflush(opaque_fd, TCIOFLUSH);
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to