.. _program_listing_file__tmp_ws_src_mavros_mavros_include_mavros_plugin_filter.hpp: Program Listing for File plugin_filter.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/mavros/mavros/include/mavros/plugin_filter.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright 2021 Vladimir Ermakov. * * This file is part of the mavros package and subject to the license terms * in the top-level LICENSE file of the mavros repository. * https://github.com/mavlink/mavros/tree/master/LICENSE.md */ #pragma once #ifndef MAVROS__PLUGIN_FILTER_HPP_ #define MAVROS__PLUGIN_FILTER_HPP_ #include #include #include namespace mavros { namespace plugin { namespace filter { using mavros::plugin::Filter; using mavros::uas::UAS; using UASPtr = UAS::SharedPtr; using mavconn::Framing; class AnyOk : public Filter { public: inline bool operator()( UASPtr uas, const mavlink::mavlink_message_t * cmsg, const Framing framing) override { (void)uas; (void)cmsg; return framing == Framing::ok; } }; class SystemAndOk : public Filter { public: inline bool operator()( UASPtr uas, const mavlink::mavlink_message_t * cmsg, const Framing framing) override { return framing == Framing::ok && uas->is_my_target(cmsg->sysid); } }; // system/component ids class ComponentAndOk : public Filter { public: inline bool operator()( UASPtr uas, const mavlink::mavlink_message_t * cmsg, const Framing framing) override { return framing == Framing::ok && uas->is_my_target(cmsg->sysid, cmsg->compid); } }; } // namespace filter } // namespace plugin } // namespace mavros #endif // MAVROS__PLUGIN_FILTER_HPP_