Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
e03fb849
Commit
e03fb849
authored
8 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
Allow FirmwarePlugin to drop incoming messages
parent
3b00e145
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/FirmwarePlugin/FirmwarePlugin.cc
+2
-1
2 additions, 1 deletion
src/FirmwarePlugin/FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.h
+2
-1
2 additions, 1 deletion
src/FirmwarePlugin/FirmwarePlugin.h
src/Vehicle/Vehicle.cc
+3
-1
3 additions, 1 deletion
src/Vehicle/Vehicle.cc
with
7 additions
and
3 deletions
src/FirmwarePlugin/FirmwarePlugin.cc
+
2
−
1
View file @
e03fb849
...
...
@@ -93,11 +93,12 @@ int FirmwarePlugin::manualControlReservedButtonCount(void)
return
-
1
;
}
void
FirmwarePlugin
::
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
bool
FirmwarePlugin
::
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
Q_UNUSED
(
vehicle
);
Q_UNUSED
(
message
);
// Generic plugin does no message adjustment
return
true
;
}
void
FirmwarePlugin
::
adjustOutgoingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
...
...
This diff is collapsed.
Click to expand it.
src/FirmwarePlugin/FirmwarePlugin.h
+
2
−
1
View file @
e03fb849
...
...
@@ -120,7 +120,8 @@ public:
/// spec implementations such that the base code can remain mavlink generic.
/// @param vehicle Vehicle message came from
/// @param message[in,out] Mavlink message to adjust if needed.
virtual
void
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
/// @return false: skip message, true: process message
virtual
bool
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
/// Called before any mavlink message is sent to the Vehicle so plugin can adjust any message characteristics.
/// This is handy to adjust or differences in mavlink spec implementations such that the base code can remain
...
...
This diff is collapsed.
Click to expand it.
src/Vehicle/Vehicle.cc
+
3
−
1
View file @
e03fb849
...
...
@@ -377,7 +377,9 @@ void Vehicle::_mavlinkMessageReceived(LinkInterface* link, mavlink_message_t mes
}
// Give the plugin a change to adjust the message contents
_firmwarePlugin
->
adjustIncomingMavlinkMessage
(
this
,
&
message
);
if
(
!
_firmwarePlugin
->
adjustIncomingMavlinkMessage
(
this
,
&
message
))
{
return
;
}
switch
(
message
.
msgid
)
{
case
MAVLINK_MSG_ID_HOME_POSITION
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment