Fixes
This commit is contained in:
3
TODO
3
TODO
@@ -1 +1,2 @@
|
||||
Code 0x41 A1 stage lookup in RS PRO problem
|
||||
Pravdepodobne nejaky bug v TimeoutSerial read v tom ze cita s oneskorenim 1
|
||||
Length 1 a potom este pise TimeoutSerial
|
||||
@@ -91,10 +91,11 @@ void TimeoutSerial::writeString(const std::string& s)
|
||||
|
||||
size_t TimeoutSerial::read(char *data, size_t size)
|
||||
{
|
||||
size_t toRead = 0;
|
||||
if(readData.size()>0)//If there is some data from a previous read
|
||||
{
|
||||
istream is(&readData);
|
||||
size_t toRead=min(readData.size(),size);//How many bytes to read?
|
||||
toRead=min(readData.size(),size);//How many bytes to read?
|
||||
is.read(data,toRead);
|
||||
data+=toRead;
|
||||
size-=toRead;
|
||||
@@ -113,7 +114,7 @@ size_t TimeoutSerial::read(char *data, size_t size)
|
||||
asio::placeholders::error));
|
||||
|
||||
result=resultInProgress;
|
||||
bytesTransferred=0;
|
||||
bytesTransferred=toRead;
|
||||
for(;;)
|
||||
{
|
||||
io.run_one();
|
||||
@@ -238,7 +239,7 @@ void TimeoutSerial::readCompleted(const boost::system::error_code& error,
|
||||
if(!error || error.value() == 158)
|
||||
{
|
||||
result=resultSuccess;
|
||||
this->bytesTransferred=bytesTransferred;
|
||||
this->bytesTransferred+=bytesTransferred;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ Ymodem::Code Ymodem::receivePacket()
|
||||
{
|
||||
uint32_t len = read(&(rxBuffer[1]), YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 1);
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Len = " << len;
|
||||
BOOST_LOG_TRIVIAL(debug) << "Len = " << len << " Start = " << rxBuffer[1];
|
||||
|
||||
if(len < (YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 1))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user