Commit 85bae815 authored by ahoms's avatar ahoms
Browse files

* added Espia::serGetAvailableBytes


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@56 45c4679d-1946-429d-baad-37912b19538b
parent e151726b
...@@ -60,6 +60,7 @@ class Espia ...@@ -60,6 +60,7 @@ class Espia
void serReadStr(std::string& buffer, int len, void serReadStr(std::string& buffer, int len,
const std::string& term, double timeout); const std::string& term, double timeout);
void serFlush(); void serFlush();
void serGetAvailableBytes(int& available_bytes);
static void throwError(int ret, std::string file, std::string func, static void throwError(int ret, std::string file, std::string func,
int line); int line);
......
...@@ -340,6 +340,13 @@ void Espia::serFlush() ...@@ -340,6 +340,13 @@ void Espia::serFlush()
{ {
CHECK_CALL(espia_ser_flush(m_dev)); CHECK_CALL(espia_ser_flush(m_dev));
} }
void Espia::serGetAvailableBytes(int& available_bytes)
{
unsigned long ret_bytes = 0;
CHECK_CALL(espia_ser_read(m_dev, NULL, &ret_bytes, 0));
available_bytes = ret_bytes;
}
void Espia::throwError(int ret, string file, string func, int line) void Espia::throwError(int ret, string file, string func, int line)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment