#include "AdapterCommunication.h"
#include "LibCEC.h"
-#include "libPlatform/serialport.h"
+#include "platform/serialport.h"
#include "util/StdString.h"
using namespace std;
CAdapterCommunication::~CAdapterCommunication(void)
{
+ StopThread();
m_port->Close();
+ delete m_port;
m_port = NULL;
}
break;
}
- CCondition::Sleep(50);
+ if (!m_bStop)
+ CCondition::Sleep(50);
}
- m_controller->AddLog(CEC_LOG_DEBUG, "reader thread terminated");
-
CLockObject lock(&m_commMutex);
m_bStarted = false;
return NULL;
{
uint8_t buff[1024];
CLockObject lock(&m_commMutex);
+ if (!m_port)
+ return false;
+
int iBytesRead = m_port->Read(buff, sizeof(buff), iTimeout);
lock.Leave();
if (iBytesRead < 0)