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
8077b2fb
Commit
8077b2fb
authored
Jun 28, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(step 3): fixes after coverity scan
parent
053f990d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+5
-7
MBTCPMultiMaster.h
extensions/ModbusMaster/MBTCPMultiMaster.h
+0
-1
EventLoopServer.h
include/EventLoopServer.h
+1
-1
ModbusTypes.cc
src/Communications/Modbus/ModbusTypes.cc
+3
-1
No files found.
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
8077b2fb
...
...
@@ -422,12 +422,6 @@ void MBTCPMultiMaster::MBSlaveInfo::setUse( bool st )
use
=
st
;
}
// -----------------------------------------------------------------------------
bool
MBTCPMultiMaster
::
MBSlaveInfo
::
isUse
()
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutInit
);
return
use
;
}
// -----------------------------------------------------------------------------
bool
MBTCPMultiMaster
::
MBSlaveInfo
::
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
)
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutInit
);
...
...
@@ -543,7 +537,11 @@ void MBTCPMultiMaster::check_thread()
{
bool
set
=
it
->
respond_invert
?
!
r
:
r
;
shm
->
localSetValue
(
it
->
respond_it
,
it
->
respond_id
,
(
set
?
1
:
0
),
getId
());
it
->
respond_init
=
true
;
{
std
::
lock_guard
<
std
::
mutex
>
l
(
it
->
mutInit
);
it
->
respond_init
=
true
;
}
}
}
catch
(
const
uniset
::
Exception
&
ex
)
...
...
extensions/ModbusMaster/MBTCPMultiMaster.h
View file @
8077b2fb
...
...
@@ -354,7 +354,6 @@ namespace uniset
bool
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
);
bool
check
();
void
setUse
(
bool
st
);
bool
isUse
();
timeout_t
recv_timeout
;
timeout_t
aftersend_pause
;
...
...
include/EventLoopServer.h
View file @
8077b2fb
...
...
@@ -63,7 +63,7 @@ namespace uniset
std
::
mutex
looprunOK_mutex
;
std
::
condition_variable
looprunOK_event
;
std
::
atomic_bool
isrunning
;
std
::
atomic_bool
isrunning
=
{
false
}
;
ev
::
timer
evruntimer
;
};
// -------------------------------------------------------------------------
...
...
src/Communications/Modbus/ModbusTypes.cc
View file @
8077b2fb
...
...
@@ -757,7 +757,9 @@ namespace uniset
void
ReadInputStatusMessage
::
init
(
const
ModbusMessage
&
m
)
{
assert
(
m
.
pduhead
.
func
==
fnReadInputStatus
);
memcpy
(
this
,
&
(
m
.
pduhead
),
sizeof
(
m
.
pduhead
)
+
szData
());
func
=
m
.
pduhead
.
func
;
addr
=
m
.
pduhead
.
addr
;
memcpy
(
&
start
,
&
m
.
data
,
szData
());
// переворачиваем слова
start
=
SWAPSHORT
(
start
);
...
...
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