Commit 11ce2fd3 authored by Pavel Vainerman's avatar Pavel Vainerman

(ComPort485F): Исправлен баг в функции reopen()

parent 89218c56
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.3
Release: alt17
Release: alt18
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -213,6 +213,9 @@ rm -f %buildroot%_libdir/*.la
%changelog
* Tue Apr 10 2012 Pavel Vainerman <pv@altlinux.ru> 1.3-alt18
- fixed bug in ComPort485F (reinit function)
* Fri Mar 16 2012 Pavel Vainerman <pv@altlinux.ru> 1.3-alt17
- rebuild
......
......@@ -93,8 +93,7 @@ public:
void setBlocking(bool blocking);
void cleanupChannel();
virtual void cleanupChannel();
virtual void reopen();
protected:
......
......@@ -27,6 +27,9 @@ class ComPort485F:
virtual void setTimeout( int timeout );
virtual int sendBlock( unsigned char*msg,int len );
virtual void cleanupChannel();
virtual void reopen();
protected:
virtual unsigned char m_receiveByte( bool wait );
......
......@@ -274,3 +274,23 @@ void ComPort485F::m_read( int tmsec )
}
}
// --------------------------------------------------------------------------------
void ComPort485F::cleanupChannel()
{
while( !wq.empty() )
wq.pop();
while( !rq.empty() )
rq.pop();
ComPort::cleanupChannel();
}
// --------------------------------------------------------------------------------
void ComPort485F::reopen()
{
while( !wq.empty() )
wq.pop();
while( !rq.empty() )
rq.pop();
ComPort::reopen();
}
// --------------------------------------------------------------------------------
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