2019-03-04 14:13:01 -04:00
|
|
|
/*
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
Author: Francisco Ferreira
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-10 14:33:54 -04:00
|
|
|
#include "AP_NMEA_Output_config.h"
|
2021-07-24 07:22:19 -03:00
|
|
|
|
|
|
|
#if HAL_NMEA_OUTPUT_ENABLED
|
2019-03-04 14:13:01 -04:00
|
|
|
|
2022-02-21 23:37:52 -04:00
|
|
|
#ifndef NMEA_MAX_OUTPUTS
|
|
|
|
#define NMEA_MAX_OUTPUTS 3
|
|
|
|
#endif
|
|
|
|
|
2023-01-10 14:33:54 -04:00
|
|
|
#include <AP_Param/AP_Param.h>
|
|
|
|
|
2019-03-04 14:13:01 -04:00
|
|
|
class AP_NMEA_Output {
|
|
|
|
|
|
|
|
public:
|
2023-01-10 14:33:54 -04:00
|
|
|
|
|
|
|
AP_NMEA_Output() {
|
|
|
|
// setup parameter defaults
|
|
|
|
AP_Param::setup_object_defaults(this, var_info);
|
|
|
|
}
|
2019-03-04 14:13:01 -04:00
|
|
|
|
|
|
|
/* Do not allow copies */
|
2021-07-24 07:22:19 -03:00
|
|
|
CLASS_NO_COPY(AP_NMEA_Output);
|
2019-03-04 14:13:01 -04:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2023-01-10 14:33:54 -04:00
|
|
|
void init();
|
2019-03-04 14:13:01 -04:00
|
|
|
|
2023-01-10 14:33:54 -04:00
|
|
|
enum class Enabled_Messages {
|
|
|
|
GPGGA = (1<<0),
|
|
|
|
GPRMC = (1<<1),
|
|
|
|
PASHR = (1<<2),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
|
|
|
|
private:
|
2019-03-04 14:13:01 -04:00
|
|
|
|
|
|
|
uint8_t _num_outputs;
|
2022-02-21 23:37:52 -04:00
|
|
|
AP_HAL::UARTDriver* _uart[NMEA_MAX_OUTPUTS];
|
2019-03-04 14:13:01 -04:00
|
|
|
|
2019-11-28 20:46:02 -04:00
|
|
|
uint32_t _last_run_ms;
|
2023-01-10 14:33:54 -04:00
|
|
|
|
|
|
|
AP_Int16 _interval_ms;
|
|
|
|
AP_Int16 _message_enable_bitmask;
|
2019-03-04 14:13:01 -04:00
|
|
|
};
|
|
|
|
|
2023-01-10 14:33:54 -04:00
|
|
|
#endif // !HAL_NMEA_OUTPUT_ENABLED
|