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
cb2892bc
Commit
cb2892bc
authored
Nov 22, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One heartbeat per-link, not per-vehicle
parent
128b8d8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
MultiVehicleManager.cc
src/Vehicle/MultiVehicleManager.cc
+21
-14
No files found.
src/Vehicle/MultiVehicleManager.cc
View file @
cb2892bc
...
@@ -303,20 +303,27 @@ void MultiVehicleManager::setGcsHeartbeatEnabled(bool gcsHeartBeatEnabled)
...
@@ -303,20 +303,27 @@ void MultiVehicleManager::setGcsHeartbeatEnabled(bool gcsHeartBeatEnabled)
void
MultiVehicleManager
::
_sendGCSHeartbeat
(
void
)
void
MultiVehicleManager
::
_sendGCSHeartbeat
(
void
)
{
{
for
(
int
i
=
0
;
i
<
_vehicles
.
count
();
i
++
)
{
// Send a heartbeat out on each link
Vehicle
*
vehicle
=
qobject_cast
<
Vehicle
*>
(
_vehicles
[
i
]);
QmlObjectListModel
*
links
=
_toolbox
->
linkManager
()
->
links
();
for
(
int
i
=
0
;
i
<
links
->
count
();
i
++
)
{
mavlink_message_t
message
;
LinkInterface
*
link
=
links
->
value
<
LinkInterface
*>
(
i
);
mavlink_msg_heartbeat_pack_chan
(
_mavlinkProtocol
->
getSystemId
(),
if
(
link
->
isConnected
())
{
_mavlinkProtocol
->
getComponentId
(),
mavlink_message_t
message
;
vehicle
->
priorityLink
()
->
mavlinkChannel
(),
mavlink_msg_heartbeat_pack_chan
(
_mavlinkProtocol
->
getSystemId
(),
&
message
,
_mavlinkProtocol
->
getComponentId
(),
MAV_TYPE_GCS
,
// MAV_TYPE
link
->
mavlinkChannel
(),
MAV_AUTOPILOT_INVALID
,
// MAV_AUTOPILOT
&
message
,
MAV_MODE_MANUAL_ARMED
,
// MAV_MODE
MAV_TYPE_GCS
,
// MAV_TYPE
0
,
// custom mode
MAV_AUTOPILOT_INVALID
,
// MAV_AUTOPILOT
MAV_STATE_ACTIVE
);
// MAV_STATE
MAV_MODE_MANUAL_ARMED
,
// MAV_MODE
vehicle
->
sendMessageOnLink
(
vehicle
->
priorityLink
(),
message
);
0
,
// custom mode
MAV_STATE_ACTIVE
);
// MAV_STATE
uint8_t
buffer
[
MAVLINK_MAX_PACKET_LEN
];
int
len
=
mavlink_msg_to_send_buffer
(
buffer
,
&
message
);
link
->
writeBytesSafe
((
const
char
*
)
buffer
,
len
);
}
}
}
}
}
...
...
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