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
5e03f449
Commit
5e03f449
authored
Jun 09, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Очередная попытка исправить периодиеские подвисания ModbusSlave.
parent
9ce79082
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
libuniset.spec
conf/libuniset.spec
+4
-1
ComPort.cc
src/Communications/ComPort.cc
+6
-3
ModbusRTUSlave.cc
src/Communications/Modbus/ModbusRTUSlave.cc
+1
-0
ModbusServer.cc
src/Communications/Modbus/ModbusServer.cc
+0
-0
No files found.
conf/libuniset.spec
View file @
5e03f449
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 1.0
Version: 1.0
Release: alt3
7
Release: alt3
8
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++
...
@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -207,6 +207,9 @@ rm -f %buildroot%_libdir/*.la
%changelog
%changelog
* Thu Jun 09 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt38
- fied bug in ComPort::cleanupChannel()
* Sun Jun 05 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt37
* Sun Jun 05 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt37
- add cleanup before send for ComPort
- add cleanup before send for ComPort
...
...
src/Communications/ComPort.cc
View file @
5e03f449
...
@@ -309,6 +309,10 @@ void ComPort::cleanupChannel()
...
@@ -309,6 +309,10 @@ void ComPort::cleanupChannel()
*/
*/
unsigned
char
tmpbuf
[
100
];
unsigned
char
tmpbuf
[
100
];
int
k
=
0
;
int
k
=
0
;
bool
old_waiting
=
waiting
;
waiting
=
false
;
int
mask
=
fcntl
(
fd
,
F_GETFL
);
fcntl
(
fd
,
F_SETFL
,
O_NONBLOCK
);
try
try
{
{
do
do
...
@@ -319,9 +323,8 @@ void ComPort::cleanupChannel()
...
@@ -319,9 +323,8 @@ void ComPort::cleanupChannel()
}
}
catch
(...){}
catch
(...){}
// #warning Обнулять нельзя, может надо делать что-то интелектуальнее...
fcntl
(
fd
,
F_SETFL
,
mask
);
// curSym = 0;
waiting
=
old_waiting
;
// bufLength = 0;
}
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
void
ComPort
::
setSpeed
(
std
::
string
s
)
void
ComPort
::
setSpeed
(
std
::
string
s
)
...
...
src/Communications/Modbus/ModbusRTUSlave.cc
View file @
5e03f449
...
@@ -81,6 +81,7 @@ mbErrCode ModbusRTUSlave::receive( ModbusRTU::ModbusAddr addr, timeout_t timeout
...
@@ -81,6 +81,7 @@ mbErrCode ModbusRTUSlave::receive( ModbusRTU::ModbusAddr addr, timeout_t timeout
}
}
// dlog[Debug::WARN] << "(receive): " << mbErr2Str(res) << endl;
// dlog[Debug::WARN] << "(receive): " << mbErr2Str(res) << endl;
// cerr << "**** (receive): " << mbErr2Str(res) << endl;
usleep
(
10000
);
usleep
(
10000
);
return
res
;
return
res
;
}
}
...
...
src/Communications/Modbus/ModbusServer.cc
View file @
5e03f449
This diff is collapsed.
Click to expand it.
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