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
b3326129
Commit
b3326129
authored
Aug 25, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ModbusTCPMaster): дописал обработку ошибки
parent
1ed98fda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
ModbusTCPMaster.cc
src/Communications/Modbus/ModbusTCPMaster.cc
+5
-12
No files found.
src/Communications/Modbus/ModbusTCPMaster.cc
View file @
b3326129
...
...
@@ -188,31 +188,24 @@ mbErrCode ModbusTCPMaster::query( ModbusAddr addr, ModbusMessage& msg,
if
(
ret
<
sizeof
(
reply
.
aduhead
)
)
{
#warning Разобраться с обработкой ошибки связи
#if 0
int port;
if
(
dlog
->
is_warn
()
)
{
const char* err = tcp->getErrorString();
try
{
Poco
::
Net
::
SocketAddress
iaddr
=
tcp
->
peerAddress
();
dlog
->
warn
()
<<
"(ModbusTCPMaster::query): ret="
<<
ret
<<
" < rmh="
<<
sizeof
(
reply
.
aduhead
)
<< " errnum: " << tcp->getErrorNumber()
<< " perr: " << tcp->getPeer(&port)
<< " err: " << (err ? string(err) : "")
<<
" perr: "
<<
iaddr
.
host
().
toString
()
<<
":"
<<
iaddr
.
port
()
<<
endl
;
}
catch( const
ost::SockException& e
)
catch
(
const
Poco
::
Net
::
NetException
&
ex
)
{
if
(
dlog
->
is_warn
()
)
dlog->warn() << "(query): tcp error: " << e
.getString
() << endl;
dlog
->
warn
()
<<
"(query): tcp error: "
<<
e
x
.
displayText
()
<<
endl
;
}
}
#endif
cleanInputStream
();
tcp
->
forceDisconnect
();
return
erTimeOut
;
// return erHardwareError;
...
...
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