Test fixes
This commit is contained in:
@@ -100,6 +100,7 @@ size_t TimeoutSerial::read(char *data, size_t size)
|
|||||||
size_t toRead = 0;
|
size_t toRead = 0;
|
||||||
if(readData.size()>0)//If there is some data from a previous read
|
if(readData.size()>0)//If there is some data from a previous read
|
||||||
{
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(debug) << "UNCONSUMED DATA " << readData.size();
|
||||||
istream is(&readData);
|
istream is(&readData);
|
||||||
toRead=min(readData.size(),size);//How many bytes to read?
|
toRead=min(readData.size(),size);//How many bytes to read?
|
||||||
is.read(data,toRead);
|
is.read(data,toRead);
|
||||||
@@ -243,7 +244,7 @@ void TimeoutSerial::timeoutExpired(const boost::system::error_code& error)
|
|||||||
void TimeoutSerial::readCompleted(const boost::system::error_code& error,
|
void TimeoutSerial::readCompleted(const boost::system::error_code& error,
|
||||||
const size_t bytesTransferred)
|
const size_t bytesTransferred)
|
||||||
{
|
{
|
||||||
if(!error || error.value() == 158)
|
if(!error)
|
||||||
{
|
{
|
||||||
result=resultSuccess;
|
result=resultSuccess;
|
||||||
this->bytesTransferred+=bytesTransferred;
|
this->bytesTransferred+=bytesTransferred;
|
||||||
|
|||||||
Reference in New Issue
Block a user