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
dd1af1e4
Commit
dd1af1e4
authored
Apr 28, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multi-component list request bug
parent
4273d0c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
MockLink.cc
src/comm/MockLink.cc
+43
-0
No files found.
src/comm/MockLink.cc
View file @
dd1af1e4
...
...
@@ -464,6 +464,9 @@ void MockLink::_handleParamRequestList(const mavlink_message_t& msg)
Q_ASSERT
(
request
.
target_system
==
_vehicleSystemId
);
Q_ASSERT
(
request
.
target_component
==
MAV_COMP_ID_ALL
);
// We must send the first parameter for each component first. Otherwise system won't correctly know
// when all parameters are loaded.
foreach
(
int
componentId
,
_mapParamName2Value
.
keys
())
{
uint16_t
paramIndex
=
0
;
...
...
@@ -492,6 +495,46 @@ void MockLink::_handleParamRequestList(const mavlink_message_t& msg)
cParameters
,
// Total number of parameters
paramIndex
++
);
// Index of this parameter
_emitMavlinkMessage
(
responseMsg
);
// Only first parameter the first time through
break
;
}
}
foreach
(
int
componentId
,
_mapParamName2Value
.
keys
())
{
uint16_t
paramIndex
=
0
;
int
cParameters
=
_mapParamName2Value
[
componentId
].
count
();
bool
skipParam
=
true
;
foreach
(
QString
paramName
,
_mapParamName2Value
[
componentId
].
keys
())
{
if
(
skipParam
)
{
// We've already sent the first param
skipParam
=
true
;
paramIndex
++
;
}
else
{
char
paramId
[
MAVLINK_MSG_ID_PARAM_VALUE_LEN
];
mavlink_message_t
responseMsg
;
Q_ASSERT
(
_mapParamName2Value
[
componentId
].
contains
(
paramName
));
Q_ASSERT
(
_mapParamName2MavParamType
.
contains
(
paramName
));
MAV_PARAM_TYPE
paramType
=
_mapParamName2MavParamType
[
paramName
];
Q_ASSERT
(
paramName
.
length
()
<=
MAVLINK_MSG_ID_PARAM_VALUE_LEN
);
strncpy
(
paramId
,
paramName
.
toLocal8Bit
().
constData
(),
MAVLINK_MSG_ID_PARAM_VALUE_LEN
);
qCDebug
(
MockLinkLog
)
<<
"Sending msg_param_value"
<<
componentId
<<
paramId
<<
paramType
<<
_mapParamName2Value
[
componentId
][
paramId
];
mavlink_msg_param_value_pack
(
_vehicleSystemId
,
componentId
,
// component id
&
responseMsg
,
// Outgoing message
paramId
,
// Parameter name
_floatUnionForParam
(
componentId
,
paramName
),
// Parameter value
paramType
,
// MAV_PARAM_TYPE
cParameters
,
// Total number of parameters
paramIndex
++
);
// Index of this parameter
_emitMavlinkMessage
(
responseMsg
);
}
}
}
}
...
...
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