AP_GPS_MAV.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. //
  14. // Mavlink GPS driver which accepts gps position data from an external
  15. // companion computer
  16. //
  17. #pragma once
  18. #include <AP_Common/AP_Common.h>
  19. #include <AP_HAL/AP_HAL.h>
  20. #include "AP_GPS.h"
  21. #include "GPS_Backend.h"
  22. class AP_GPS_MAV : public AP_GPS_Backend {
  23. public:
  24. AP_GPS_MAV(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UARTDriver *_port);
  25. bool read() override;
  26. static bool _detect(struct MAV_detect_state &state, uint8_t data);
  27. void handle_msg(const mavlink_message_t &msg) override;
  28. const char *name() const override { return "MAV"; }
  29. private:
  30. bool _new_data;
  31. };