

/**
 * @file gps_helper.h
 * @author Thomas Gubler <thomasgubler@student.ethz.ch>
 * @author Julian Oes <joes@student.ethz.ch>
 */

#ifndef GPS_HELPER_H
#define GPS_HELPER_H

#include <uORB/uORB.h>
#include <uORB/topics/vehicle_gps_position.h>

#define GPS_EPOCH_SECS 1234567890ULL

class GPS_Helper
{
public:

	GPS_Helper() {};
	virtual ~GPS_Helper() {};

	virtual int			configure(unsigned &baud) = 0;
	virtual int 			receive(unsigned timeout) = 0;
	int 				set_baudrate(const int &fd, unsigned baud);
	float				get_position_update_rate();
	float				get_velocity_update_rate();
	void				reset_update_rates();
	void				store_update_rates();

protected:
	uint8_t _rate_count_lat_lon;
	uint8_t _rate_count_vel;

	float _rate_lat_lon = 0.0f;
	float _rate_vel = 0.0f;

	uint64_t _interval_rate_start;
};

#endif /* GPS_HELPER_H */
