Revision: 7254
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7254&view=rev
Author:   thjc
Date:     2009-01-07 18:45:27 +0000 (Wed, 07 Jan 2009)

Log Message:
-----------
Merge from 2-1 of 7251-7252:
Applied patch 2164569:
p2os driver - OSX serial flags

Modified Paths:
--------------
    code/player/trunk/server/drivers/mixed/p2os/p2os.cc

Property Changed:
----------------
    code/player/trunk/


Property changes on: code/player/trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/code/player/branches/release-2-1-patches:6672-6673,6738,6834,6886,6905,6930,6936,6946,6951,6955,6975,6979-6981,6985,6987-6996,7087-7088,7204,7226,7230,7248,7250
/code/player/trunk:6985
   + 
/code/player/branches/release-2-1-patches:6672-6673,6738,6834,6886,6905,6930,6936,6946,6951,6955,6975,6979-6981,6985,6987-6996,7087-7088,7204,7226,7230,7248,7250-7252
/code/player/trunk:6985

Modified: code/player/trunk/server/drivers/mixed/p2os/p2os.cc
===================================================================
--- code/player/trunk/server/drivers/mixed/p2os/p2os.cc 2009-01-07 18:41:35 UTC 
(rev 7253)
+++ code/player/trunk/server/drivers/mixed/p2os/p2os.cc 2009-01-07 18:45:27 UTC 
(rev 7254)
@@ -844,7 +844,7 @@
       this->psos_fd = -1;
       return(1);
     }
-
+#endif
     if((flags = fcntl(this->psos_fd, F_GETFL)) < 0)
     {
       perror("P2OS::Setup():fcntl()");
@@ -852,14 +852,18 @@
       this->psos_fd = -1;
       return(1);
     }
-#endif
 
     // radio modem initialization code, courtesy of Kim Jinsuck
     //   <jinsu...@cs.tamu.edu>
     if(this->radio_modemp)
     {
       puts("Initializing radio modem...");
-      write(this->psos_fd, "WMS2\r", 5);
+      int ret = write(this->psos_fd, "WMS2\r", 5);
+      if (ret < 5)
+      {
+         PLAYER_ERROR1("P2OS: Write failed to complete (%d)",ret);
+         return 1;
+      }
 
       usleep(50000);
       char modem_buf[50];
@@ -878,7 +882,12 @@
       while(strstr(modem_buf, "ected to addres") == NULL)
       {
         puts("Initializing radio modem...");
-        write(this->psos_fd, "WMS2\r", 5);
+        int ret = write(this->psos_fd, "WMS2\r", 5);
+        if (ret < 5)
+        {
+               PLAYER_ERROR1("P2OS: Failed to write full packet to modem 
(%d)", ret);
+               return 1;
+        }
 
         usleep(50000);
         char modem_buf[50];
@@ -1643,9 +1652,9 @@
     }
 
     if(packet.packet[0] == 0xFA && packet.packet[1] == 0xFB &&
-       (packet.packet[3] == 0x30 || packet.packet[3] == 0x31) ||
-       (packet.packet[3] == 0x32 || packet.packet[3] == 0x33) ||
-       (packet.packet[3] == 0x34))
+       (packet.packet[3] == 0x30 || packet.packet[3] == 0x31 ||
+       packet.packet[3] == 0x32 || packet.packet[3] == 0x33 ||
+       packet.packet[3] == 0x34))
     {
 
       /* It is a server packet, so process it */
@@ -1705,10 +1714,10 @@
       }
     }
     else if(packet.packet[0] == 0xFA && packet.packet[1] == 0xFB &&
-            (packet.packet[3] == 0x50 || packet.packet[3] == 0x80) ||
-//            (packet.packet[3] == 0xB0 || packet.packet[3] == 0xC0) ||
-            (packet.packet[3] == 0xC0) ||
-            (packet.packet[3] == 0xD0 || packet.packet[3] == 0xE0))
+            (packet.packet[3] == 0x50 || packet.packet[3] == 0x80 ||
+//            packet.packet[3] == 0xB0 || packet.packet[3] == 0xC0 ||
+            packet.packet[3] == 0xC0 ||
+            packet.packet[3] == 0xD0 || packet.packet[3] == 0xE0))
     {
       /* It is a vision packet from the old Cognachrome system*/
 
@@ -2379,12 +2388,15 @@
                     imager_config->contrast);
 
     if (imager_config->autogain >= 0)
+    {
       if (imager_config->autogain == 0)
         np += sprintf((char*)&cam_command[np], " 19 32");
       else
         np += sprintf((char*)&cam_command[np], " 19 33");
+    }
 
     if (imager_config->colormode >= 0)
+    {
       if (imager_config->colormode == 3)
         np += sprintf((char*)&cam_command[np], " 18 36");
       else if (imager_config->colormode == 2)
@@ -2393,6 +2405,7 @@
         np += sprintf((char*)&cam_command[np], " 18 44");
       else
         np += sprintf((char*)&cam_command[np], " 18 40");
+    }
 
     if (np > 6)
     {


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

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to