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

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

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