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
1749b2a1
Commit
1749b2a1
authored
Oct 15, 2016
by
Don Gagne
Committed by
GitHub
Oct 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4139 from DonLakeFlyer/AdjustEncodeChan
Adjust incoming message on channel 0
parents
19c64921
7d47f63a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
APMFirmwarePlugin.cc
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
+24
-10
LinkManager.cc
src/comm/LinkManager.cc
+2
-2
No files found.
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
View file @
1749b2a1
...
...
@@ -251,9 +251,12 @@ void APMFirmwarePlugin::_handleIncomingParamValue(Vehicle* vehicle, mavlink_mess
paramValue
.
param_value
=
paramUnion
.
param_float
;
// Re-Encoding is always done using mavlink 1.0
mavlink_status_t
*
mavlinkStatusReEncode
=
mavlink_get_channel_status
(
0
);
mavlinkStatusReEncode
->
flags
|=
MAVLINK_STATUS_FLAG_IN_MAVLINK1
;
mavlink_msg_param_value_encode_chan
(
message
->
sysid
,
message
->
compid
,
vehicle
->
priorityLink
()
->
mavlinkChannel
(),
0
,
// Re-encoding uses reserved channel 0
message
,
&
paramValue
);
}
...
...
@@ -522,10 +525,14 @@ void APMFirmwarePlugin::_adjustSeverity(mavlink_message_t* message) const
break
;
}
mavlink_msg_statustext_encode
(
message
->
sysid
,
message
->
compid
,
message
,
&
statusText
);
// Re-Encoding is always done using mavlink 1.0
mavlink_status_t
*
mavlinkStatusReEncode
=
mavlink_get_channel_status
(
0
);
mavlinkStatusReEncode
->
flags
|=
MAVLINK_STATUS_FLAG_IN_MAVLINK1
;
mavlink_msg_statustext_encode_chan
(
message
->
sysid
,
message
->
compid
,
0
,
// Re-encoding uses reserved channel 0
message
,
&
statusText
);
}
void
APMFirmwarePlugin
::
_setInfoSeverity
(
mavlink_message_t
*
message
)
const
...
...
@@ -533,19 +540,26 @@ void APMFirmwarePlugin::_setInfoSeverity(mavlink_message_t* message) const
mavlink_statustext_t
statusText
;
mavlink_msg_statustext_decode
(
message
,
&
statusText
);
// Re-Encoding is always done using mavlink 1.0
mavlink_status_t
*
mavlinkStatusReEncode
=
mavlink_get_channel_status
(
0
);
mavlinkStatusReEncode
->
flags
|=
MAVLINK_STATUS_FLAG_IN_MAVLINK1
;
statusText
.
severity
=
MAV_SEVERITY_INFO
;
mavlink_msg_statustext_encode
(
message
->
sysid
,
message
->
compid
,
message
,
&
statusText
);
mavlink_msg_statustext_encode_chan
(
message
->
sysid
,
message
->
compid
,
0
,
// Re-encoding uses reserved channel 0
message
,
&
statusText
);
}
void
APMFirmwarePlugin
::
_adjustCalibrationMessageSeverity
(
mavlink_message_t
*
message
)
const
{
mavlink_statustext_t
statusText
;
mavlink_msg_statustext_decode
(
message
,
&
statusText
);
// Re-Encoding is always done using mavlink 1.0
mavlink_status_t
*
mavlinkStatusReEncode
=
mavlink_get_channel_status
(
0
);
mavlinkStatusReEncode
->
flags
|=
MAVLINK_STATUS_FLAG_IN_MAVLINK1
;
statusText
.
severity
=
MAV_SEVERITY_INFO
;
mavlink_msg_statustext_encode
(
message
->
sysid
,
message
->
compid
,
message
,
&
statusText
);
mavlink_msg_statustext_encode
_chan
(
message
->
sysid
,
message
->
compid
,
0
,
message
,
&
statusText
);
}
void
APMFirmwarePlugin
::
initializeVehicle
(
Vehicle
*
vehicle
)
...
...
src/comm/LinkManager.cc
View file @
1749b2a1
...
...
@@ -186,8 +186,8 @@ void LinkManager::_addLink(LinkInterface* link)
if
(
!
_links
.
contains
(
link
))
{
bool
channelSet
=
false
;
// Find a mavlink channel to use for this link
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
// Find a mavlink channel to use for this link
, Channel 0 is reserved for internal use.
for
(
int
i
=
1
;
i
<
32
;
i
++
)
{
if
(
!
(
_mavlinkChannelsUsedBitMask
&
1
<<
i
))
{
mavlink_reset_channel_status
(
i
);
link
->
_setMavlinkChannel
(
i
);
...
...
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