From: andreaskoepke Date: Tue, 26 Feb 2008 18:17:04 +0000 (+0000) Subject: change queue behavior for packets read from node while no client is connected X-Git-Tag: release_tinyos_2_1_0_0~500 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=975668e1509e727af2a3067bc9fe12f1ca1d109f;p=tinyos-2.x.git change queue behavior for packets read from node while no client is connected from drop tail to drop head --- diff --git a/support/sdk/cpp/sf/serialcomm.cpp b/support/sdk/cpp/sf/serialcomm.cpp index ea4e4bfa..5920a724 100644 --- a/support/sdk/cpp/sf/serialcomm.cpp +++ b/support/sdk/cpp/sf/serialcomm.cpp @@ -642,7 +642,11 @@ void SerialComm::readSerial() } else { - ++droppedReadPacketCount; + while(readBuffer.isFull()) { + readBuffer.dequeue(); + ++droppedReadPacketCount; + } + readBuffer.enqueueBack(packet); // DEBUG("SerialComm::readSerial : dropped packet") } }