Commit 2cf1c098 authored by Pavel Vaynerman's avatar Pavel Vaynerman

Откатил изменения по СomPort

parent 3e5b5a27
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.99 Version: 0.99
Release: eter13 Release: eter15
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++
...@@ -184,6 +184,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -184,6 +184,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Fri Nov 12 2010 Pavel Vainerman <pv@etersoft.ru> 0.99-eter14
- new build
* Thu Nov 11 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter13 * Thu Nov 11 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter13
- uniset-admin refactor. ( [get|set]Value, call remote sensors) - uniset-admin refactor. ( [get|set]Value, call remote sensors)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
***************************************************************************/ ***************************************************************************/
/*! \file /*! \file
* \brief Обращения к последовательным интерфейсам * \brief Обращения к последовательным интерфейсам
* \author Nick Lezzhov * \author Nick Lezzhov, Pavel Veynerman, Vitaly Lipatov
* \date $Date: 2009/02/24 20:27:25 $ * \date $Date: 2009/02/24 20:27:25 $
*/ */
/**************************************************************************/ /**************************************************************************/
...@@ -198,12 +198,12 @@ unsigned char ComPort::m_receiveByte( bool wait ) ...@@ -198,12 +198,12 @@ unsigned char ComPort::m_receiveByte( bool wait )
/* select' returns 0 if timeout, 1 if input available, -1 if error. */ /* select' returns 0 if timeout, 1 if input available, -1 if error. */
if(select(FD_SETSIZE, &set, NULL, NULL, &timeout)==1) if(select(FD_SETSIZE, &set, NULL, NULL, &timeout)==1)
bufLength= ::read(fd,buf,BufSize); bufLength = ::read(fd,buf,BufSize);
else else
bufLength=-1; bufLength = -1;
} }
else else
bufLength= ::read(fd,buf,BufSize); bufLength = ::read(fd,buf,BufSize);
if(bufLength <= 0) if(bufLength <= 0)
{ {
throw UniSetTypes::TimeOut(); throw UniSetTypes::TimeOut();
...@@ -299,9 +299,6 @@ void ComPort::cleanupChannel() ...@@ -299,9 +299,6 @@ void ComPort::cleanupChannel()
if( fd < 0 ) if( fd < 0 )
return; return;
int oldfl = fcntl(fd, F_GETFL);
fcntl(fd,F_SETFL,O_NONBLOCK);
unsigned char tmpbuf[100]; unsigned char tmpbuf[100];
int k = 0; int k = 0;
do do
...@@ -310,10 +307,9 @@ void ComPort::cleanupChannel() ...@@ -310,10 +307,9 @@ void ComPort::cleanupChannel()
} }
while( k>0 ); while( k>0 );
fcntl(fd,F_SETFL,oldfl); // #warning Обнулять нельзя, может надо делать что-то интелектуальнее...
// curSym = 0;
// curSym = 0; // bufLength = 0;
// bufLength=-1;
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
void ComPort::setSpeed( std::string s ) void ComPort::setSpeed( std::string s )
......
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