Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0f05862d
Commit
0f05862d
authored
Dec 02, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1057 from DonLakeFlyer/MockLinkCrash
Fix param crash and connect/disconnect
parents
cd6f10d3
432a42d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
MockLink.cc
src/qgcunittest/MockLink.cc
+20
-20
No files found.
src/qgcunittest/MockLink.cc
View file @
0f05862d
...
...
@@ -100,23 +100,24 @@ void MockLink::readBytes(void)
bool
MockLink
::
_connect
(
void
)
{
_connected
=
true
;
start
();
emit
connected
(
);
emit
connected
(
true
);
if
(
!
_connected
)
{
_connected
=
true
;
start
();
emit
connected
();
emit
connected
(
true
);
}
return
true
;
}
bool
MockLink
::
_disconnect
(
void
)
{
_connected
=
false
;
exit
();
emit
disconnected
();
emit
connected
(
false
);
if
(
_connected
)
{
_connected
=
false
;
exit
();
emit
disconnected
();
emit
connected
(
false
);
}
return
true
;
}
...
...
@@ -136,9 +137,6 @@ void MockLink::run(void)
_timer50HzTasks
.
start
(
20
);
exec
();
emit
disconnected
();
emit
connected
(
false
);
}
void
MockLink
::
_run1HzTasks
(
void
)
...
...
@@ -382,15 +380,17 @@ void MockLink::_handleParamRequestList(const mavlink_message_t& msg)
for
(
param
=
_parameters
.
begin
();
param
!=
_parameters
.
end
();
param
++
)
{
mavlink_message_t
responseMsg
;
char
paramId
[
MAVLINK_MSG_ID_PARAM_VALUE_LEN
];
strncpy
(
paramId
,
param
.
key
().
toLocal8Bit
().
constData
(),
MAVLINK_MSG_ID_PARAM_VALUE_LEN
);
mavlink_msg_param_value_pack
(
_vehicleSystemId
,
_vehicleComponentId
,
&
responseMsg
,
// Outgoing message
param
.
key
().
toLocal8Bit
().
constData
(),
// Parameter name
param
.
value
().
toFloat
(),
// Parameter vluae
MAV_PARAM_TYPE_REAL32
,
// FIXME: Pull from QVariant type
_cParameters
,
// Total number of parameters
paramIndex
++
);
// Index of this parameter
&
responseMsg
,
// Outgoing message
param
Id
,
// Parameter name
param
.
value
().
toFloat
(),
// Parameter vluae
MAV_PARAM_TYPE_REAL32
,
// FIXME: Pull from QVariant type
_cParameters
,
// Total number of parameters
paramIndex
++
);
// Index of this parameter
_emitMavlinkMessage
(
responseMsg
);
}
}
else
{
...
...
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