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
9b58e430
Commit
9b58e430
authored
Feb 09, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ModbusSlave): добавил вывод в vmonit информации host:port setbug #9012
parent
0e75f4e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
libuniset2.spec
conf/libuniset2.spec
+4
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+17
-0
ModbusTCPServer.h
include/modbus/ModbusTCPServer.h
+3
-0
ModbusTCPServer.cc
src/Communications/Modbus/ModbusTCPServer.cc
+3
-2
No files found.
conf/libuniset2.spec
View file @
9b58e430
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
Name: libuniset2
Name: libuniset2
Version: 2.2
Version: 2.2
Release: alt2
1
Release: alt2
2
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
...
@@ -451,6 +451,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
...
@@ -451,6 +451,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
# ..
%changelog
%changelog
* Tue Feb 09 2016 Pavel Vainerman <pv@altlinux.ru> 2.2-alt22
- ModbusSlave(TCP): add show ip:port to vmonit setbug #9012
* Sat Feb 06 2016 Pavel Vainerman <pv@altlinux.ru> 2.2-alt21
* Sat Feb 06 2016 Pavel Vainerman <pv@altlinux.ru> 2.2-alt21
- RRDServer: fixed bug in write sequence to rrd base
- RRDServer: fixed bug in write sequence to rrd base
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
9b58e430
...
@@ -2391,13 +2391,30 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam )
...
@@ -2391,13 +2391,30 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam )
{
{
UniSetTypes
::
SimpleInfo_var
i
=
UniSetObject
::
getInfo
(
userparam
);
UniSetTypes
::
SimpleInfo_var
i
=
UniSetObject
::
getInfo
(
userparam
);
auto
sslot
=
dynamic_pointer_cast
<
ModbusTCPServerSlot
>
(
mbslot
);
ostringstream
inf
;
ostringstream
inf
;
inf
<<
i
->
info
<<
endl
;
inf
<<
i
->
info
<<
endl
;
if
(
sslot
)
// т.е. если у нас tcp
{
ost
::
InetAddress
iaddr
=
sslot
->
getInetAddress
();
inf
<<
"TCPModbusSlave: "
<<
iaddr
<<
endl
;
}
inf
<<
vmon
.
pretty_str
()
<<
endl
;
inf
<<
vmon
.
pretty_str
()
<<
endl
;
inf
<<
"LogServer: "
<<
logserv_host
<<
":"
<<
logserv_port
<<
endl
;
inf
<<
"LogServer: "
<<
logserv_host
<<
":"
<<
logserv_port
<<
endl
;
inf
<<
"iomap="
<<
iomap
.
size
()
<<
" myaddr: "
<<
ModbusServer
::
vaddr2str
(
vaddr
)
<<
endl
;
inf
<<
"iomap="
<<
iomap
.
size
()
<<
" myaddr: "
<<
ModbusServer
::
vaddr2str
(
vaddr
)
<<
endl
;
inf
<<
"Statistic: askCount="
<<
askCount
<<
" pingOK="
<<
pingOK
<<
endl
;
inf
<<
"Statistic: askCount="
<<
askCount
<<
" pingOK="
<<
pingOK
<<
endl
;
if
(
sslot
)
// т.е. если у нас tcp
{
ost
::
InetAddress
iaddr
=
sslot
->
getInetAddress
();
inf
<<
"TCP: "
<<
iaddr
<<
":"
<<
sslot
->
getInetPort
()
<<
endl
;
}
i
->
info
=
inf
.
str
().
c_str
();
i
->
info
=
inf
.
str
().
c_str
();
return
i
.
_retn
();
return
i
.
_retn
();
...
...
include/modbus/ModbusTCPServer.h
View file @
9b58e430
...
@@ -78,6 +78,9 @@ class ModbusTCPServer:
...
@@ -78,6 +78,9 @@ class ModbusTCPServer:
void
getSessions
(
Sessions
&
lst
);
void
getSessions
(
Sessions
&
lst
);
inline
ost
::
InetAddress
getInetAddress
(){
return
iaddr
;
}
inline
ost
::
tpport_t
getInetPort
(){
return
port
;
}
protected
:
protected
:
virtual
ModbusRTU
::
mbErrCode
pre_send_request
(
ModbusRTU
::
ModbusMessage
&
request
)
override
;
virtual
ModbusRTU
::
mbErrCode
pre_send_request
(
ModbusRTU
::
ModbusMessage
&
request
)
override
;
...
...
src/Communications/Modbus/ModbusTCPServer.cc
View file @
9b58e430
...
@@ -8,8 +8,9 @@ using namespace std;
...
@@ -8,8 +8,9 @@ using namespace std;
using
namespace
ModbusRTU
;
using
namespace
ModbusRTU
;
using
namespace
UniSetTypes
;
using
namespace
UniSetTypes
;
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
ModbusTCPServer
::
ModbusTCPServer
(
ost
::
InetAddress
&
ia
,
int
port
)
:
ModbusTCPServer
::
ModbusTCPServer
(
ost
::
InetAddress
&
ia
,
int
_port
)
:
TCPSocket
(
ia
,
port
),
TCPSocket
(
ia
,
_port
),
port
(
_port
),
iaddr
(
ia
),
iaddr
(
ia
),
ignoreAddr
(
false
),
ignoreAddr
(
false
),
maxSessions
(
10
),
maxSessions
(
10
),
...
...
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