AP_NMEA_Output.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Author: Francisco Ferreira
  13. */
  14. #pragma once
  15. #include <AP_HAL/AP_HAL.h>
  16. #include <AP_AHRS/AP_AHRS.h>
  17. #if !HAL_MINIMIZE_FEATURES && AP_AHRS_NAVEKF_AVAILABLE
  18. #include <AP_SerialManager/AP_SerialManager.h>
  19. class AP_NMEA_Output {
  20. public:
  21. static AP_NMEA_Output* probe();
  22. /* Do not allow copies */
  23. AP_NMEA_Output(const AP_NMEA_Output &other) = delete;
  24. AP_NMEA_Output &operator=(const AP_NMEA_Output&) = delete;
  25. void update();
  26. private:
  27. AP_NMEA_Output();
  28. uint8_t _nmea_checksum(const char *str);
  29. static AP_NMEA_Output* _singleton;
  30. uint8_t _num_outputs;
  31. AP_HAL::UARTDriver* _uart[SERIALMANAGER_NUM_PORTS];
  32. uint16_t _last_sent;
  33. };
  34. #endif // !HAL_MINIMIZE_FEATURES && AP_AHRS_NAVEKF_AVAILABLE