Skip to content

Commit

Permalink
Release 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasMuellerILT committed May 25, 2016
1 parent b3843ad commit 37f8d70
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion SPI_Multidrop/ResourceProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Purpose: Implementation of the specific resource provider
@author Lukas Mueller (ilt.hsr.ch)
@version 0.1 2015_10_07
@version 0.2 2016_05_25
*/

#include "ResourceProvider.h"
Expand Down
60 changes: 30 additions & 30 deletions SPI_Multidrop/SpecificCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Purpose: Central class of a specific implemention. Usually used to communicate with the device. An instance is just deleted and new generated with the reset command. Every command can use it.
@author Lukas Mueller (ilt.hsr.ch)
@version 0.1 2015_06_12
@version 0.2 2016_05_25
*/

#include "SpecificCore.h"
Expand Down Expand Up @@ -2006,30 +2006,16 @@ namespace SPI
}
void SpecificCore::readedCallback(boost::system::error_code error, size_t size)
{
std::lock_guard<std::mutex> lockGuard(_processCoreMutex);
if(!error)
if(!_isClosing)
{
for(unsigned int i = 0; i < size; i++)
std::lock_guard<std::mutex> lockGuard(_processCoreMutex);
if(!error)
{
if(_readBuffer[i] == 13 && size > i+1 && _readBuffer[i+1] == 10)
{
i++;
if(_nextReceivingLine.length() > 0)
{
_receivedLines.push(_nextReceivingLine);
#ifdef RS232_COM_DEBUG
std::cout << "RS232 read: " << _nextReceivingLine << std::endl;
#endif
_receivedLinesCount += 1;
_nextReceivingLine = "";
}
}
else if(i == 0 && _readBuffer[0] == 10)
for(unsigned int i = 0; i < size; i++)
{
int indexLast = _nextReceivingLine.length() - 1;
if(_nextReceivingLine.at(indexLast) == 13)
if(_readBuffer[i] == 13 && size > i+1 && _readBuffer[i+1] == 10)
{
_nextReceivingLine.erase(indexLast);
i++;
if(_nextReceivingLine.length() > 0)
{
_receivedLines.push(_nextReceivingLine);
Expand All @@ -2040,17 +2026,31 @@ namespace SPI
_nextReceivingLine = "";
}
}
else if(i == 0 && _readBuffer[0] == 10)
{
int indexLast = _nextReceivingLine.length() - 1;
if(_nextReceivingLine.at(indexLast) == 13)
{
_nextReceivingLine.erase(indexLast);
if(_nextReceivingLine.length() > 0)
{
_receivedLines.push(_nextReceivingLine);
#ifdef RS232_COM_DEBUG
std::cout << "RS232 read: " << _nextReceivingLine << std::endl;
#endif
_receivedLinesCount += 1;
_nextReceivingLine = "";
}
}
}
else
{
_nextReceivingLine += _readBuffer[i];
}
}
else
{
_nextReceivingLine += _readBuffer[i];
}
_serial_port->async_read_some(boost::asio::buffer(_readBuffer, 1024), boost::bind(&SpecificCore::readedCallback, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
_serial_port->async_read_some(boost::asio::buffer(_readBuffer, 1024), boost::bind(&SpecificCore::readedCallback, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
else
{
if(!_isClosing)
else
{
_connectionErrorMessage = error.message();
_connectionError = true;
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
SPI_Multidrop Changelog

--- 2.0.2 --- 2016_05_25
- Update SPICE to 1.0.4 and POCO to 1.7.3
- Fixing Bug: Deadlock during startup on Debian in specific case (Missing Multidrop, RS232-Adapter available)

--- 2.0.1 --- 2016_01_20
- Update SPICE from 1.0.0 to 1.0.1

Expand Down

0 comments on commit 37f8d70

Please sign in to comment.