]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
change queue behavior for packets read from node while no client is connected
authorandreaskoepke <andreaskoepke>
Tue, 26 Feb 2008 18:17:04 +0000 (18:17 +0000)
committerandreaskoepke <andreaskoepke>
Tue, 26 Feb 2008 18:17:04 +0000 (18:17 +0000)
from drop tail to drop head

support/sdk/cpp/sf/serialcomm.cpp

index ea4e4bfa142401c7a3d3735206aee5f680bc18bc..5920a7240259b0901db6c3f2a28ebf713be244b2 100644 (file)
@@ -642,7 +642,11 @@ void SerialComm::readSerial()
             }
             else
             {
-                ++droppedReadPacketCount;
+                while(readBuffer.isFull()) {
+                    readBuffer.dequeue();
+                    ++droppedReadPacketCount;
+                }
+                readBuffer.enqueueBack(packet);
                 // DEBUG("SerialComm::readSerial : dropped packet")
             }
         }