Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
2cf1c098
Commit
2cf1c098
authored
Nov 12, 2010
by
Pavel Vaynerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Откатил изменения по СomPort
parent
3e5b5a27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
libuniset.spec
conf/libuniset.spec
+4
-1
ComPort.cc
src/Communications/ComPort.cc
+7
-11
No files found.
conf/libuniset.spec
View file @
2cf1c098
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 0.99
Version: 0.99
Release: eter1
3
Release: eter1
5
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)
...
...
src/Communications/ComPort.cc
View file @
2cf1c098
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment