Merge branch 'master' of github.com:g4klx/MMDVMHost

This commit is contained in:
Jonathan Naylor
2016-11-05 18:36:00 +00:00
10 changed files with 133 additions and 4 deletions

11
UMP.cpp
View File

@@ -41,6 +41,7 @@ const unsigned int BUFFER_LENGTH = 255U;
CUMP::CUMP(const std::string& port) :
m_serial(port, SERIAL_115200),
m_open(false),
m_buffer(NULL),
m_length(0U),
m_offset(0U),
@@ -58,6 +59,9 @@ CUMP::~CUMP()
bool CUMP::open()
{
if (m_open)
return true;
bool ret = m_serial.open();
if (!ret)
return false;
@@ -76,6 +80,8 @@ bool CUMP::open()
return false;
}
m_open = true;
return true;
}
@@ -243,5 +249,10 @@ void CUMP::clock(unsigned int ms)
void CUMP::close()
{
if (!m_open)
return;
m_serial.close();
m_open = false;
}