diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-06-11 14:00:44 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-06-11 14:00:44 +0200 |
commit | 342e08977ae5bf49c5ba941866e44fddefca4cda (patch) | |
tree | 6f50d14687c441f14715cfa55b17599e46d9f5f9 /src/modules/mavlink/mavlink_commands.cpp | |
parent | fb4bcf87ba036a2791f303deee8eeda4174bad61 (diff) | |
download | px4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.tar.gz px4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.tar.bz2 px4-firmware-342e08977ae5bf49c5ba941866e44fddefca4cda.zip |
MavlinkOrbSubscription API reworked
Diffstat (limited to 'src/modules/mavlink/mavlink_commands.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_commands.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/modules/mavlink/mavlink_commands.cpp b/src/modules/mavlink/mavlink_commands.cpp index 5760d7512..fccd4d9a5 100644 --- a/src/modules/mavlink/mavlink_commands.cpp +++ b/src/modules/mavlink/mavlink_commands.cpp @@ -40,21 +40,17 @@ #include "mavlink_commands.h" -MavlinkCommandsStream::MavlinkCommandsStream(Mavlink *mavlink, mavlink_channel_t channel) : _channel(channel) +MavlinkCommandsStream::MavlinkCommandsStream(Mavlink *mavlink, mavlink_channel_t channel) : _channel(channel), _cmd_time(0) { _cmd_sub = mavlink->add_orb_subscription(ORB_ID(vehicle_command)); } -MavlinkCommandsStream::~MavlinkCommandsStream() -{ -} - void MavlinkCommandsStream::update(const hrt_abstime t) { struct vehicle_command_s cmd; - if (_cmd_sub->update(t, &cmd)) { + if (_cmd_sub->update(&_cmd_time, &cmd)) { /* only send commands for other systems/components */ if (cmd.target_system != mavlink_system.sysid || cmd.target_component != mavlink_system.compid) { mavlink_msg_command_long_send(_channel, |